|
roo_display
API Documentation for roo_display
|
Palette storage for IndexedN color modes.
More...
#include <color_mode_indexed.h>
Public Member Functions | |
| Palette () | |
| Create a dummy palette with a single transparent color. | |
| const Color * | colors () const |
| Return pointer to the color table. | |
| int | size () const |
| Return palette size. | |
| Color | getColorAt (int idx) const |
Return the idx-th color. | |
| TransparencyMode | transparency_mode () const |
| Return palette transparency mode. | |
| uint8_t | getIndexOfColor (Color color) |
| Return the index of a specified color. | |
Static Public Member Functions | |
| static Palette | ReadOnly (const Color *colors, int size) |
| Create a read-only palette backed by the given colors. | |
| static Palette | ReadOnly (const Color *colors, int size, TransparencyMode transparency_mode) |
| Read-only palette with explicit transparency mode. | |
| static Palette | ReadWrite (const Color *colors, int size) |
| Create a read/write palette backed by the given colors. | |
| static Palette | ReadWrite (const Color *colors, int size, TransparencyMode transparency_mode) |
| Read/write palette with explicit transparency mode. | |
| static Palette | Dynamic (int max_size) |
| Create a dynamic palette for drawing to offscreens. | |
Palette storage for IndexedN color modes.
Definition at line 75 of file color_mode_indexed.h.
| roo_display::Palette::Palette | ( | ) |
Create a dummy palette with a single transparent color.
Definition at line 26 of file color_mode_indexed.cpp.
Referenced by Dynamic(), ReadOnly(), ReadOnly(), and ReadWrite().
Return pointer to the color table.
Definition at line 129 of file color_mode_indexed.h.
Referenced by ReadOnly(), ReadOnly(), ReadWrite(), and ReadWrite().
Create a dynamic palette for drawing to offscreens.
Colors are added up to max_size. After that, missing colors map to index 0.
| max_size | Maximum number of colors to store. |
Definition at line 51 of file color_mode_indexed.cpp.
References roo_display::kNone, Palette(), palette, and size().
Return the idx-th color.
Definition at line 135 of file color_mode_indexed.h.
Return the index of a specified color.
Not valid for read-only palettes. For dynamic palettes, missing colors are added up to max_size; otherwise returns 0 when not found.
Definition at line 62 of file color_mode_indexed.cpp.
References color, roo_display::kCrude, roo_display::kFull, and roo_display::kNone.
Create a read-only palette backed by the given colors.
The color array is not copied and must remain valid. Read-only palettes cannot be used for inverse lookup (ARGB -> index); use ReadWrite() or Dynamic() for that. Transparency is auto-detected.
| colors | Palette colors (array must outlive the palette). |
| size | Number of colors in the palette. |
Definition at line 29 of file color_mode_indexed.cpp.
|
static |
Read-only palette with explicit transparency mode.
| colors | Palette colors (array must outlive the palette). |
| size | Number of colors in the palette. |
| transparency_mode | Explicit transparency mode to use. |
Definition at line 34 of file color_mode_indexed.cpp.
References colors(), Palette(), size(), and transparency_mode().
Create a read/write palette backed by the given colors.
Enables inverse lookup (ARGB -> index), e.g. for Offscreen. The array is not copied and must remain valid. Transparency is auto-detected.
| colors | Palette colors (array must outlive the palette). |
| size | Number of colors in the palette. |
Definition at line 39 of file color_mode_indexed.cpp.
References colors(), ReadWrite(), and size().
Referenced by ReadWrite().
|
static |
Read/write palette with explicit transparency mode.
| colors | Palette colors (array must outlive the palette). |
| size | Number of colors in the palette. |
| transparency_mode | Explicit transparency mode to use. |
Definition at line 44 of file color_mode_indexed.cpp.
References colors(), Palette(), size(), and transparency_mode().
|
inline |
Return palette size.
Definition at line 132 of file color_mode_indexed.h.
Referenced by Dynamic(), ReadOnly(), ReadOnly(), ReadWrite(), and ReadWrite().
|
inline |
Return palette transparency mode.
Definition at line 138 of file color_mode_indexed.h.
Referenced by ReadOnly(), and ReadWrite().