Image

All image classes should be derived from this base. Implements some basic functionality, such as reading and writing pixels, basic data storage, and basic information. Pixeldata should be stored decompressed, but indexing should be preserved on loading with the opinion of upconverting to truecolor.

Members

Functions

flipHorizontal
void flipHorizontal()

Flips the image on the vertical axis. Useful to set images to the correct top-left screen origin point.

flipVertical
void flipVertical()

Flips the image on the vertical axis. Useful to set images to the correct top-left screen origin point.

getBitplanes
ubyte getBitplanes()

Returns the number of planes the image have. Default is one.

imageData
IImageData imageData()

Returns the image data.

palette
IPalette palette()

Returns a palette range, which can be used to read the palette.

readPalette
ARGB8888 readPalette(size_t index)

Looks up the index on the palette, then returns the color value as a 32 bit value.

readPixel
ARGB8888 readPixel(uint x, uint y)

Reads a single 32bit pixel. If the image is indexed, a color lookup will be done.

rightSideOrigin
bool rightSideOrigin()

Returns true if the image originates from the right

topOrigin
bool topOrigin()

Returns true if the image originates from the top

Properties

backgroundColor
ARGB8888 backgroundColor [@property getter]

Returns the background color if there's any, or a default value otherwise.

backgroundColorIndex
int backgroundColorIndex [@property getter]

Returns the background color index if there's any. Returns -1 if there's no background color, -2 if background color is not indexed.

getBitdepth
ubyte getBitdepth [@property getter]

Returns the number of bits used per sample.

getPaletteBitdepth
ubyte getPaletteBitdepth [@property getter]

Returns the number of bits used per colormap entry.

getPalettePixelFormat
uint getPalettePixelFormat [@property getter]

Returns the pixelformat of the palette. See enumerator PixelFormat for more info.

getPixelFormat
uint getPixelFormat [@property getter]

Returns the pixelformat of the image. See enumerator PixelFormat for more info.

height
uint height [@property getter]

Returns the height of the image in pixels.

isIndexed
bool isIndexed [@property getter]

Returns true if the image is indexed.

width
uint width [@property getter]

Returns the width of the image in pixels.

Variables

_imageData
IImageData _imageData;

Contains image data and information.

_palette
IPalette _palette;

Contains palette data and information

mod
ubyte mod;

used for fast access of indexes DEPRECATED!

shift
ubyte shift;

used for fast access of indexes DEPRECATED!

Meta