Porytiles
Loading...
Searching...
No Matches
porytiles::ShapeGroup< PixelType > Struct Template Reference

A group of tiles that share the same canonical shape but have different color assignments. More...

#include <shape_group.hpp>

Collaboration diagram for porytiles::ShapeGroup< PixelType >:
[legend]

Public Attributes

ShapeTile< PixelType > canonical_shape
 
std::vector< ShapeGroupMember< PixelType > > members
 

Detailed Description

template<typename PixelType>
struct porytiles::ShapeGroup< PixelType >

A group of tiles that share the same canonical shape but have different color assignments.

ShapeGroup captures the core insight for tile sharing: tiles with identical geometry (same ShapeMask layout after canonicalization) but different color fills are candidates for palette sharing. If two such tiles land in different palettes, aligning the palette slot indices for corresponding colors allows a single indexed tile to render with either palette.

A ShapeGroup with only one member has no sharing opportunity. A group with 2+ members whose colors differ across members are sharing candidates, provided they end up in different palettes after packing.

Template Parameters
PixelTypeThe pixel type stored for each shape region (e.g., Rgba32)

Definition at line 48 of file shape_group.hpp.

Member Data Documentation

◆ canonical_shape

template<typename PixelType >
ShapeTile<PixelType> porytiles::ShapeGroup< PixelType >::canonical_shape

Definition at line 49 of file shape_group.hpp.

◆ members

template<typename PixelType >
std::vector<ShapeGroupMember<PixelType> > porytiles::ShapeGroup< PixelType >::members

Definition at line 51 of file shape_group.hpp.


The documentation for this struct was generated from the following file: