|
Porytiles
|
Domain service that packs ColorSets into hardware palettes. More...
#include <palette_packer.hpp>
Public Member Functions | |
| PalettePacker (gsl::not_null< const PackingStrategy * > strategy, gsl::not_null< const TextFormatter * > format, gsl::not_null< const UserDiagnostics * > diag, gsl::not_null< const TilePrinter * > tile_printer, gsl::not_null< const PalettePrinter * > pal_printer) | |
| Constructs a PalettePacker with the specified dependencies. | |
| void | strategy (gsl::not_null< const PackingStrategy * > strategy) |
| ChainableResult< PalettePacking > | pack_tiles (const PackingParams ¶ms) const |
| Packs pixel tiles into hardware palettes using a high-level API. | |
Domain service that packs ColorSets into hardware palettes.
PalettePacker solves the "Pagination Problem" (Bin Packing with Overlapping Items) - assigning tiles to palettes such that each tile's colors fit within a single palette's capacity, while minimizing the number of palettes used.
The packer delegates the actual algorithm to a PackingStrategy, allowing different algorithms (Best Fusion, Overload-and-Remove) to be used interchangeably.
Definition at line 160 of file palette_packer.hpp.
|
inlineexplicit |
Constructs a PalettePacker with the specified dependencies.
| strategy | The packing algorithm to use |
| format | TextFormatter for building diagnostic output |
| diag | UserDiagnostics for warnings and errors |
| tile_printer | TilePrinter for rendering tile ASCII art in diagnostics |
| pal_printer | PalettePrinter for rendering palette diagnostics |
Definition at line 171 of file palette_packer.hpp.
| ChainableResult< PalettePacking > porytiles::PalettePacker::pack_tiles | ( | const PackingParams & | params | ) | const |
Packs pixel tiles into hardware palettes using a high-level API.
This method provides a caller-friendly interface that accepts Rgba32 pixel tiles and palettes, handling all internal conversions to/from ColorSet and ColorIndex.
The method:
| params | The packing input parameters |
Definition at line 1236 of file palette_packer.cpp.
|
inline |
Definition at line 181 of file palette_packer.hpp.