|
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. | |
| 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 95 of file metatile.hpp.
|
inline |
Definition at line 97 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 189 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 173 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 152 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 110 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 132 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 236 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 220 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 203 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 250 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 297 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 283 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 267 of file metatile.hpp.