Defold Learn logo


Image

Image API functions.

Namespace: dmImage
Include: #include <dmsdk/dlib/image.h>
ENUMS
Result result enumeration
Type type enumeration
FUNCTIONS
bool GetAstcBlockSize (void* mem, uint32_t memsize, uint32_t* width, uint32_t* height, uint32_t* depth) Get the block size
bool GetAstcDimensions (void* mem, uint32_t memsize, uint32_t* width, uint32_t* height, uint32_t* depth) Get the astc image size

Functions

GetAstcBlockSize

bool GetAstcBlockSize(void* mem, uint32_t memsize, uint32_t* width, uint32_t* height, uint32_t* depth)

Get the block size

PARAMETERS

void* mem the .astc memory (including the header)
uint32_t memsize the length of the memory blob
uint32_t* width (out) the block width
uint32_t* height (out) the block height
uint32_t* depth (out) the block depth

RETURNS

bool true if it's an astc file

GetAstcDimensions

bool GetAstcDimensions(void* mem, uint32_t memsize, uint32_t* width, uint32_t* height, uint32_t* depth)

Get the astc image size

PARAMETERS

void* mem the .astc memory (including the header)
uint32_t memsize the length of the memory blob
uint32_t* width (out) the block width
uint32_t* height (out) the block height
uint32_t* depth (out) the block depth

RETURNS

bool true if it's an astc file

Enums

Result

result enumeration

dmImage::RESULT_OK = 0
dmImage::RESULT_UNSUPPORTED_FORMAT = -1
dmImage::RESULT_IMAGE_ERROR = -2

Type

type enumeration

dmImage::TYPE_RGB = 0
dmImage::TYPE_RGBA = 1
dmImage::TYPE_LUMINANCE = 2
dmImage::TYPE_LUMINANCE_ALPHA = 3