32 [[nodiscard]] uint32_t
GetWidth()
const;
57 [[nodiscard]]
bool IsPadded()
const {
return m_IsPadded; }
66 std::expected<void, Core::CoriError<>>
AddPadding(
const glm::u16vec2 spriteResolution);
73 [[nodiscard]]
static std::shared_ptr<Image>
Create(
const std::filesystem::path& path);
78 explicit Image(
const std::filesystem::path& path);
80 bool m_HasSemiTransparency{
false };
82 bool m_SuccessStatus{
false };
83 bool m_IsPadded{
false };
Used to load an image. It can flip and image and add padding to it. Mainly used for texture loading.
bool HasSemiTransparency() const
Checks if an image has semi transparency or no.
uint32_t GetWidth() const
Gives you the image width.
void * GetPixelData() const
Gives you the pointer to the start of the pixel data, format is RGBA8888.
bool GetSuccessStatus() const
Checks if the image was loaded successfully.
bool IsPadded() const
Checks if an image is padded.
void FlipVertically()
Flips a loaded image vertically.
void FlipHorizontally()
Flips a loaded image horizontally.
static std::shared_ptr< Image > Create(const std::filesystem::path &path)
Creates an Image from the picture at the specified path.
std::expected< void, Core::CoriError<> > AddPadding(const glm::u16vec2 spriteResolution)
Adds padding to the image that will be used in a sprite atlas.
uint32_t GetHeight() const
Gives you the image height.
For InstanceMetrics to work with a type it should derive from this.
Almost everything connected to graphics is in this namespace.