|
Porytiles
|
Pre-assigned palette with wildcard support for palette packing. More...
#include <prefilled_palette.hpp>
Public Member Functions | |
| bool | operator== (const PrefilledPalette &other) const |
| std::strong_ordering | operator<=> (const PrefilledPalette &other) const |
| std::size_t | hardware_index () const |
| const ColorSet & | fixed_colors () const |
| std::size_t | fixed_color_count () const |
| std::size_t | occupied_slots () const |
| std::size_t | available_capacity () const |
| bool | is_fully_locked () const |
| bool | can_accommodate (const ColorSet &tile_colors) const |
| Checks if a tile's colors can be accommodated by this palette. | |
Static Public Member Functions | |
| static PrefilledPalette | fully_locked (std::size_t hardware_index, ColorSet color_set, std::size_t occupied_slots) |
| Creates a fully locked PrefilledPalette. | |
| static PrefilledPalette | partially_locked (std::size_t hardware_index, ColorSet fixed_colors, std::size_t occupied_slots, std::size_t total_capacity=pal::max_size - 1) |
| Creates a partially locked palette with available capacity. | |
Pre-assigned palette with wildcard support for palette packing.
PrefilledPalette represents a hardware palette that has some or all of its slots pre-assigned. This is used for:
Use the static factory methods to construct instances.
Definition at line 25 of file prefilled_palette.hpp.
|
inline |
Definition at line 91 of file prefilled_palette.hpp.
| bool porytiles::PrefilledPalette::can_accommodate | ( | const ColorSet & | tile_colors | ) | const |
Checks if a tile's colors can be accommodated by this palette.
A tile can be accommodated if:
| tile_colors | The tile's colors to check |
Definition at line 35 of file prefilled_palette.cpp.
| std::size_t porytiles::PrefilledPalette::fixed_color_count | ( | ) | const |
Definition at line 30 of file prefilled_palette.cpp.
|
inline |
Definition at line 79 of file prefilled_palette.hpp.
|
static |
Creates a fully locked PrefilledPalette.
A fully locked palette has all its color slots occupied. The packer cannot add any new colors to this palette. Tiles can only use this palette if their colors are already a subset of the fixed colors.
| hardware_index | The hardware palette index |
| color_set | The fixed colors occupying all slots |
| occupied_slots | The number of physical slots occupied in the palette (may differ from unique color count if palette contains duplicate colors) |
Definition at line 15 of file prefilled_palette.cpp.
|
inline |
Definition at line 74 of file prefilled_palette.hpp.
|
inline |
Definition at line 96 of file prefilled_palette.hpp.
|
inline |
Definition at line 86 of file prefilled_palette.hpp.
|
inline |
Definition at line 69 of file prefilled_palette.hpp.
|
inline |
Definition at line 64 of file prefilled_palette.hpp.
|
static |
Creates a partially locked palette with available capacity.
A partially locked palette has some colors fixed but still has room for the packer to add more colors. The available capacity is computed as total_capacity - occupied_slots.
| hardware_index | The hardware palette index |
| fixed_colors | The colors that are already locked in this palette |
| occupied_slots | The number of physical slots occupied in the palette (may differ from unique color count if palette contains duplicate colors) |
| total_capacity | The total number of color slots (default pal::max_size - 1) |
Definition at line 20 of file prefilled_palette.cpp.