37 std::vector<PixelTile<Rgba32>>
tiles_;
42 std::map<std::string, Animation<Rgba32>>
anims_;
172 gsl::not_null<const PackingStrategy *>
strategy,
173 gsl::not_null<const TextFormatter *> format,
174 gsl::not_null<const UserDiagnostics *> diag,
175 gsl::not_null<const TilePrinter *> tile_printer,
176 gsl::not_null<const PalettePrinter *> pal_printer)
177 : strategy_{
strategy}, format_{format}, diag_{diag}, tile_printer_{tile_printer}, pal_printer_{pal_printer}
A result type that maintains a chainable sequence of errors for debugging and error reporting.
A bidirectional mapping between pixel color values and sequential integer indices.
A container that wraps a configuration value with its name and source information.
Abstract interface for palette packing algorithms.
Domain service that packs ColorSets into hardware palettes.
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.
A collection of printer functions for the Palette and related types.
An 8x8 tile backed by literal-array-based per-pixel storage of an arbitrary pixel type.
Represents a 32-bit RGBA color.
Abstract base class for applying text styling with context-aware formatting.
A collection of printer functions for various tile types.
Abstract class for structured error reporting and diagnostic output.
constexpr std::size_t num_pals
A reconstructed RGBA tile from a compiled primary tileset, tagged with its first metatile slot locati...
std::size_t metatile_index
metatile::Subtile subtile
The input parameters for a packing operation.
std::vector< PaletteHint > hints_
Priority tiles that guide packing (e.g., ensure certain colors group together)
std::vector< PrimaryTileRef > primary_tiles_
Reconstructed RGBA tiles from a compiled primary tileset for cross-tileset shape group analysis.
ConfigValue< TileSharingPacking > tile_sharing_packing_
Controls whether the packer considers shape group membership during packing.
std::bitset< pal::num_pals > available_pals_
Bitset specifying which hardware palettes are available for packing.
std::vector< PixelTile< Rgba32 > > tiles_
Raw pixel tiles to pack into palettes.
Rgba32 extrinsic_transparency_
The extrinsic transparency color (e.g., rgba_magenta)
ConfigValue< TileSharingAlignment > tile_sharing_alignment_
Controls palette slot alignment strategy for tile sharing deduplication.
std::array< std::optional< Palette< Rgba32, pal::max_size > >, pal::num_pals > prefilled_pals_
Existing palettes with locked and wildcarded colors (from PorytilesTilesetComponent)
ColorIndexMap< Rgba32 > color_map_
Bidirectional mapping between Rgba32 colors and ColorIndex.
std::map< std::string, Animation< Rgba32 > > anims_
RGBA animations to pack into palettes.
Result from the high-level tile packing operation.
std::map< std::size_t, std::size_t > tile_to_pal_
Maps regular tile ids to their assigned hardware palette indices.
std::array< std::optional< Palette< Rgba32, pal::max_size > >, pal::num_pals > pals_
The final hardware palettes with colors assigned.