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:416
RasterImage()
Default constructor. Creates an empty (unloaded) image.
Definition RasterImage.cpp:275
uint32_t GetWidth() const
Get the image width in pixels.
Definition RasterImage.cpp:401
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:391
void LoadFromMemory(const void *aData, size_t aSize)
Load an image from a memory buffer.
Definition RasterImage.cpp:318
size_t GetStride() const
Get the stride (bytes per row) of the decoded image.
Definition RasterImage.cpp:411
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
void LoadFromFile(const std::string &aPath)
Load an image from a file.
Definition RasterImage.cpp:283
PixelFormat GetPixelFormat() const
Get the decoded pixel format.
Definition RasterImage.cpp:396
void Clear()
Release the decoded pixel data.
Definition RasterImage.cpp:377
uint32_t GetHeight() const
Get the image height in pixels.
Definition RasterImage.cpp:406
const std::vector< uint8_t > & GetPixelData() const
Get a reference to the decoded pixel data vector.
Definition RasterImage.cpp:421
bool IsLoaded() const
Check whether an image has been loaded.
Definition RasterImage.cpp:386