Classes | Macros | Functions
qoi.h File Reference

Go to the source code of this file.

Classes

struct  qoi_desc
 Descriptor of image to be compressed. More...
 

Macros

#define QOI_LINEAR   1
 
#define QOI_SRGB   0
 

Functions

void * qoi_decode (const void *data, int size, qoi_desc *desc, int channels)
 Decode a QOI image from memory. More...
 
void * qoi_encode (const void *data, const qoi_desc *desc, int *out_len)
 Encode raw RGB or RGBA pixels into a QOI image in memory. More...
 

Macro Definition Documentation

◆ QOI_LINEAR

#define QOI_LINEAR   1

Definition at line 223 of file qoi.h.

◆ QOI_SRGB

#define QOI_SRGB   0

Definition at line 222 of file qoi.h.

Function Documentation

◆ qoi_decode()

void* qoi_decode ( const void *  data,
int  size,
qoi_desc desc,
int  channels 
)

Decode a QOI image from memory.

Note
The returned pixel data should be free()d after use.
Parameters
[in]data
[in]size
[out]desc
[in]channels
Returns
Either returns NULL on failure (invalid parameters or malloc failed) or a pointer to the decoded pixels. On success, the qoi_desc struct is filled with the description from the file header.

◆ qoi_encode()

void* qoi_encode ( const void *  data,
const qoi_desc desc,
int out_len 
)

Encode raw RGB or RGBA pixels into a QOI image in memory.

Note
The returned qoi data should be free()d after use.
Parameters
[in]dataThe input image bytes.
[in]descDescriptor of the input image.
[out]out_lenSize of the compressed data in bytes.
Returns
Either returns NULL on failure (invalid parameters or malloc failed) or a pointer to the encoded data on success. On success the out_len is set to the size in bytes of the encoded data.


qoi_image_transport
Author(s): Martin Pecka
autogenerated on Sat Apr 5 2025 03:02:01