| 1 | #ifndef LIB__QOI_H__ |
| 2 | #define LIB__QOI_H__ |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <stddef.h> |
| 6 | |
| 7 | /* Decodes a QOI image (https://qoiformat.org) from `src` (size `src_size`) |
| 8 | into a freshly allocated XRGB8 pixel buffer. Each output pixel is a 32-bit |
| 9 | little-endian word laid out as 0x00RRGGBB; the QOI alpha is dropped. |
| 10 | On success, returns the buffer and writes the decoded width/height into |
| 11 | *out_w / *out_h. Returns NULL on malformed input. The returned buffer |
| 12 | must be released with qoi_free(). */ |
| 13 | uint8_t *qoi_decode(const void *src, size_t src_size, |
| 14 | int *out_w, int *out_h); |
| 15 | |
| 16 | /* Releases a buffer returned by qoi_decode(). NULL is accepted. */ |
| 17 | void qoi_free(uint8_t *buf); |
| 18 | |
| 19 | #endif |