mirror of
https://github.com/adamdruppe/arsd.git
synced 2025-04-26 13:20:05 +03:00
Add ctor for making Pixmaps from user-provided slice
This commit is contained in:
parent
9f792bdfeb
commit
dfddea5960
1 changed files with 8 additions and 0 deletions
|
@ -226,10 +226,18 @@ struct Pixmap {
|
|||
|
||||
@safe pure nothrow:
|
||||
|
||||
///
|
||||
this(Size size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
///
|
||||
this(Pixel[] data, int width) @nogc
|
||||
in (data.length % width == 0) {
|
||||
this.data = data;
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
// undocumented: really shouldn’t be used.
|
||||
// carries the risks of `length` and `width` getting out of sync accidentally.
|
||||
deprecated("Use `size` instead.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue