An image: width, height, format, pixels and its .dtex file header.
More...
#include <deki/assets/Texture2D.h>
An image: width, height, format, pixels and its .dtex file header.
◆ TextureFormat
| Enumerator |
|---|
| RGB888 | |
| RGBA8888 | |
| RGB565 | |
| RGB565A8 | |
| ALPHA8 | |
◆ Texture2D()
| Deki::Texture2D::Texture2D |
( |
| ) |
|
◆ ~Texture2D()
| virtual Deki::Texture2D::~Texture2D |
( |
| ) |
|
|
virtual |
◆ ConvertToRGBA()
| uint8_t * Deki::Texture2D::ConvertToRGBA |
( |
const uint8_t * | srcData, |
|
|
int32_t | width, |
|
|
int32_t | height, |
|
|
TextureFormat | format ) |
|
static |
Converts pixels in format to RGBA8888.
The caller owns the result and frees it with delete[]; nullptr on failure.
◆ GetBytesPerPixel()
| uint32_t Deki::Texture2D::GetBytesPerPixel |
( |
TextureFormat | format | ) |
|
|
static |
◆ GetFormatName()
| const char * Deki::Texture2D::GetFormatName |
( |
TextureFormat | format | ) |
|
|
static |
The format's name, for logs.
◆ Load()
| Texture2D * Deki::Texture2D::Load |
( |
const char * | filePath | ) |
|
|
static |
Loads a compiled texture file (.tex), or returns nullptr.
◆ LoadAsRGBA()
| uint8_t * Deki::Texture2D::LoadAsRGBA |
( |
const char * | filePath, |
|
|
int32_t & | outWidth, |
|
|
int32_t & | outHeight, |
|
|
bool & | outHasAlpha ) |
|
static |
Loads a .tex file as RGBA8888 pixels (editor).
The caller owns the result and frees it with delete[]; nullptr on failure.
◆ LoadFromMemory()
| virtual bool Deki::Texture2D::LoadFromMemory |
( |
const Texture2D::Header & | header, |
|
|
const uint8_t * | data ) |
|
protectedvirtual |
Fills the texture from data, the file's bytes after header.
Returns false on failure.
◆ ValidateHeader()
True when the header is well formed.
◆ allocatedWithBackend
| bool Deki::Texture2D::allocatedWithBackend |
◆ alphaRowSpans
◆ data
| uint8_t* Deki::Texture2D::data |
◆ filter
◆ format
◆ hasAlpha
| bool Deki::Texture2D::hasAlpha |
◆ hasTransparency
| bool Deki::Texture2D::hasTransparency |
◆ height
| int32_t Deki::Texture2D::height |
◆ width
| int32_t Deki::Texture2D::width |
The documentation for this class was generated from the following file: