3 #include <math/Types.h>
4 #include <resource/Resource.h>
10 explicit Image(std::string identifier_,
bool vFlip =
true);
15 Image& operator=(
Image&& other) noexcept =
default;
17 void compile(
const byte buffer[], std::size_t bufferLen)
override;
18 [[nodiscard]]
inline byte* getData()
const {
21 [[nodiscard]]
inline int getWidth()
const {
24 [[nodiscard]]
inline int getHeight()
const {
27 [[nodiscard]]
inline int getBitDepth()
const {
28 return this->bitDepth;
30 [[nodiscard]]
inline bool isVerticallyFlipped()
const {
31 return this->verticalFlip;
34 [[nodiscard]]
static byte* getUncompressedImage(
const byte buffer[],
int bufferLen,
int* width,
int* height,
int* fileChannels,
int desiredChannels,
bool vflip);
35 [[nodiscard]]
static byte* getUncompressedImage(
const byte buffer[],
int bufferLen,
int desiredChannels,
bool vflip);
36 [[nodiscard]]
static byte* getUncompressedImage(std::string_view filepath,
int* width,
int* height,
int* fileChannels,
int desiredChannels,
bool vflip);
37 [[nodiscard]]
static byte* getUncompressedImage(std::string_view filepath,
int desiredChannels,
bool vflip);
38 static void deleteUncompressedImage(
byte* image);
40 byte* image =
nullptr;
44 bool verticalFlip =
true;
46 CHIRA_REGISTER_DEFAULT_RESOURCE(
Image,
"file://textures/missing.png");
A chunk of data, usually a file. Is typically cached and shared.