Decoded raster image.
More...
#include <aeongui/RasterImage.hpp>
|
|
| RasterImage () |
| | Default constructor. Creates an empty (unloaded) image.
|
| bool | LoadFromFile (const std::string &aPath) |
| | Load an image from a file.
|
| bool | LoadFromMemory (const void *aData, size_t aSize) |
| | Load an image from a memory buffer.
|
|
void | Clear () |
| | Release the decoded pixel data.
|
| bool | IsLoaded () const |
| | Check whether an image has been loaded.
|
| EncodedFormat | GetEncodedFormat () const |
| | Get the original encoded format of the loaded image.
|
| PixelFormat | GetPixelFormat () const |
| | Get the decoded pixel format.
|
| uint32_t | GetWidth () const |
| | Get the image width in pixels.
|
| uint32_t | GetHeight () const |
| | Get the image height in pixels.
|
| size_t | GetStride () const |
| | Get the stride (bytes per row) of the decoded image.
|
| const uint8_t * | GetPixels () const |
| | Get a pointer to the decoded pixel data.
|
| const std::vector< uint8_t > & | GetPixelData () const |
| | Get a reference to the decoded pixel data vector.
|
Decoded raster image.
Loads PNG, JPEG, or PCX images from files or memory and provides access to the decoded RGBA pixel data.
◆ EncodedFormat
Supported encoded image formats.
| Enumerator |
|---|
| Unknown | Format not recognized.
|
| PNG | PNG format.
|
| JPEG | JPEG format.
|
| PCX | PCX format.
|
◆ PixelFormat
Decoded pixel formats.
| Enumerator |
|---|
| Unknown | No decoded data.
|
| RGBA8 | 8 bits per channel, RGBA.
|
◆ GetEncodedFormat()
Get the original encoded format of the loaded image.
- Returns
- The encoded format.
◆ GetHeight()
| uint32_t AeonGUI::RasterImage::GetHeight |
( |
| ) |
const |
|
nodiscard |
Get the image height in pixels.
- Returns
- Height in pixels.
◆ GetPixelData()
| const std::vector< uint8_t > & AeonGUI::RasterImage::GetPixelData |
( |
| ) |
const |
|
nodiscard |
Get a reference to the decoded pixel data vector.
- Returns
- Const reference to the internal pixel buffer.
◆ GetPixelFormat()
Get the decoded pixel format.
- Returns
- The pixel format.
◆ GetPixels()
| const uint8_t * AeonGUI::RasterImage::GetPixels |
( |
| ) |
const |
|
nodiscard |
Get a pointer to the decoded pixel data.
- Returns
- Pointer to RGBA8 pixel data, or nullptr if not loaded.
◆ GetStride()
| size_t AeonGUI::RasterImage::GetStride |
( |
| ) |
const |
|
nodiscard |
Get the stride (bytes per row) of the decoded image.
- Returns
- Stride in bytes.
◆ GetWidth()
| uint32_t AeonGUI::RasterImage::GetWidth |
( |
| ) |
const |
|
nodiscard |
Get the image width in pixels.
- Returns
- Width in pixels.
◆ IsLoaded()
| bool AeonGUI::RasterImage::IsLoaded |
( |
| ) |
const |
|
nodiscard |
Check whether an image has been loaded.
- Returns
- true if pixel data is available.
◆ LoadFromFile()
| bool AeonGUI::RasterImage::LoadFromFile |
( |
const std::string & | aPath | ) |
|
Load an image from a file.
- Parameters
-
| aPath | Path to the image file. |
- Returns
- true if loading succeeded.
◆ LoadFromMemory()
| bool AeonGUI::RasterImage::LoadFromMemory |
( |
const void * | aData, |
|
|
size_t | aSize ) |
Load an image from a memory buffer.
- Parameters
-
| aData | Pointer to the encoded image data. |
| aSize | Size of the data in bytes. |
- Returns
- true if loading succeeded.
The documentation for this class was generated from the following files: