Bitmap

2D bitmap. Each pixel is coded with a fixed number of bytes.

Pixel sizes: ubyte[1] => grayscale ubyte[2] => grayscale + alpha ubyte[3] => RGB ubyte[4] => RGBA

Constructors

this
this(size_t width, size_t height)
Undocumented in source.

Members

Functions

opIndex
inout(Pixel) opIndex(size_t x, size_t y)

Access a given pixel with Bitmap[x, y]

toBMP
ubyte[] toBMP()

// Rotate the image by increments of 90° counter clockwise Serialize to a BMP file. Alpha data is lost.

toPNG
ubyte[] toPNG()

Serialize to a PNG file

Variables

height
size_t height;
Undocumented in source.
pixels
Pixel[] pixels;
Undocumented in source.
width
size_t width;
Undocumented in source.

Meta