|
Porytiles
|
Functions | |
| template<SupportsTransparency ColorType, typename TransparencyPredicate , std::size_t N = 0> | |
| PaletteMatchResult< ColorType > | match_tile_to_palette_impl (const PixelTile< ColorType > &tile, const Palette< ColorType, N > &palette, TransparencyPredicate is_transparent_pred) |
| Helper function implementing the core palette matching logic. | |
| template<SupportsTransparency PixelType, typename TransparencyPredicate > | |
| ShapeTile< ColorIndex > | from_pixel_tile_impl (const PixelTile< PixelType > &pixel_tile, const ColorIndexMap< PixelType > &color_index_map, TransparencyPredicate is_transparent_pred) |
| Helper function implementing the core PixelTile to ShapeTile conversion logic. | |
| template<SupportsTransparency ColorType, std::size_t N = 0, typename TransparencyPredicate > | |
| PixelTile< IndexPixel > | index_tile_from_color_tile_impl (const PixelTile< ColorType > &tile, const Palette< ColorType, N > &palette, TransparencyPredicate is_transparent_pred) |
| Helper function implementing the core color-to-index tile conversion logic. | |
| template<SupportsTransparency ColorType, std::size_t N = 0> | |
| PixelTile< ColorType > | color_tile_from_index_tile_impl (const PixelTile< IndexPixel > &index_tile, const Palette< ColorType, N > &palette, const ColorType &transparent_color) |
| Helper function implementing the core index-to-color tile conversion logic. | |
| void | report_validation_error_in_metatile (const TilesetCompileValidatorServices &services, const Metatile< Rgba32 > &metatile, std::size_t metatile_index, std::size_t internal_tile_index, std::size_t row, std::size_t col, const std::string &diagnostic_code, const std::string &error_message, const Rgba32 &extrinsic_transparency) |
| Reports a validation error at a specific pixel location within a metatile. | |
| void | report_validation_error_in_anim (const TilesetCompileValidatorServices &services, const PixelTile< Rgba32 > &tile, const std::string &anim_name, const std::string &frame_name, std::size_t internal_tile_index, std::size_t row, std::size_t col, const std::string &diagnostic_code, const std::string &error_message, const Rgba32 &extrinsic_transparency) |
| Reports a validation error at a specific pixel location within an animation frame tile. | |
| void | report_validation_error_in_anim_tile (const TilesetCompileValidatorServices &services, const PixelTile< Rgba32 > &tile, const std::string &anim_name, const std::string &frame_name, std::size_t internal_tile_index, const std::string &diagnostic_code, const std::string &error_message, const Rgba32 &extrinsic_transparency) |
| Reports a validation error for an entire animation frame tile. | |
| void | report_color_counts (const std::string &tag, const TilesetCompileValidatorServices &services, const std::map< Rgba32, unsigned int > &color_counts) |
| Emits a diagnostic note displaying the count of each unique color. | |
| template<typename T , typename ConfigInterface , typename FetchFunc , typename Comparator > | |
| ChainableResult< ConfigValue< T > > | compare_values (const ConfigValue< T > &val, const ConfigInterface &config, ConfigScopeType type, const std::string &scope, const std::string &other_field_name, FetchFunc fetch_other, Comparator comp, std::string_view error_message) |
| Generic comparison validator that compares the current value against another config value. | |
| PixelTile< ColorType > porytiles::details::color_tile_from_index_tile_impl | ( | const PixelTile< IndexPixel > & | index_tile, |
| const Palette< ColorType, N > & | palette, | ||
| const ColorType & | transparent_color | ||
| ) |
Helper function implementing the core index-to-color tile conversion logic.
This private helper converts a PixelTile<IndexPixel> to a PixelTile<ColorType> by mapping each pixel's index to its corresponding color in the provided palette. It accepts a transparent_color parameter that determines what color to use for index 0 pixels, allowing the same implementation to work with both intrinsic and extrinsic transparency.
The algorithm:
| ColorType | The color type of the palette and output tile |
| index_tile | The PixelTile containing IndexPixel values to convert |
| palette | The Palette containing the colors to look up |
| transparent_color | The color to use for index 0 (transparent) pixels |
Definition at line 168 of file tile_converters.hpp.
| ChainableResult< ConfigValue< T > > porytiles::details::compare_values | ( | const ConfigValue< T > & | val, |
| const ConfigInterface & | config, | ||
| ConfigScopeType | type, | ||
| const std::string & | scope, | ||
| const std::string & | other_field_name, | ||
| FetchFunc | fetch_other, | ||
| Comparator | comp, | ||
| std::string_view | error_message | ||
| ) |
Generic comparison validator that compares the current value against another config value.
This is the generic implementation for all cross-field comparison validators. It fetches another config value using the provided lambda and performs a comparison using the provided comparator. If the comparison fails, returns a detailed error message showing both values and their sources. This function is used internally by the public comparison validator functions.
| T | The type of the config values being compared (must support the comparator's operation) |
| ConfigInterface | The config interface type (DomainConfig, AppConfig, or InfraConfig) |
| FetchFunc | Callable type that fetches the other config value |
| Comparator | Callable type that performs the comparison (e.g., std::greater<>, std::less<>) |
| val | The config value being validated |
| config | The config interface to fetch other values from |
| type | The config scope type (tileset or layout) |
| scope | The scope name (tileset or layout name) |
| other_field_name | The name of the other field to compare against |
| fetch_other | Callable that fetches the other config value |
| comp | Comparator that performs the comparison operation |
| error_message | The error message to display if validation fails (e.g., "must be greater than") |
Definition at line 176 of file xcut_config_validators.hpp.
| ShapeTile< ColorIndex > porytiles::details::from_pixel_tile_impl | ( | const PixelTile< PixelType > & | pixel_tile, |
| const ColorIndexMap< PixelType > & | color_index_map, | ||
| TransparencyPredicate | is_transparent_pred | ||
| ) |
Helper function implementing the core PixelTile to ShapeTile conversion logic.
This private helper contains the common conversion logic shared by both from_pixel_tile() overloads. It accepts a transparency predicate (function/lambda) that determines whether a pixel is transparent, allowing the same implementation to work with both intrinsic and extrinsic transparency checking.
| PixelType | The pixel type of the input tile |
| TransparencyPredicate | A callable type that takes a PixelType and returns bool |
| pixel_tile | The PixelTile to convert |
| color_index_map | The ColorIndexMap providing color-to-index mappings |
| is_transparent_pred | A predicate function that returns true if a pixel is transparent |
Definition at line 35 of file tile_converters.hpp.
| PixelTile< IndexPixel > porytiles::details::index_tile_from_color_tile_impl | ( | const PixelTile< ColorType > & | tile, |
| const Palette< ColorType, N > & | palette, | ||
| TransparencyPredicate | is_transparent_pred | ||
| ) |
Helper function implementing the core color-to-index tile conversion logic.
This private helper converts a PixelTile<ColorType> to a PixelTile<IndexPixel> by mapping each pixel's color to its corresponding index in the provided palette. It accepts a transparency predicate that determines whether a pixel is transparent, allowing the same implementation to work with both intrinsic and extrinsic transparency checking.
The algorithm:
| ColorType | The color type of the palette and tile |
| TransparencyPredicate | A callable type that takes a ColorType and returns bool |
| tile | The PixelTile to convert to indexed form |
| palette | The Palette containing the color-to-index mapping |
| is_transparent_pred | A predicate function that returns true if a color is transparent |
Definition at line 105 of file tile_converters.hpp.
| PaletteMatchResult< ColorType > porytiles::details::match_tile_to_palette_impl | ( | const PixelTile< ColorType > & | tile, |
| const Palette< ColorType, N > & | palette, | ||
| TransparencyPredicate | is_transparent_pred | ||
| ) |
Helper function implementing the core palette matching logic.
This private helper contains the common matching logic shared by both match_tile_to_palette() overloads. It accepts a transparency predicate (function/lambda) that determines whether a pixel is transparent, allowing the same implementation to work with both intrinsic and extrinsic transparency checking.
The algorithm:
| ColorType | The color type of the palette and tile |
| TransparencyPredicate | A callable type that takes a ColorType and returns bool |
| N | The palette size (0 for dynamic, non-zero for fixed-size) |
| tile | The PixelTile to match against the palette |
| palette | The Palette to check for color coverage |
| is_transparent_pred | A predicate function that returns true if a color is transparent |
Definition at line 81 of file palette_matchers.hpp.
|
inline |
Emits a diagnostic note displaying the count of each unique color.
Formats and prints a color count summary as a note diagnostic. This is typically used as a follow-up to a color count violation error to help users understand which colors are present in the problematic tile or metatile.
| tag | Diagnostic code to associate with this note. |
| services | Common services for formatting and diagnostic output. |
| color_counts | Map of colors to their occurrence counts. |
Definition at line 183 of file tileset_compile_validators.hpp.
|
inline |
Reports a validation error at a specific pixel location within an animation frame tile.
Emits a formatted error diagnostic that includes the animation name, frame name, tile index, and the specific pixel coordinates where the error occurred. The diagnostic includes a visual highlight of the problematic pixel within the tile context.
| services | Common services for formatting and diagnostic output. |
| tile | The pixel tile containing the validation error. |
| anim_name | Name of the animation containing the error. |
| frame_name | Name of the frame within the animation. |
| internal_tile_index | Index of the tile within the frame's tile array. |
| row | Row position of the pixel within the tile (0-7). |
| col | Column position of the pixel within the tile (0-7). |
| diagnostic_code | Unique identifier for this type of diagnostic. |
| error_message | Human-readable description of the validation error. |
| extrinsic_transparency | The transparency color used for rendering the highlight. |
Definition at line 112 of file tileset_compile_validators.hpp.
|
inline |
Reports a validation error for an entire animation frame tile.
Emits a formatted error diagnostic that includes the animation name, frame name, and tile index. Unlike report_validation_error_in_anim which highlights a specific pixel, this function displays the entire tile visual. Use this for tile-level errors like transparency violations or color count violations.
| services | Common services for formatting and diagnostic output. |
| tile | The pixel tile containing the validation error. |
| anim_name | Name of the animation containing the error. |
| frame_name | Name of the frame within the animation. |
| internal_tile_index | Index of the tile within the frame's tile array. |
| diagnostic_code | Unique identifier for this type of diagnostic. |
| error_message | Human-readable description of the validation error. |
| extrinsic_transparency | The transparency color used for rendering. |
Definition at line 152 of file tileset_compile_validators.hpp.
|
inline |
Reports a validation error at a specific pixel location within a metatile.
Emits a formatted error diagnostic that includes the metatile location, layer, subtile position, and the specific pixel coordinates where the error occurred. The diagnostic includes a visual highlight of the problematic pixel within the metatile context.
| services | Common services for formatting and diagnostic output. |
| metatile | The metatile containing the validation error. |
| metatile_index | Zero-based index of the metatile in the input sequence. |
| internal_tile_index | Index of the tile within the decomposed metatile (0-11 for triple layer). |
| row | Row position of the pixel within the tile (0-7). |
| col | Column position of the pixel within the tile (0-7). |
| diagnostic_code | Unique identifier for this type of diagnostic. |
| error_message | Human-readable description of the validation error. |
| extrinsic_transparency | The transparency color used for rendering the highlight. |
Definition at line 70 of file tileset_compile_validators.hpp.