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.
canvasSize
Vector2 canvasSize()
clear
void clear(Color color)
void clear(PalettedColor entry)

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.
toRGBA
Image toRGBA()

Convert to an RGBA image.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
void toString(Writer writer)
Undocumented in source. Be warned that the author may not have intended to support it.
viewportSize
deprecated Vector2 viewportSize()
viewportSize
Vector2 viewportSize(Vector2 dpi)

Variables

alphaPixels
ubyte[] alphaPixels;

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

dpiX
int dpiX;
dpiY
int dpiY;

Dots per inch for the X and Y axis. Defaults to 96, thus making a dot in the texture equivalent to a pixel.

format
Format format;
Undocumented in source.
height
int height;

Width and height of the texture, **in dots**. The meaning of a dot is defined by dpiX and dpiY

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.

revisionNumber
int revisionNumber;

This number should be incremented after editing the image to signal CanvasIO that a change has been made.

rgbaPixels
Color[] rgbaPixels;

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

width
int width;

Width and height of the texture, **in dots**. The meaning of a dot is defined by dpiX and dpiY

Meta