#285·qoi

No option to provide pre-allocated memory to encode and decode

Author: abhaychirania2411Created Sep 14, 2023Updated Apr 14, 2024

Hi,

I have been working on a project that needs qoi encoding and decoding, but the final results should be put in a pre allocated memory. Although we can provide our own allocator, but i want to provide a pre allocated memory to the encoded function.

Something like this: void *qoi_encode(const void *data, const qoi_desc *desc, int *out_len, void *dest);

This dest adress can be optional, i.e if NULL then go ahead and allocate the memory using QOI_MALLOC