std::compression::qoi

encode

fn char[]? encode(Allocator allocator, char[] input, QOIDesc* desc) @nodiscard
Encode raw RGB or RGBA pixels into a QOI image in memory.

The function returns an optional, which can either be a QOIError
or a char[] pointing to the encoded data on success.

The returned qoi data should be free()d after use, or the encoding
and use of the data should be wrapped in a @pool() { ... }; block.
See the write() function for an example.

Parameters