Pixmap

Pixel data container

Constructors

this
deprecated this(Size size)
this
deprecated this(int width, int height)
this
this(inout(Pixel)[] data, int width)

Members

Aliases

scan2D
deprecated alias scan2D = scanArea

TODO: remove

scanSubPixmap
deprecated alias scanSubPixmap = scanArea

TODO: remove

Functions

accessPixel
inout(Pixel) accessPixel(Point pos)

Provides access to a single pixel at the requested 2D-position.

adjustTo
void adjustTo(PixmapBlueprint blueprint)

Adjusts the Pixmap according to the provided blueprint.

clear
void clear(Pixel value)

Clears the buffer’s contents (by setting each pixel to the same color)

clone
Pixmap clone()

Creates a deep copy of the Pixmap

copyTo
Pixmap copyTo(Pixmap target)

Copies the pixel data to the target Pixmap.

getPixel
Pixel getPixel(Point pos)
Pixel getPixel(int x, int y)

Provides access to a single pixel at the requested 2D-position.

height
int height()

Height of the buffer, i.e. the number of lines

length
int length()

Length of the buffer, i.e. the number of pixels

pitch
int pitch()

Number of bytes per line

scan
inout(Pixel) scan(Point pos)

Accesses the pixel at the requested position within the pixmap data.

scan
inout(Pixel)[] scan(Point pos, int n)

Retrieves a linear slice of the pixmap.

scanArea
inout(SubPixmap) scanArea(Point pos, Size size)

Retrieves a rectangular subimage of the pixmap.

scanLine
inout(Pixel)[] scanLine()

Retrieves the first line of the Pixmap.

scanTo
int scanTo(Point pos)

Calculates the index (linear offset) of the requested position within the pixmap data.

setPixel
void setPixel(Point pos, Pixel value)
void setPixel(int x, int y, Pixel value)

Provides access to a single pixel at the requested 2D-position.

size
void size(Size value)
void size(int totalPixels, int width)

Changes the size of the buffer

size
Size size()

Rectangular size of the buffer

sliceAt
inout(Pixel)[] sliceAt(Point pos, int n)

Retrieves a linear slice of the pixmap.

Static functions

fromMemoryImage
Pixmap fromMemoryImage(MemoryImage source)

Creates a Pixmap wrapping the pixel data from the provided MemoryImage.

fromTrueColorImage
Pixmap fromTrueColorImage(TrueColorImage source)

Creates a Pixmap wrapping the pixel data from the provided TrueColorImage.

makeNew
Pixmap makeNew(PixmapBlueprint blueprint)
makeNew
Pixmap makeNew(Size size)

Variables

data
Pixel[] data;

Pixel data

width
int width;

Pixel per row

Meta