|
Porytiles
|
Namespaces | |
| namespace | attr |
| namespace | detail |
| namespace | details |
| namespace | di |
| namespace | metatile |
| namespace | pal |
| namespace | tile |
| namespace | tileset |
Classes | |
| class | AnsiStyledTextFormatter |
| TextFormatter implementation that applies ANSI escape codes for terminal styling. More... | |
| class | AppConfig |
| Interface that defines a complete app layer configuration. More... | |
| class | ArtifactChecksumProvider |
| Abstract service for managing artifact checksums. More... | |
| class | ArtifactKey |
| A type-safe wrapper for artifact keys. More... | |
| class | AsciiTilePrinter |
| A TilePrinter implementation that generates ASCII art tiles with formatting based on the provided TextFormatter. More... | |
| class | AssetGenerator |
| class | Bin |
| class | BufferedUserDiagnostics |
| Testing implementation of UserDiagnostics that buffers all diagnostic output. More... | |
| class | CanonicalPixelTile |
| A PixelTile representation that stores the canonical (lexicographically minimal) orientation among all flipped variants. More... | |
| class | CanonicalShapeTile |
| A ShapeTile representation that stores the canonical (lexicographically minimal) orientation among all flipped variants. More... | |
| class | ChainableResult |
| A result type that maintains a chainable sequence of errors for debugging and error reporting. More... | |
| class | ChainableResult< void, E > |
| Template specialization of ChainableResult for void success type. More... | |
| class | ColorIndex |
| Represents a color index value for palette operations. More... | |
| class | ColorIndexMap |
| A bidirectional mapping between pixel color values and sequential integer indices. More... | |
| class | ColorSet |
| A set of colors represented as a bitset. More... | |
| class | ColorSetBuilder |
| Service that builds a ColorSet from a NormalizedPal using a pre-defined color index map. More... | |
| class | CompilePrimaryTileset |
| Use case for compiling a primary Tileset. More... | |
| class | ConfigProvider |
| An interface which config implementations can use to load config values. More... | |
| class | ConfigValue |
| A container that wraps a configuration value with its name and source information. More... | |
| class | CreatePrimaryTileset |
| Use case for creating a primary Tileset. More... | |
| class | DefaultProvider |
| A default implementation of ConfigProvider that provides sensible default values. More... | |
| class | DomainConfig |
| Interface that defines a complete domain layer configuration. More... | |
| class | Error |
| Abstract interface for all error types used in ChainableResult error chains. More... | |
| class | FilePalLoader |
| A service interface that loads a Palette from a given file. More... | |
| class | FilePalSaver |
| A service interface that saves a Palette to a given file. More... | |
| class | FormatParam |
| A text parameter with associated styling for formatted output. More... | |
| class | FormattableError |
| General-purpose error implementation with formatted message support. More... | |
| class | Image |
| A template for two-dimensional images with arbitrarily typed pixel values. More... | |
| class | ImageLoadError |
| class | ImageTileizer |
| Service for converting images into collections of 8x8 tiles. More... | |
| class | ImportPrimaryTileset |
| Use case for importing a primary Tileset. More... | |
| class | IndexPixel |
| Represents an indexed color pixel. More... | |
| class | InfraConfig |
| Interface that defines a complete infra layer configuration. More... | |
| class | JascPalLoader |
| An implementation of FilePalLoader that loads palettes from JASC-PAL (Paintshop Pro) pal files. More... | |
| class | JascPalSaver |
| An implementation of FilePalSaver that saves palettes to JASC-PAL (Paintshop Pro) pal files. More... | |
| class | LayerImageMetatileizer |
| Service for converting layer images into collections of metatiles. More... | |
| class | LayerModeConverter |
| struct | LayerValue |
| A small container that holds an optional-wrapped value, validation state, and metadata about the value source. More... | |
| class | LazyLayeredConfig |
| A Config implementation that lazily pulls a config value by consulting multiple priority-ordered backing ConfigProviders . More... | |
| class | Metatile |
| The core tileset entity - a 2x2 grid of PixelTile objects arranged into three layers. More... | |
| class | MetatileAttribute |
| class | MetatileDecompiler |
| class | NoopArtifactChecksumProvider |
| An implementation of ArtifactChecksumProvider that just does nothing. More... | |
| class | OperandBundle |
| A type-erased container for orchestration operands with runtime type checking. More... | |
| class | OperandDeclaration |
| A specification for operands required or produced by orchestration operations. More... | |
| class | Operation |
| Abstract base class for operations in a processing pipeline. More... | |
| class | PackBin |
| class | PackSet |
| class | PackSetGenerator |
| class | Palette |
| A palette container for colors that support transparency checking. More... | |
| struct | PaletteMatchResult |
| Result type for palette matching operations. More... | |
| class | PalettePrinter |
| A collection of printer functions for the Palette type. More... | |
| class | Pipeline |
| Manages and executes a collection of operations in dependency order. More... | |
| class | PixelTile |
| An 8x8 tile backed by literal-array-based per-pixel storage of an arbitrary pixel type. More... | |
| class | PlainTextFormatter |
| TextFormatter implementation that strips all styling from text. More... | |
| class | PngIndexedImageLoader |
| An image loader that reads PNG files to create an Image with an index pixel type. More... | |
| class | PngIndexedImageSaver |
| An image saver that saves PNG files from an Image with an index pixel type. More... | |
| class | PngRgbaImageLoader |
| An image loader that reads PNG files to create an Image with an Rgba32 pixel type. More... | |
| class | PngRgbaImageSaver |
| An image saver that saves PNG files from an Image with an Rgba32 pixel type. More... | |
| class | PorymapLayoutComponent |
| class | PorymapTilesetComponent |
| class | PorytilesLayoutComponent |
| class | PorytilesTilesetComponent |
| class | PrimaryTilesetCompiler |
| Service that compiles a primary Tileset. More... | |
| class | ProjectArtifactChecksumProvider |
| TODO: fill in doxygen. More... | |
| class | ProjectTilesetArtifactKeyProvider |
| Provides a pokeemerald project filesystem-based implementation for TilesetArtifactKeyProvider. More... | |
| class | ProjectTilesetArtifactReader |
| Provides a filesystem-based implementation for TilesetArtifactReader. More... | |
| class | ProjectTilesetArtifactWriter |
| Provides a filesystem-based implementation for TilesetArtifactWriter. More... | |
| class | Rgba32 |
| Represents a 32-bit RGBA color. More... | |
| class | ShapeMask |
| Represents which pixels in an 8x8 tile are non-transparent. More... | |
| class | ShapeTile |
| An 8x8 tile backed by mask-based storage that maps shape regions to pixel values. More... | |
| class | StderrStyledUserDiagnostics |
| Concrete implementation of UserDiagnostics that outputs structured messages to stderr, optionally with colored formatting. More... | |
| class | StreamDigest |
| Computes the MD5 digest of an input stream. More... | |
| struct | StringViewSourceLoc |
| A wrapper for std::string_view with a taggable std::source_location. More... | |
| class | TextFormatter |
| Abstract base class for applying text styling with context-aware formatting. More... | |
| class | TilemapEntry |
| Represents a tilemap entry referencing a tile with palette and flip attributes. More... | |
| class | TilePrinter |
| A collection of printer functions for various tile types. More... | |
| class | Tileset |
| A complete tileset containing both Porytiles and Porymap components. More... | |
| class | TilesetArtifact |
| Represents a Pokémon Generation III decomp tileset artifact with type and optional metadata. More... | |
| class | TilesetArtifactKeyProvider |
| Abstract interface for generating keys and discovering tileset artifacts in a backing store. More... | |
| class | TilesetArtifactReader |
| Abstract interface for reading tileset artifacts from a backing store into a Tileset object. More... | |
| class | TilesetArtifactWriter |
| Abstract interface for writing tileset artifacts from a Tileset object to a backing store. More... | |
| class | TilesetRepo |
| Repository interface for the Tileset aggregate root. More... | |
| class | TilesPngWorkspace |
| A workspace for managing canonical IndexPixel tiles destined for tiles.png output. More... | |
| class | TileValidator |
| A collection of tile validation functions for compilation operations. More... | |
| class | UserDiagnostics |
| Abstract interface for structured error reporting and diagnostic output. More... | |
| class | VerifyPrimaryTileset |
| Use case for verifying a primary tileset. More... | |
| class | YamlFileProvider |
| A ConfigProvider implementation that reads configuration values from multiple YAML files with priority. More... | |
Concepts | |
| concept | SupportsTransparency |
| Concept that requires a type to support transparency checks. | |
Typedefs | |
| template<typename T , typename E = std::string> | |
| using | Result = std::expected< T, E > |
A result with some type T on success, otherwise an error of type E. | |
| using | FormattedMessageBuilder = std::function< std::vector< std::string >(const TextFormatter &)> |
| Function type for building formatted messages with TextFormatter access. | |
Enumerations | |
| enum class | IncrementalBuildMode { off , keep_unused , remove_unused } |
| enum class | ValidationState { not_provided , valid , invalid } |
| Represents the validation state of a configuration value from a ConfigProvider. More... | |
| enum class | TilesPalMode { true_color , greyscale } |
| enum class | Style : std::uint32_t { none = 0 , bold = 1 << 0 , italic = 1 << 1 , red = 1 << 2 , green = 1 << 3 , blue = 1 << 4 , yellow = 1 << 5 , cyan = 1 << 6 , magenta = 1 << 7 } |
| Bitmask flags for text styling options. More... | |
Functions | |
| std::string | to_string (const IncrementalBuildMode &value) |
| template<SupportsTransparency ColorType> requires requires(const ColorType &c) { c.is_transparent(); } | |
| PaletteMatchResult< ColorType > | match_tile_to_palette (const PixelTile< ColorType > &tile, const Palette< ColorType > &palette) |
| Matches a PixelTile against a Palette (intrinsic transparency only). | |
| template<SupportsTransparency ColorType> requires requires(const ColorType &c) { c.is_transparent(c); } | |
| PaletteMatchResult< ColorType > | match_tile_to_palette (const PixelTile< ColorType > &tile, const Palette< ColorType > &palette, const ColorType &extrinsic) |
| Matches a PixelTile against a Palette (extrinsic transparency). | |
| template<SupportsTransparency ColorType> requires requires(const ColorType &c) { c.is_transparent(c); } | |
| std::vector< PaletteMatchResult< ColorType > > | match_or_best (const PixelTile< ColorType > &tile, const std::vector< Palette< ColorType > > &palettes, const ColorType &extrinsic, std::size_t top_n) |
| Finds the best palette match(es) for a tile (extrinsic transparency). | |
| template<SupportsTransparency PixelType> requires requires(const PixelType &p) { p.is_transparent(); } | |
| ShapeTile< ColorIndex > | from_pixel_tile (const PixelTile< PixelType > &pixel_tile, const ColorIndexMap< PixelType > &color_index_map) |
| Converts a PixelTile to a ShapeTile<ColorIndex> using a ColorIndexMap (intrinsic transparency). | |
| template<SupportsTransparency PixelType> requires requires(const PixelType &p) { p.is_transparent(p); } | |
| ShapeTile< ColorIndex > | from_pixel_tile (const PixelTile< PixelType > &pixel_tile, const ColorIndexMap< PixelType > &color_index_map, const PixelType &extrinsic) |
| Converts a PixelTile to a ShapeTile<ColorIndex> using a ColorIndexMap (extrinsic transparency). | |
| template<SupportsTransparency PixelType> | |
| PixelTile< PixelType > | from_shape_tile (const ShapeTile< ColorIndex > &shape_tile, const ColorIndexMap< PixelType > &color_index_map) |
| Converts a ShapeTile<ColorIndex> to a PixelTile using a ColorIndexMap. | |
| template<SupportsTransparency PixelType> | |
| ShapeTile< PixelType > | shape_tile_to_pixel_colors (const ShapeTile< ColorIndex > &shape_tile, const ColorIndexMap< PixelType > &color_index_map) |
| Converts a ShapeTile<ColorIndex> to a ShapeTile<PixelType> using a ColorIndexMap. | |
| std::ostream & | operator<< (std::ostream &os, const Rgba32 &rgba) |
| Stream insertion operator for Rgba32. | |
| auto | format_as (const Rgba32 &rgba) |
| Provides a simple way for fmtlib to format an Rgba32. | |
| std::string | to_string (const Rgba32 &rgba) |
| std::optional< TilesPalMode > | tiles_pal_mode_from_str (const std::string &str) |
| std::string | to_string (const TilesPalMode m) |
| std::ostream & | operator<< (std::ostream &os, const TilesPalMode m) |
| template<typename T > | |
| std::expected< T, std::string > | parse_int (std::string_view int_string, const int base) |
| template<typename T > | |
| std::expected< T, std::string > | parse_int (std::string_view int_string) |
| constexpr uint8_t | reverse_bits (uint8_t b) |
| Reverses the bits in a byte. | |
| std::string | extract_function_name (const std::source_location &location=std::source_location::current()) |
| Extracts the function name from a source location. | |
| bool | check_full_string_match (const std::string &str, const std::string &pattern) |
| Checks if a string fully matches a regular expression pattern. | |
| void | trim (std::string &string) |
| Removes leading and trailing whitespace from a string in-place. | |
| std::vector< std::string > | split (std::string input, const std::string &delimiter) |
| Splits a string into tokens based on a delimiter. | |
| std::string & | trim_line_ending (std::string &line) |
| Removes line ending characters from a string in-place. | |
| std::string | trim_line_ending (const std::string &line) |
| Removes line ending characters from a string. | |
| constexpr Style | operator| (Style lhs, Style rhs) |
| Combines two Style flags using bitwise OR. | |
| constexpr Style | operator& (Style lhs, Style rhs) |
| Masks Style flags using bitwise AND. | |
| constexpr Style & | operator|= (Style &lhs, Style rhs) |
| Adds Style flags to an existing Style value using bitwise OR. | |
| constexpr Style & | operator&= (Style &lhs, Style rhs) |
| Masks an existing Style value using bitwise AND. | |
| constexpr bool | has_style (Style styles, Style flag) |
| Checks if a specific style flag is set in a Style value. | |
| template<typename T , typename F > | |
| auto | transform (const std::vector< T > &input, F &&func) -> std::vector< std::invoke_result_t< F, const T & > > |
| Transforms a vector of type T into a vector of type U using a mapping function. | |
| template<typename U , typename T > requires std::constructible_from<U, T> | |
| auto | transform (const std::vector< T > &input) -> std::vector< U > |
| Transforms a vector of type T into a vector of type U using direct type construction. | |
| ChainableResult< ConfigValue< std::size_t > > | size_t_val_greater_than_zero (const ConfigValue< std::size_t > &val) |
| Validates that a size_t config value is greater than zero. | |
| template<typename T , typename ConfigInterface , typename FetchFunc > | |
| ChainableResult< ConfigValue< T > > | compare_greater_than (const ConfigValue< T > &val, const ConfigInterface &config, const std::string &scope_param, const std::string &other_field_name, FetchFunc fetch_other) |
| Validates that the current value is greater than another config value. | |
| template<typename T , typename ConfigInterface , typename FetchFunc > | |
| ChainableResult< ConfigValue< T > > | compare_less_than (const ConfigValue< T > &val, const ConfigInterface &config, const std::string &scope_param, const std::string &other_field_name, FetchFunc fetch_other) |
| Validates that the current value is less than another config value. | |
| template<typename T , typename ConfigInterface , typename FetchFunc > | |
| ChainableResult< ConfigValue< T > > | compare_greater_equal (const ConfigValue< T > &val, const ConfigInterface &config, const std::string &scope_param, const std::string &other_field_name, FetchFunc fetch_other) |
| Validates that the current value is greater than or equal to another config value. | |
| template<typename T , typename ConfigInterface , typename FetchFunc > | |
| ChainableResult< ConfigValue< T > > | compare_less_equal (const ConfigValue< T > &val, const ConfigInterface &config, const std::string &scope_param, const std::string &other_field_name, FetchFunc fetch_other) |
| Validates that the current value is less than or equal to another config value. | |
| template<typename T , typename ConfigInterface , typename FetchFunc > | |
| ChainableResult< ConfigValue< T > > | compare_equal (const ConfigValue< T > &val, const ConfigInterface &config, const std::string &scope_param, const std::string &other_field_name, FetchFunc fetch_other) |
| Validates that the current value is equal to another config value. | |
| template<typename T , typename ConfigInterface , typename FetchFunc > | |
| ChainableResult< ConfigValue< T > > | compare_not_equal (const ConfigValue< T > &val, const ConfigInterface &config, const std::string &scope_param, const std::string &other_field_name, FetchFunc fetch_other) |
| Validates that the current value is not equal to another config value. | |
| void | panic (const StringViewSourceLoc &s) |
| Unconditionally terminates the program with a panic message. | |
| void | assert_or_panic (const bool condition, const StringViewSourceLoc &s) |
| Conditionally panics if the given condition is false. | |
Variables | |
| constexpr std::size_t | colors_per_pal = 16 |
| constexpr std::size_t | num_pals = 16 |
| constexpr std::size_t | num_colors = colors_per_pal * num_pals |
| constexpr Rgba32 | rgba_black {0, 0, 0, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_white {255, 255, 255, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_grey {128, 128, 128, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_red {255, 0, 0, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_green {0, 255, 0, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_blue {0, 0, 255, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_yellow {255, 255, 0, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_magenta {255, 0, 255, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_cyan {0, 255, 255, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_purple {128, 0, 255, Rgba32::alpha_opaque} |
| constexpr Rgba32 | rgba_lime {128, 255, 128, Rgba32::alpha_opaque} |
| using porytiles2::FormattedMessageBuilder = typedef std::function<std::vector<std::string>(const TextFormatter &)> |
Function type for building formatted messages with TextFormatter access.
FormattedMessageBuilder is a function type that receives a TextFormatter reference and returns a vector of formatted message lines. This pattern is used in UserDiagnostics to allow diagnostic messages to be generated with appropriate styling based on the output context (TTY vs non-TTY).
The builder function can use the TextFormatter to style text dynamically, enabling conditional formatting that adapts to the output destination.
Example usage:
Definition at line 329 of file text_formatter.hpp.
| using porytiles2::Result = typedef std::expected<T, E> |
A result with some type T on success, otherwise an error of type E.
Many Porytiles operations need to return either an expected result or some description of what went wrong during result computation. This type alias is a convenient wrapper for the stdlib std::expected, which provides this exact functionality. The std::string error type will typically be some description of what went wrong. However, the alias supports a custom user type for the error type if a string is not sufficient.
| T | The type of the expected result |
| E | The error type, defaults to std::string |
Definition at line 25 of file result.hpp.
|
strong |
| Enumerator | |
|---|---|
| off | |
| keep_unused | |
| remove_unused | |
Definition at line 7 of file incremental_build_mode.hpp.
|
strong |
Bitmask flags for text styling options.
Style is a bitmask enum that allows multiple styling attributes to be combined using bitwise operators. Each flag represents a distinct styling attribute that can be applied to text, such as bold formatting or color choices.
Styles can be combined using the bitwise OR operator (|) to apply multiple attributes simultaneously. For example, Style::bold | Style::red creates a style with both bold formatting and red color.
The enum uses an explicit uint32_t underlying type to ensure consistent bitmask behavior across platforms.
Definition at line 25 of file text_formatter.hpp.
|
strong |
| Enumerator | |
|---|---|
| true_color | |
| greyscale | |
Definition at line 10 of file tiles_pal_mode.hpp.
|
strong |
Represents the validation state of a configuration value from a ConfigProvider.
This enum distinguishes between three different states when a ConfigProvider attempts to supply a configuration value:
| Enumerator | |
|---|---|
| not_provided | |
| valid | |
| invalid | |
Definition at line 19 of file layer_value.hpp.
|
inline |
Conditionally panics if the given condition is false.
This function checks the provided condition and if it evaluates to false, formats and prints a panic message with source location information, then aborts the program. If the condition is true, the function returns normally.
| condition | The condition to check |
| s | The StringViewSourceLoc containing the panic message and location |
|
inline |
Checks if a string fully matches a regular expression pattern.
This function compiles the provided pattern into a regex and performs a full string match against the input string. Panics if the pattern is invalid.
| str | The string to match against the pattern |
| pattern | The regular expression pattern |
Definition at line 25 of file string_utils.hpp.
| ChainableResult< ConfigValue< T > > porytiles2::compare_equal | ( | const ConfigValue< T > & | val, |
| const ConfigInterface & | config, | ||
| const std::string & | scope_param, | ||
| const std::string & | other_field_name, | ||
| FetchFunc | fetch_other | ||
| ) |
Validates that the current value is equal to another config value.
| T | The type of the config values being compared (must support operator==) |
| ConfigInterface | The config interface type (DomainConfig, AppConfig, or InfraConfig) |
| FetchFunc | Callable type that fetches the other config value |
| 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 |
Definition at line 260 of file config_validators.hpp.
| ChainableResult< ConfigValue< T > > porytiles2::compare_greater_equal | ( | const ConfigValue< T > & | val, |
| const ConfigInterface & | config, | ||
| const std::string & | scope_param, | ||
| const std::string & | other_field_name, | ||
| FetchFunc | fetch_other | ||
| ) |
Validates that the current value is greater than or equal to another config value.
| T | The type of the config values being compared (must support operator>=) |
| ConfigInterface | The config interface type (DomainConfig, AppConfig, or InfraConfig) |
| FetchFunc | Callable type that fetches the other config value |
| 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 |
Definition at line 204 of file config_validators.hpp.
| ChainableResult< ConfigValue< T > > porytiles2::compare_greater_than | ( | const ConfigValue< T > & | val, |
| const ConfigInterface & | config, | ||
| const std::string & | scope_param, | ||
| const std::string & | other_field_name, | ||
| FetchFunc | fetch_other | ||
| ) |
Validates that the current value is greater than another config value.
This cross-field validator compares the current config value against another config value. It fetches the other value using the provided lambda and performs a greater-than comparison. If the comparison fails, returns a detailed error message showing both values and their sources.
| T | The type of the config values being compared (must support operator>) |
| ConfigInterface | The config interface type (DomainConfig, AppConfig, or InfraConfig) |
| FetchFunc | Callable type that fetches the other config value |
| 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 |
Definition at line 154 of file config_validators.hpp.
| ChainableResult< ConfigValue< T > > porytiles2::compare_less_equal | ( | const ConfigValue< T > & | val, |
| const ConfigInterface & | config, | ||
| const std::string & | scope_param, | ||
| const std::string & | other_field_name, | ||
| FetchFunc | fetch_other | ||
| ) |
Validates that the current value is less than or equal to another config value.
| T | The type of the config values being compared (must support operator<=) |
| ConfigInterface | The config interface type (DomainConfig, AppConfig, or InfraConfig) |
| FetchFunc | Callable type that fetches the other config value |
| 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 |
Definition at line 235 of file config_validators.hpp.
| ChainableResult< ConfigValue< T > > porytiles2::compare_less_than | ( | const ConfigValue< T > & | val, |
| const ConfigInterface & | config, | ||
| const std::string & | scope_param, | ||
| const std::string & | other_field_name, | ||
| FetchFunc | fetch_other | ||
| ) |
Validates that the current value is less than another config value.
| T | The type of the config values being compared (must support operator<) |
| ConfigInterface | The config interface type (DomainConfig, AppConfig, or InfraConfig) |
| FetchFunc | Callable type that fetches the other config value |
| 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 |
Definition at line 179 of file config_validators.hpp.
| ChainableResult< ConfigValue< T > > porytiles2::compare_not_equal | ( | const ConfigValue< T > & | val, |
| const ConfigInterface & | config, | ||
| const std::string & | scope_param, | ||
| const std::string & | other_field_name, | ||
| FetchFunc | fetch_other | ||
| ) |
Validates that the current value is not equal to another config value.
| T | The type of the config values being compared (must support operator!=) |
| ConfigInterface | The config interface type (DomainConfig, AppConfig, or InfraConfig) |
| FetchFunc | Callable type that fetches the other config value |
| 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 |
Definition at line 285 of file config_validators.hpp.
| std::string porytiles2::extract_function_name | ( | const std::source_location & | location = std::source_location::current() | ) |
Extracts the function name from a source location.
This function extracts the function name from a std::source_location and parses it to return just the simple function name without qualifiers, parameters, or return type.
For example, given:
Both would return: "num_tiles_primary"
| location | The source location from which to extract the function name (defaults to caller's location) |
Definition at line 8 of file source_locations.cpp.
|
inline |
Provides a simple way for fmtlib to format an Rgba32.
https://fmt.dev/11.1/api/#formatting-user-defined-types
Definition at line 104 of file rgba32.hpp.
| ShapeTile< ColorIndex > porytiles2::from_pixel_tile | ( | const PixelTile< PixelType > & | pixel_tile, |
| const ColorIndexMap< PixelType > & | color_index_map | ||
| ) |
Converts a PixelTile to a ShapeTile<ColorIndex> using a ColorIndexMap (intrinsic transparency).
This function creates a ShapeTile<ColorIndex> from a PixelTile by mapping each unique non-transparent color to its corresponding color index from the ColorIndexMap. For each color index, a ShapeMask is constructed that marks all pixel positions containing that color.
This overload is only available for pixel types that support intrinsic transparency (e.g., IndexPixel).
The conversion process:
| PixelType | The pixel type of the input tile, must support intrinsic transparency |
| pixel_tile | The PixelTile to convert |
| color_index_map | The ColorIndexMap providing color-to-index mappings |
Definition at line 106 of file tile_converters.hpp.
| ShapeTile< ColorIndex > porytiles2::from_pixel_tile | ( | const PixelTile< PixelType > & | pixel_tile, |
| const ColorIndexMap< PixelType > & | color_index_map, | ||
| const PixelType & | extrinsic | ||
| ) |
Converts a PixelTile to a ShapeTile<ColorIndex> using a ColorIndexMap (extrinsic transparency).
This function creates a ShapeTile<ColorIndex> from a PixelTile by mapping each unique non-transparent color to its corresponding color index from the ColorIndexMap. For each color index, a ShapeMask is constructed that marks all pixel positions containing that color.
This overload is only available for pixel types that support extrinsic transparency (e.g., Rgba32). Transparency is determined using both intrinsic (alpha=0) and extrinsic (matching the provided value) checks.
The conversion process:
| PixelType | The pixel type of the input tile, must support extrinsic transparency |
| pixel_tile | The PixelTile to convert |
| color_index_map | The ColorIndexMap providing color-to-index mappings |
| extrinsic | The extrinsic transparency value to check pixels against |
Definition at line 140 of file tile_converters.hpp.
| PixelTile< PixelType > porytiles2::from_shape_tile | ( | const ShapeTile< ColorIndex > & | shape_tile, |
| const ColorIndexMap< PixelType > & | color_index_map | ||
| ) |
Converts a ShapeTile<ColorIndex> to a PixelTile using a ColorIndexMap.
This function creates a PixelTile<InputPixelType> from a ShapeTile<ColorIndex> by looking up the actual color for each ColorIndex in the ColorIndexMap and setting the corresponding pixels in the result tile.
The conversion process:
| PixelType | The pixel type of the output tile, must support transparency |
| shape_tile | The ShapeTile<ColorIndex> to convert |
| color_index_map | The ColorIndexMap providing index-to-color mappings |
Definition at line 173 of file tile_converters.hpp.
Checks if a specific style flag is set in a Style value.
Helper function that tests whether a particular style flag is present in a Style value. This is more readable than using the bitwise operators directly for boolean checks.
| styles | The Style value to check |
| flag | The specific flag to test for |
Definition at line 112 of file text_formatter.hpp.
| std::vector< PaletteMatchResult< ColorType > > porytiles2::match_or_best | ( | const PixelTile< ColorType > & | tile, |
| const std::vector< Palette< ColorType > > & | palettes, | ||
| const ColorType & | extrinsic, | ||
| std::size_t | top_n | ||
| ) |
Finds the best palette match(es) for a tile (extrinsic transparency).
This function matches a tile against a vector of palettes and returns the best match(es):
Quality is determined by the number of missing_colors (fewer is better). If multiple palettes have the same number of missing colors, they maintain their original order in the palettes vector.
This overload supports both intrinsic (alpha=0) and extrinsic transparency checking. This overload is only available for color types that support extrinsic transparency.
| ColorType | The color type of the palette and tile, must support extrinsic transparency |
| tile | The PixelTile to match against the palettes |
| palettes | The vector of Palettes to check for color coverage |
| extrinsic | The extrinsic transparency value to check pixels against |
| top_n | Maximum number of results to return when no complete match exists (ignored if complete matches found) |
results.at(0).is_covered. The function partitions the result space into two mutually exclusive sets—complete matches (is_covered = true) or partial matches (is_covered = false)—never returning a heterogeneous mixture. Definition at line 220 of file palette_matchers.hpp.
| PaletteMatchResult< ColorType > porytiles2::match_tile_to_palette | ( | const PixelTile< ColorType > & | tile, |
| const Palette< ColorType > & | palette | ||
| ) |
Matches a PixelTile against a Palette (intrinsic transparency only).
This function determines whether the provided palette contains all non-transparent colors present in the tile. Only intrinsically transparent pixels (those reporting true from parameterless is_transparent()) are treated as transparent.
This overload is only available for color types that support intrinsic transparency.
The matching process:
| ColorType | The color type of the palette and tile, must support intrinsic transparency |
| tile | The PixelTile to match against the palette |
| palette | The Palette to check for color coverage |
Definition at line 143 of file palette_matchers.hpp.
| PaletteMatchResult< ColorType > porytiles2::match_tile_to_palette | ( | const PixelTile< ColorType > & | tile, |
| const Palette< ColorType > & | palette, | ||
| const ColorType & | extrinsic | ||
| ) |
Matches a PixelTile against a Palette (extrinsic transparency).
This function determines whether the provided palette contains all non-transparent colors present in the tile. Both intrinsically transparent pixels (alpha=0) and extrinsically transparent pixels (matching the extrinsic parameter) are treated as transparent.
This overload is only available for color types that support extrinsic transparency.
| ColorType | The color type of the palette and tile, must support extrinsic transparency |
| tile | The PixelTile to match against the palette |
| palette | The Palette to check for color coverage |
| extrinsic | The extrinsic transparency value to check pixels against |
Definition at line 169 of file palette_matchers.hpp.
Masks Style flags using bitwise AND.
Performs a bitwise AND operation on Style values, typically used to check if specific flags are set or to mask out certain style attributes.
| lhs | The left-hand Style value |
| rhs | The right-hand Style value |
Definition at line 64 of file text_formatter.hpp.
Masks an existing Style value using bitwise AND.
In-place bitwise AND assignment operator that masks an existing Style value, typically used to remove certain flags.
| lhs | The Style value to modify |
| rhs | The Style mask to apply |
Definition at line 95 of file text_formatter.hpp.
|
inline |
Stream insertion operator for Rgba32.
Allows Rgba32 objects to be written to output streams using the << operator. Uses the JASC string representation.
| os | The output stream |
| rgba | The Rgba32 color to output |
Definition at line 92 of file rgba32.hpp.
|
inline |
Definition at line 34 of file tiles_pal_mode.hpp.
Combines two Style flags using bitwise OR.
Allows multiple styling attributes to be combined into a single Style value. This operator enables natural syntax for combining styles, such as Style::bold | Style::red.
| lhs | The left-hand Style value |
| rhs | The right-hand Style value |
Definition at line 48 of file text_formatter.hpp.
Adds Style flags to an existing Style value using bitwise OR.
In-place bitwise OR assignment operator that adds additional style flags to an existing Style value.
| lhs | The Style value to modify |
| rhs | The Style flags to add |
Definition at line 79 of file text_formatter.hpp.
|
inline |
Unconditionally terminates the program with a panic message.
This function formats and prints a panic message containing the source location and user message, then aborts the program. The function never returns.
| s | The StringViewSourceLoc containing the panic message and location |
| std::expected< T, std::string > porytiles2::parse_int | ( | std::string_view | int_string | ) |
Definition at line 31 of file parse_int.hpp.
| std::expected< T, std::string > porytiles2::parse_int | ( | std::string_view | int_string, |
| const int | base | ||
| ) |
Definition at line 10 of file parse_int.hpp.
|
constexpr |
Reverses the bits in a byte.
This function reverses the order of all 8 bits in a byte. For example, the byte 0b10110010 would be reversed to 0b01001101.
| b | The byte to reverse |
Definition at line 17 of file reverse_bits.hpp.
| ShapeTile< PixelType > porytiles2::shape_tile_to_pixel_colors | ( | const ShapeTile< ColorIndex > & | shape_tile, |
| const ColorIndexMap< PixelType > & | color_index_map | ||
| ) |
Converts a ShapeTile<ColorIndex> to a ShapeTile<PixelType> using a ColorIndexMap.
This function creates a ShapeTile<PixelType> from a ShapeTile<ColorIndex> by looking up the actual color for each ColorIndex in the ColorIndexMap. The ShapeMasks remain the same, but the color values change from indices to actual pixel colors.
The conversion process:
| PixelType | The pixel type of the output tile, must support transparency |
| shape_tile | The ShapeTile<ColorIndex> to convert |
| color_index_map | The ColorIndexMap providing index-to-color mappings |
Definition at line 236 of file tile_converters.hpp.
|
inline |
Validates that a size_t config value is greater than zero.
This validator checks that the provided size_t config value is non-zero. If the value is zero, it returns a detailed error message showing the field name and the invalid value along with its configuration source information.
| val | The config value to validate |
Definition at line 31 of file config_validators.hpp.
|
inline |
Splits a string into tokens based on a delimiter.
This function splits the input string into a vector of substrings using the specified delimiter. The delimiter itself is not included in the resulting tokens. Empty tokens are preserved if consecutive delimiters are found.
| input | The string to split |
| delimiter | The delimiter string to split on |
Definition at line 70 of file string_utils.hpp.
|
inline |
Definition at line 12 of file tiles_pal_mode.hpp.
|
inline |
Definition at line 9 of file incremental_build_mode.hpp.
|
inline |
Definition at line 109 of file rgba32.hpp.
|
inline |
Definition at line 23 of file tiles_pal_mode.hpp.
| auto porytiles2::transform | ( | const std::vector< T > & | input | ) | -> std::vector<U> |
Transforms a vector of type T into a vector of type U using direct type construction.
This convenience overload allows direct type conversion when U is constructible from T. The transformation is performed using C++23 ranges for optimal performance. This is particularly useful for converting between related types like PixelTile and CanonicalPixelTile.
| U | The target type for the output vector elements |
| T | The type of elements in the input vector (typically deduced) |
| input | The input vector to transform |
Definition at line 44 of file transform.hpp.
| auto porytiles2::transform | ( | const std::vector< T > & | input, |
| F && | func | ||
| ) | -> std::vector<std::invoke_result_t<F, const T &>> |
Transforms a vector of type T into a vector of type U using a mapping function.
This function applies a transformation function to each element of the input vector, producing a new vector containing the transformed elements. The transformation is performed using C++23 ranges for optimal performance. The function uses lazy evaluation via std::views::transform and efficiently materializes the result with std::ranges::to.
| T | The type of elements in the input vector |
| F | The type of the transformation function |
| input | The input vector to transform |
| func | The transformation function that maps T to U |
Definition at line 24 of file transform.hpp.
|
inline |
Removes leading and trailing whitespace from a string in-place.
This function modifies the input string by removing all whitespace characters from the beginning and end of the string. The string is modified directly.
| string | The string to trim (modified in-place) |
Definition at line 45 of file string_utils.hpp.
|
inline |
Removes line ending characters from a string.
This function creates a copy of the input string and removes all trailing carriage return (\r) and newline (
) characters from the end. The original string is not modified.
| line | The string to trim |
Definition at line 112 of file string_utils.hpp.
|
inline |
Removes line ending characters from a string in-place.
This function removes all trailing carriage return (\r) and newline (
) characters from the end of the string. The string is modified directly.
| line | The string to trim (modified in-place) |
Definition at line 93 of file string_utils.hpp.
|
inlineconstexpr |
Definition at line 12 of file color_index.hpp.
|
inlineconstexpr |
Definition at line 14 of file color_index.hpp.
|
inlineconstexpr |
Definition at line 13 of file color_index.hpp.
|
constexpr |
Definition at line 114 of file rgba32.hpp.
|
constexpr |
Definition at line 119 of file rgba32.hpp.
|
constexpr |
Definition at line 122 of file rgba32.hpp.
|
constexpr |
Definition at line 118 of file rgba32.hpp.
|
constexpr |
Definition at line 116 of file rgba32.hpp.
|
constexpr |
Definition at line 124 of file rgba32.hpp.
|
constexpr |
Definition at line 121 of file rgba32.hpp.
|
constexpr |
Definition at line 123 of file rgba32.hpp.
|
constexpr |
Definition at line 117 of file rgba32.hpp.
|
constexpr |
Definition at line 115 of file rgba32.hpp.
|
constexpr |
Definition at line 120 of file rgba32.hpp.