Go to the source code of this file.
◆ QOI_LINEAR
◆ QOI_SRGB
◆ 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] | data | The input image bytes. |
| [in] | desc | Descriptor of the input image. |
| [out] | out_len | Size 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.