C ABI Reference
Header reference for include/qualix.h (qualix_decoder static/shared library): structs, ownership contracts, streaming callbacks, and decode lifecycle.
Declared in include/qualix.h. Functions returning int32_t report 0 on success, -1 for invalid arguments, and -2 for corrupt bitstreams or budget violations. Each QlxDecoder * is externally synchronized (one caller at a time).
Types & constants
Ctypedef struct QlxDecoder QlxDecoder;typedef enum { QLX_SRGB8 = 1, QLX_PQ10 = 2, QLX_HLG10 = 3 } QlxColor;typedef struct { uint32_t width, height, fps_num, fps_den, frames, key_interval, color, drop_bits;} QlxInfo;typedef struct { const uint8_t *pixels; size_t length; uint32_t first_row, end_row;} QlxFrame;#define QLX_ADAPTIVE_QUANTIZATION 255u#define QLX_DEFAULT_BUDGET ((size_t)160 * 1024 * 1024)
Functions & ownership contracts
| Symbol | Parameters & Borrowing Rules | Behavior |
|---|---|---|
qlx_probe |
const uint8_t *bytes, size_t length, QlxInfo *out |
Inspects only the 32-byte header so hosts can size textures upfront |
qlx_open |
const uint8_t *bytes, size_t length, size_t budget, QlxDecoder **out, QlxInfo *info |
Borrows immutable pack/asset memory until qlx_close (unaligned offsets allowed) |
qlx_open_into |
..., uint8_t *pixels, size_t size, ... |
Borrows an exclusively writable initialized host canvas; sync GPU reads prior to next decode |
qlx_open_stream |
QlxReadAt read_at, void *context, uint64_t member_length, size_t budget, uint8_t *pixels, size_t size, QlxDecoder **out, QlxInfo *info |
Streams via synchronous read_at(context, offset, dest, size) callback (includes 64 KiB read buffer inside budget) |
qlx_decode |
QlxDecoder *decoder, uint32_t number, QlxFrame *out |
Yields tightly packed pixels valid until next qlx_decode/qlx_close plus dirty rows [first_row, end_row) |
qlx_close |
QlxDecoder *decoder |
Destroys the handle cleanly (NULL accepted) |