|
| | Image () |
| |
| | Image (std::size_t width, std::size_t height) |
| |
| | Image (std::size_t width, std::size_t height, std::vector< Rgba32 > palette) |
| |
| PixelType | at (std::size_t i) const |
| | Fetches the pixel value at a given one-dimensional pixel index.
|
| |
| PixelType | at (std::size_t row, std::size_t col) const |
| | Fetches the pixel value at a given row and column.
|
| |
| void | set (std::size_t i, PixelType pixel) |
| | Sets the pixel value at a given one-dimensional pixel index.
|
| |
| void | set (std::size_t row, std::size_t col, PixelType pixel) |
| | Sets the pixel value at a given row and column.
|
| |
| std::size_t | width () const |
| | Gets the width of this image in pixels.
|
| |
| std::size_t | height () const |
| | Gets the height of this image in pixels.
|
| |
| std::size_t | size () const |
| | Gets the size of this image in pixels.
|
| |
| const std::optional< std::vector< Rgba32 > > & | palette () const |
| |
template<typename PixelType>
class porytiles2::Image< PixelType >
A template for two-dimensional images with arbitrarily typed pixel values.
Clients who need to operate on images can use this class to read image data and manipulate image contents. This value type makes no assumptions about the underlying image storage format. Image provides an optional palette field for images which want to store an IndexPixel pixel type into a fixed palette of colors.
- Template Parameters
-
| PixelType | The pixel type for this Image |
Definition at line 24 of file image.hpp.
template<typename PixelType >
Fetches the pixel value at a given one-dimensional pixel index.
The one-dimensional index assumes the image as an array of pixels, where the length of the array is the image's width times height.
- Parameters
-
| i | The one-dimensional pixel index. |
- Returns
- The pixel value at the given pixel index.
Definition at line 45 of file image.hpp.