Image

Image available to the CPU.

Constructors

this
this(Color[] rgbaPixels, int width, int height)

Create an RGBA image.

this
this(PalettedColor[] palettedAlphaPixels, int width, int height)

Create a paletted image.

this
this(ubyte[] alphaPixels, int width, int height)

Create an alpha mask.

Members

Enums

Format
enum Format
Undocumented in source.

Functions

area
int area()
Undocumented in source. Be warned that the author may not have intended to support it.
clear
void clear(PalettedColor entry)

Clear the image, replacing every pixel with given color.

clear
void clear(Color color)

Clear the image, replacing every pixel with given color.

data
inout(void)[] data()

Get data of the image in raw form.

get
Color get(int x, int y)

Get color at given position. Position must be in image bounds.

paletteColor
Color paletteColor(PalettedColor pixel)

Get a palette entry at given index.

set
void set(int x, int y, Color color)
void set(int x, int y, PalettedColor entry)

Set color at given position. Does nothing if position is out of bounds.

size
Vector2 size()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

alphaPixels
ubyte[] alphaPixels;

Image data. Make sure to access data relevant to the current format.

format
Format format;
height
int height;
Undocumented in source.
palette
Color[] palette;

Palette data, if relevant. Access into an invalid palette index is equivalent to full white.

palettedAlphaPixels
PalettedColor[] palettedAlphaPixels;

Image data. Make sure to access data relevant to the current format.

rgbaPixels
Color[] rgbaPixels;

Image data. Make sure to access data relevant to the current format.

width
int width;
Undocumented in source.

Meta