Palette

Contains palette information. Implements some range capabilities.

Constructors

this
this(T[] data, uint format, ubyte bitDepth)

CTOR

this
this(Palette!T src)

Copy CTOR

Members

Aliases

opDollar
alias opDollar = length
Undocumented in source.

Functions

back
T back()

Returns the element at the back

convTo
IPalette convTo(uint format)

Converts the palette to the given format if supported.

front
T front()

Returns the element at the front

getRawData
T[] getRawData()

Returns the raw data as an array.

moveBack
T moveBack()

Moves the back pointer backward and returns the element

moveFront
T moveFront()

Moves the front pointer forward by one and returns the element

opIndex
T opIndex(size_t index)

Palette indexing.

popBack
void popBack()

Moves the back pointer backward by one

popFront
void popFront()

Moves the front pointer forward by one

raw
ubyte[] raw()

Returns the raw data cast to ubyte

read
ARGB8888 read(size_t index)

Reads palette in standard format.

readF
RGBA_f32 readF(size_t index)

Reads palette in standard format.

save
Palette!T save()

Creates a copy with the front and back pointers reset

Properties

bitDepth
ubyte bitDepth [@property getter]

Returns the bitdepth of the palette.

empty
bool empty [@property getter]

Returns true if the range have reached its end

length
size_t length [@property getter]

Returns the number of indexes within the palette.

paletteFormat
uint paletteFormat [@property getter]

Returns the color format of the palette.

Variables

_bitDepth
ubyte _bitDepth;
Undocumented in source.
begin
size_t begin;
Undocumented in source.
data
T[] data;

Raw data

end
size_t end;
Undocumented in source.
format
uint format;
Undocumented in source.

Inherited Members

From IPalette

length
size_t length [@property getter]

Returns the number of indexes within the palette.

bitDepth
ubyte bitDepth [@property getter]

Returns the bitdepth of the palette.

paletteFormat
uint paletteFormat [@property getter]

Returns the color format of the palette.

convTo
IPalette convTo(uint format)

Converts the palette to the given format if supported

read
ARGB8888 read(size_t index)

Reads palette in standard indexed format

readF
RGBA_f32 readF(size_t index)

Reads palette in standard floating point format

raw
ubyte[] raw()

Returns the raw data cast to ubyte

Meta