Bitmap

Implements a bitmap with variable bit depth. Use the aliases to initialize them. Note for 16Bit bitmap: It's using the master palette, It's not implementing any 16 bit RGB or RGBA color space directly. Can implement such colorspaces via proper lookup tables. Note for 4Bit bitmap: It's width needs to be an even number (for rendering simplicity), otherwise it'll cause an exception.

Constructors

this
this(int x, int y, Color* palettePtr)

Creates an empty bitmap.

this
this(ubyte[] p, int x, int y, Color* palettePtr)

Creates a bitmap from an array.

this
this(int x, int y, Color* palettePtr)

Creates an empty bitmap.

this
this(ubyte[] p, int x, int y, Color* palettePtr)

Creates a bitmap from an array.

this
this(int x, int y)

Creates an empty bitmap.

this
this(ushort[] p, int x, int y)

Creates a bitmap from an array.

this
this(int x, int y)

Creates an empty bitmap.

this
this(Color[] p, int x, int y)

Creates a bitmap from an array.

Members

Functions

clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
generateStandardCollisionModel
AdvancedBitArray generateStandardCollisionModel()
Undocumented in source. Be warned that the author may not have intended to support it.
generateStandardCollisionModel
AdvancedBitArray generateStandardCollisionModel()
Undocumented in source. Be warned that the author may not have intended to support it.
getPtr
T* getPtr()
Undocumented in source. Be warned that the author may not have intended to support it.
offsetIndexes
void offsetIndexes(ushort offset, bool keepZerothIndex)

Offsets all indexes in the bitmap by a certain value. Keeps zeroth index (usually for transparency) if needed. Useful when converting bitmaps.

readPixel
T readPixel(int x, int y)

Returns the pixel at the given position.

readPixel
ubyte readPixel(int x, int y)

Returns the pixel at the given position.

resize
void resize(int x, int y)

Resizes the bitmap. NOTE: It's not for scaling.

resize
void resize(int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
writePixel
void writePixel(int x, int y, T color)

Writes the pixel at the given position.

writePixel
void writePixel(int x, int y, ubyte color)

Writes the pixel at the given position.

Properties

wordLengthByString
string wordLengthByString [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

pixels
T[] pixels;
Undocumented in source.

Inherited Members

From ABitmap

width
int width [@property getter]

Returns the width of the bitmap.

height
int height [@property getter]

Returns the height of the bitmap.

generateStandardCollisionModel
AdvancedBitArray generateStandardCollisionModel()
Undocumented in source.
getPalettePtr
Color* getPalettePtr()

Returns the palette pointer.

setPalettePtr
void setPalettePtr(Color* p)

Sets the palette pointer. Make sure that you set it to a valid memory location.

wordLengthByString
string wordLengthByString [@property getter]

Returns the wordlength of the type

clear
void clear()

Clears the whole bitmap to a transparent color.

Meta