16#ifndef AEONGUI_RASTERIMAGE_H
17#define AEONGUI_RASTERIMAGE_H
71 [[nodiscard]] DLL
bool IsLoaded()
const;
83 [[nodiscard]] DLL uint32_t
GetWidth()
const;
87 [[nodiscard]] DLL uint32_t
GetHeight()
const;
91 [[nodiscard]] DLL
size_t GetStride()
const;
95 [[nodiscard]] DLL
const uint8_t*
GetPixels()
const;
99 [[nodiscard]] DLL
const std::vector<uint8_t>&
GetPixelData()
const;
106 std::vector<uint8_t> mPixelData;
const uint8_t * GetPixels() const
Get a pointer to the decoded pixel data.
Definition RasterImage.cpp:403
RasterImage()
Default constructor. Creates an empty (unloaded) image.
Definition RasterImage.cpp:271
bool LoadFromMemory(const void *aData, size_t aSize)
Load an image from a memory buffer.
Definition RasterImage.cpp:305
uint32_t GetWidth() const
Get the image width in pixels.
Definition RasterImage.cpp:388
PixelFormat
Decoded pixel formats.
Definition RasterImage.hpp:46
@ RGBA8
8 bits per channel, RGBA.
Definition RasterImage.hpp:48
EncodedFormat GetEncodedFormat() const
Get the original encoded format of the loaded image.
Definition RasterImage.cpp:378
size_t GetStride() const
Get the stride (bytes per row) of the decoded image.
Definition RasterImage.cpp:398
EncodedFormat
Supported encoded image formats.
Definition RasterImage.hpp:37
@ PNG
PNG format.
Definition RasterImage.hpp:39
@ Unknown
Format not recognized.
Definition RasterImage.hpp:38
@ JPEG
JPEG format.
Definition RasterImage.hpp:40
@ PCX
PCX format.
Definition RasterImage.hpp:41
PixelFormat GetPixelFormat() const
Get the decoded pixel format.
Definition RasterImage.cpp:383
void Clear()
Release the decoded pixel data.
Definition RasterImage.cpp:364
bool LoadFromFile(const std::string &aPath)
Load an image from a file.
Definition RasterImage.cpp:279
uint32_t GetHeight() const
Get the image height in pixels.
Definition RasterImage.cpp:393
const std::vector< uint8_t > & GetPixelData() const
Get a reference to the decoded pixel data vector.
Definition RasterImage.cpp:408
bool IsLoaded() const
Check whether an image has been loaded.
Definition RasterImage.cpp:373