|
Porytiles
|
Functions | |
| template<SupportsTransparency ColorType, typename TransparencyPredicate > | |
| PaletteMatchResult< ColorType > | match_tile_to_palette_impl (const PixelTile< ColorType > &tile, const Palette< ColorType > &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<typename T , typename ConfigInterface , typename FetchFunc , typename Comparator > | |
| ChainableResult< ConfigValue< T > > | compare_values (const ConfigValue< T > &val, const ConfigInterface &config, const std::string &scope_param, 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. | |
| ChainableResult< ConfigValue< T > > porytiles2::details::compare_values | ( | const ConfigValue< T > & | val, |
| const ConfigInterface & | config, | ||
| const std::string & | scope_param, | ||
| 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 |
| scope_param | The scope parameter (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 80 of file config_validators.hpp.
| ShapeTile< ColorIndex > porytiles2::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 33 of file tile_converters.hpp.
| PaletteMatchResult< ColorType > porytiles2::details::match_tile_to_palette_impl | ( | const PixelTile< ColorType > & | tile, |
| const Palette< ColorType > & | 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 |
| 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 79 of file palette_matchers.hpp.