|
Porytiles
|
The core tileset entity - a 2x2 grid of PixelTile objects arranged into three layers. More...
#include <metatile.hpp>
Public Member Functions | |
| Metatile () | |
| bool | operator== (const Metatile &) const =default |
| bool | is_transparent () const |
| Checks if this entire metatile is transparent (intrinsic transparency only). | |
| bool | is_transparent (const PixelType &extrinsic) const |
| Checks if this entire metatile is transparent. | |
| std::array< PixelTile< PixelType >, metatile::tiles_per_metatile > | decompose () const |
| Decomposes this metatile into an array of PixelTiles in metatile order. | |
| LayerMode | infer_layer_mode () const |
| Infers the layer mode (dual or triple) based on metatile content (intrinsic transparency only). | |
| LayerMode | infer_layer_mode (const PixelType &extrinsic) const |
| Infers the layer mode (dual or triple) based on metatile content. | |
| LayerType | infer_layer_type () const |
| Infers the layer type based on which layers contain content (intrinsic transparency only). | |
| LayerType | infer_layer_type (const PixelType &extrinsic) const |
| Infers the layer type based on which layers contain content. | |
| const PixelTile< PixelType > & | bottom (std::size_t i) const |
| Get a constant reference to a PixelTile from the bottom layer. | |
| const std::array< PixelTile< PixelType >, metatile::tiles_per_metatile_layer > & | bottom () const |
| Get a constant reference to the entire bottom layer array. | |
| void | set_bottom (std::size_t i, PixelTile< PixelType > tile) |
| Set a PixelTile in the bottom layer. | |
| const PixelTile< PixelType > & | middle (std::size_t i) const |
| Get a constant reference to a PixelTile from the middle layer. | |
| const std::array< PixelTile< PixelType >, metatile::tiles_per_metatile_layer > & | middle () const |
| Get a constant reference to the entire middle layer array. | |
| void | set_middle (std::size_t i, PixelTile< PixelType > tile) |
| Set a PixelTile in the middle layer. | |
| const PixelTile< PixelType > & | top (std::size_t i) const |
| Get a constant reference to a PixelTile from the top layer. | |
| const std::array< PixelTile< PixelType >, metatile::tiles_per_metatile_layer > & | top () const |
| Get a constant reference to the entire top layer array. | |
| void | set_top (std::size_t i, PixelTile< PixelType > tile) |
| Set a Tile in the top layer. | |
The core tileset entity - a 2x2 grid of PixelTile objects arranged into three layers.
Like its component PixelTile objects, the pixel type of Metatile is arbitrary.
Metatile<PixelType>{} produces a metatile where all PixelTile objects in all three layers are default-constructed (and thus transparent, assuming PixelTile and PixelType satisfy the invariant).Definition at line 186 of file metatile.hpp.
|
inline |
Definition at line 188 of file metatile.hpp.
|
inline |
Get a constant reference to the entire bottom layer array.
Returns the complete array of tiles in the bottom layer, allowing for range-based iteration.
Definition at line 352 of file metatile.hpp.
|
inline |
Get a constant reference to a PixelTile from the bottom layer.
Retrieves the PixelTile at the specified index in the bottom layer array.
| i | The index into the bottom layer array (must be 0-3). |
Definition at line 336 of file metatile.hpp.
|
inline |
Decomposes this metatile into an array of PixelTiles in metatile order.
Returns tiles in bottom-middle-top layer order, with each layer's tiles arranged sequentially.
Definition at line 243 of file metatile.hpp.
|
inline |
Infers the layer mode (dual or triple) based on metatile content (intrinsic transparency only).
A metatile uses triple-layer mode if all three layers contain at least one non-transparent pixel. Otherwise, it uses dual-layer mode. This overload uses intrinsic transparency checking.
Definition at line 264 of file metatile.hpp.
|
inline |
Infers the layer mode (dual or triple) based on metatile content.
A metatile uses triple-layer mode if all three layers contain at least one non-transparent pixel. Otherwise, it uses dual-layer mode. This overload uses both intrinsic and extrinsic transparency checking.
| extrinsic | The extrinsic transparency value to check each pixel against |
Definition at line 280 of file metatile.hpp.
|
inline |
Infers the layer type based on which layers contain content (intrinsic transparency only).
Determines which layers (bottom, middle, top) are active for rendering based on content:
Definition at line 300 of file metatile.hpp.
|
inline |
Infers the layer type based on which layers contain content.
Determines which layers (bottom, middle, top) are active for rendering based on content:
| extrinsic | The extrinsic transparency value to check each pixel against |
Definition at line 321 of file metatile.hpp.
|
inline |
Checks if this entire metatile is transparent (intrinsic transparency only).
A metatile is transparent if all of its pixels are intrinsically transparent. This overload is only available for pixel types that support parameterless is_transparent() (e.g., IndexPixel).
Definition at line 201 of file metatile.hpp.
|
inline |
Checks if this entire metatile is transparent.
A metatile is transparent if all of its pixels are either intrinsically transparent or are extrinsically transparent, according to the provided extrinsic transparency value. This overload is only available for pixel types that support extrinsic transparency (e.g., Rgba32).
| extrinsic | The extrinsic transparency value to check each pixel against |
Definition at line 223 of file metatile.hpp.
|
inline |
Get a constant reference to the entire middle layer array.
Returns the complete array of tiles in the middle layer, allowing for range-based iteration.
Definition at line 399 of file metatile.hpp.
|
inline |
Get a constant reference to a PixelTile from the middle layer.
Retrieves the PixelTile at the specified index in the middle layer array.
| i | The index into the middle layer array (must be 0-3). |
Definition at line 383 of file metatile.hpp.
|
default |
|
inline |
Set a PixelTile in the bottom layer.
Moves the provided PixelTile into the specified index of the bottom layer array.
| i | The index into the bottom layer array (must be 0-3). |
| tile | The PixelTile to move into the array. |
Definition at line 366 of file metatile.hpp.
|
inline |
Set a PixelTile in the middle layer.
Moves the provided PixelTile into the specified index of the middle layer array.
| i | The index into the middle layer array (must be 0-3). |
| tile | The PixelTile to move into the array. |
Definition at line 413 of file metatile.hpp.
|
inline |
Set a Tile in the top layer.
Moves the provided PixelTile into the specified index of the top layer array.
| i | The index into the top layer array (must be 0-3). |
| tile | The PixelTile to move into the array. |
Definition at line 460 of file metatile.hpp.
|
inline |
Get a constant reference to the entire top layer array.
Returns the complete array of tiles in the top layer, allowing for range-based iteration.
Definition at line 446 of file metatile.hpp.
|
inline |
Get a constant reference to a PixelTile from the top layer.
Retrieves the PixelTile at the specified index in the top layer array.
| i | The index into the top layer array (must be 0-3). |
Definition at line 430 of file metatile.hpp.