Struct Bitmap

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

struct Bitmap(Pixel) ;

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

Constructors

NameDescription
this (width, height)

Fields

NameTypeDescription
height size_t
pixels Pixel[]
width size_t

Methods

NameDescription
opIndex (x, y) Access a given pixel with Bitmap[x, y]
toBMP () Rotate the image by increments of 90° counter clockwise
toPNG () Serialize to a PNG file