33 std::vector<PixelTile<Rgba32>>
tiles_;
36 std::map<std::string, Animation<Rgba32>>
anims_;
139 gsl::not_null<const PackingStrategy *>
strategy,
140 gsl::not_null<const TextFormatter *> format,
141 gsl::not_null<const UserDiagnostics *> diag,
142 gsl::not_null<const TilePrinter *> tile_printer,
143 gsl::not_null<const PalettePrinter *> palette_printer)
144 : strategy_{
strategy}, format_{format}, diag_{diag}, tile_printer_{tile_printer},
145 palette_printer_{palette_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.
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.
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 * > palette_printer)
Constructs a PalettePacker with the specified dependencies.
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_palettes
A reconstructed RGBA tile from a compiled primary tileset, tagged with its first metatile slot locati...
std::size_t metatile_index
metatile::Subtile subtile
std::size_t palette_index
The input parameters for a packing operation.
std::vector< PaletteHint > hints_
Priority tiles that guide packing (e.g., ensure certain colors group together)
std::array< std::optional< Palette< Rgba32, palette::max_size > >, palette::num_palettes > prefilled_palettes_
Existing palettes with locked and wildcarded colors (from PorytilesTilesetComponent)
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< palette::num_palettes > available_palettes_
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.
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::array< std::optional< Palette< Rgba32, palette::max_size > >, palette::num_palettes > palettes_
The final hardware palettes with colors assigned.
std::map< std::size_t, std::size_t > tile_to_palette_
Maps regular tile ids to their assigned hardware palette indices.