|
| PaletteLookup (const byte *palette, uint len) |
| Construct a new Palette Lookup object. More...
|
|
bool | setPalette (const byte *palette, uint len) |
| Pass palette to the look up. It also compares given palette with the current one and resets cache only when their contents is different. More...
|
|
byte | findBestColor (byte r, byte g, byte b, bool useNaiveAlg=false) |
| This method returns closest color from the palette and it uses cache for faster lookups. More...
|
|
uint32 * | createMap (const byte *srcPalette, uint len, bool useNaiveAlg=false) |
| This method creates a map from the given palette that can be used by crossBlitMap(). More...
|
|
◆ PaletteLookup()
Graphics::PaletteLookup::PaletteLookup |
( |
const byte * |
palette, |
|
|
uint |
len |
|
) |
| |
Construct a new Palette Lookup object.
- Parameters
-
palette | the palette data, in interleaved RGB format |
len | the number of palette entries to be read |
◆ setPalette()
bool Graphics::PaletteLookup::setPalette |
( |
const byte * |
palette, |
|
|
uint |
len |
|
) |
| |
Pass palette to the look up. It also compares given palette with the current one and resets cache only when their contents is different.
- Parameters
-
palette | the palette data, in interleaved RGB format |
len | the number of palette entries to be read |
- Returns
- true if palette was changed and false if it was the same
◆ findBestColor()
byte Graphics::PaletteLookup::findBestColor |
( |
byte |
r, |
|
|
byte |
g, |
|
|
byte |
b, |
|
|
bool |
useNaiveAlg = false |
|
) |
| |
This method returns closest color from the palette and it uses cache for faster lookups.
- Parameters
-
useNaiveAlg | if true, use a simpler algorithm |
- Returns
- the palette index
◆ createMap()
uint32* Graphics::PaletteLookup::createMap |
( |
const byte * |
srcPalette, |
|
|
uint |
len, |
|
|
bool |
useNaiveAlg = false |
|
) |
| |
This method creates a map from the given palette that can be used by crossBlitMap().
- Parameters
-
palette | the palette data, in interleaved RGB format |
len | the number of palette entries to be read |
useNaiveAlg | if true, use a simpler algorithm |
- Returns
- the created map, or nullptr if one isn't needed.
The documentation for this class was generated from the following file: