|
Porytiles
|
Service for converting layer images into collections of metatiles. More...
#include <layer_image_metatileizer.hpp>
Public Member Functions | |
| ChainableResult< std::vector< Metatile< T > > > | metatileize (const Image< T > &bottom, const Image< T > &middle, const Image< T > &top) const |
| Converts three layer images into a vector of metatiles. | |
| ChainableResult< std::tuple< Image< T >, Image< T >, Image< T > > > | demetatileize (const std::vector< Metatile< T > > &metatiles, std::size_t metatiles_per_row) const |
| Converts a vector of metatiles back into three separate layer images. | |
Service for converting layer images into collections of metatiles.
The LayerImageMetatileizer service provides functionality to convert three layer images (bottom, middle, top) into a collection of 16x16 pixel metatiles. Each metatile contains a 2x2 arrangement of 8x8 tiles from each layer.
This service handles the validation of input dimensions, tileization of each layer, and the construction of metatiles by combining corresponding tiles from each layer. Returns Metatile<T> objects.
| T | The pixel type (e.g., Rgba32, IndexPixel) |
Definition at line 31 of file layer_image_metatileizer.hpp.
|
inline |
Converts a vector of metatiles back into three separate layer images.
This method performs the inverse of metatileize, reconstructing the original three layer images from a collection of metatiles. The process involves:
| metatiles | The vector of Metatile<T> objects to convert back to images |
| metatiles_per_row | The number of metatiles per row (width in metatiles) |
Definition at line 143 of file layer_image_metatileizer.hpp.
|
inline |
Converts three layer images into a vector of metatiles.
This method takes three images representing the bottom, middle, and top layers and converts them into metatiles. The process involves:
| bottom | The bottom layer image |
| middle | The middle layer image |
| top | The top layer image |
Definition at line 52 of file layer_image_metatileizer.hpp.