An accessor for the colormap, with up to 16 colors. More...
#include <sifteo/video/color.h>
Public Member Functions | |
CubeID | cube () const |
Return the CubeID associated with this drawable. | |
void | erase () |
Clear the palette to black. | |
void | fill (RGB565 color) |
Splat the given color across all colormap slots. | |
ColormapSlot | operator[] (unsigned index) |
Return a ColormapSlot which references a single colormap entry on a single VideoBuffer. More... | |
void | set (const RGB565 *colors) |
Set the entire palette, given an array of exactly 16 RGB565 values. | |
void | setEGA () |
Set the entire palette to the traditional EGA 16-color palette. More... | |
void | setMono (RGB565 color0, RGB565 color1) |
Set a monochrome palette, in entries [0] and [1]. More... | |
void | setMono (uint32_t color0, uint32_t color1) |
Set a monochrome palette, in entries [0] and [1]. More... | |
void | setRange (const RGB565 *colors, unsigned firstColor, unsigned numColors) |
Set a range of colormap values, given an array of RGB565 values. | |
_SYSVideoBuffer & | videoBuffer () |
Return the VideoBuffer associated with this drawable. | |
Static Public Attributes | |
static const unsigned | NUM_COLORS = 16 |
Maximum number of colors in the colormap. | |
An accessor for the colormap, with up to 16 colors.
This colormap is used by the SOLID_MODE, FB32, FB64, and FB128 modes.
Colors are stored in 16-bit RGB565 format.
Note that, due to details of the radio compression protocol, even-numbered colormap indices will compress better in the FB32 mode. This means it can give better performance if you allocate the most common color values to even-numbered slots.
|
inline |
Return a ColormapSlot which references a single colormap entry on a single VideoBuffer.
You don't need to store this reference typically; for example:
vbuf.colormap[16].set(1.f, 0.f, 0.f);
|
inline |
Set the entire palette to the traditional EGA 16-color palette.
http://en.wikipedia.org/wiki/Enhanced_Graphics_Adapter#Color_palette
Set a monochrome palette, in entries [0] and [1].
This is common in the two-color modes, FB64 and FB128.
|
inline |
Set a monochrome palette, in entries [0] and [1].
This is common in the two-color modes, FB64 and FB128.
Colors are specified as packed RGB values, in the format 0xRRGGBB.
Sifteo SDK v1.1.0 (see all versions)
Last updated Tue Dec 23 2014, by Doxygen