The palette class represents a 256 color palette for 8 bit indexed color formats.
Internally each palette object maintains an array of 256 32 bit integer color values packed in ARGB8888 format.
Palette objects are typically used to set the surface palette with Surface::palette(const Palette &palette).
They are also used, although less frequently, to load and save surface pixels with Surface::load() and Surface::save().
And, even less frequently, they are used with the low level pixel copying and conversion routine Copy::palette().
Default constructor.
All palette color entries are set to black.
Creates a palette object with its color entries set to the color values in data.
The data array is an array of r,g,b,a color values packed into a 32 bit integer in the format ARGB8888.
Copy constructor.
Frees all palette memory and checks if the palette is still locked.
Gets a pointer to the palette data array.
The data array is an array of r,g,b,a color values packed into a 32 bit integer in the format ARGB8888.
Each successful palette lock must be accompanied by an unlock.
Only one lock is allowed on a palette object at any one time.
Unlocks the palette color data after a call to lock.
If unlock is called and the palette is not locked a ptc::Error exception will be thrown.
Loads the color values from data to the palette.
The data array is an array of r,g,b,a color values packed into a 32 bit integer in the format ARGB8888.
Saves the palette color values to the color array data.
The data array is an array of r,g,b,a color values packed into a 32 bit integer in the format ARGB8888.
Gets a read-only pointer to the palette data array.
The data array is an array of r,g,b,a color values packed into a 32 bit integer in the format ARGB8888.
Assignment operator.
Equality operator.
Inequality operator.