142typedef enum : uint8_t {
175typedef enum : uint32_t {
190typedef enum : uint8_t {
241 *
jof_pread_fn)(
void* ctx, uint64_t offset, uint8_t* buf,
size_t len,
size_t* got);
454 uint32_t scratch_cap,
jof_layout_t
Fixed byte sizes and offsets of the JOF on-disk structures.
@ k_jof_ofs_tile_count
Header: u32 tile count.
@ k_jof_index_entry
Bytes per tile-index entry.
@ k_jof_ofs_magic
Header: magic "JOF1".
@ k_jof_ofs_reserved
Header: first reserved byte.
@ k_jof_magic_len
Magic string length (both ends).
@ k_jof_footer_bytes
Footer length.
@ k_jof_ftr_total_size
Footer: u32 total atlas size.
@ k_jof_hdr_bytes
Header length.
@ k_jof_ftr_magic
Footer: magic "JOFE".
@ k_jof_ftr_index_off
Footer: u32 index offset.
@ k_jof_ofs_reserved2
Header: second reserved run.
@ k_jof_ofs_tile_h
Header: u16 tile height.
@ k_jof_ofs_codec
Header: u8 tile codec.
@ k_jof_idx_ofs_length
Index entry: u32 tile length.
@ k_jof_ofs_height
Header: u16 image height.
@ k_jof_ofs_tile_w
Header: u16 tile width.
@ k_jof_ofs_width
Header: u16 image width.
@ k_jof_ftr_tile_count
Footer: u32 tile count.
@ k_jof_ofs_bpp
Header: u8 bytes per pixel.
@ k_jof_idx_ofs_offset
Index entry: u32 tile offset.
ra8_err_t jof_memstore_pread(void *ctx, uint64_t offset, uint8_t *buf, size_t len, size_t *got)
Positioned read from a jof_memstore_t (reader seam).
jof_limits_t
Hard caps every JOF atlas must satisfy (fail-closed validation).
@ k_jof_bpp_max
Max bytes per pixel.
@ k_jof_max_dim
Max image width/height, pixels.
@ k_jof_max_tiles
Max tiles per atlas.
ra8_err_t(* jof_pread_fn)(void *ctx, uint64_t offset, uint8_t *buf, size_t len, size_t *got)
Positioned-read seam over an atlas backing store (DIP).
ra8_err_t jof_tile_dims(const jof_info_t *info, uint16_t tile_x, uint16_t tile_y, uint16_t *out_w, uint16_t *out_h)
Report the true (edge-clamped) pixel dimensions of one tile.
ra8_err_t jof_read_tile(jof_pread_fn pread, void *pread_ctx, const jof_info_t *info, uint16_t tile_x, uint16_t tile_y, uint8_t *scratch, uint32_t scratch_cap, uint8_t *out_px, uint32_t out_cap, uint16_t *out_w, uint16_t *out_h)
Read + decode one tile into caller pixels, in bounded RAM.
ra8_err_t jof_parse(jof_pread_fn pread, void *pread_ctx, uint64_t total_size, jof_info_t *out_info)
Parse + validate a JOF atlas's header, footer and index bounds.
jof_codec_t
Per-atlas tile codec selector (header byte 13).
@ k_jof_codec_deflate
Tile stream is one raw-DEFLATE run.
@ k_jof_codec_raw
Tile stream is the packed pixels.
uint32_t jof_stored_bound(uint32_t raw_bytes)
Worst-case stored-tile byte bound for scratch/cell sizing.
ra8_err_t jof_memstore_sink(void *ctx, const uint8_t *buf, size_t len)
Append len bytes to a jof_memstore_t (producer sink).
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Parsed + validated geometry of one JOF atlas.
uint8_t bpp
Bytes per pixel (1, 3 or 4).
uint8_t codec
jof_codec_t member.
uint16_t tile_w
Tile width, pixels.
uint16_t width
Image width, pixels.
uint32_t index_off
Absolute byte offset of the tile index.
uint16_t tile_rows
Ceil(height / tile_h) tile rows.
uint16_t tile_h
Tile height, pixels.
uint32_t tile_count
Total tiles (== cols * rows).
uint16_t height
Image height, pixels.
uint32_t total_size
Whole atlas byte length (footer included).
uint16_t tile_cols
Ceil(width / tile_w) tile columns.
Append-only memory store: the simplest atlas backing (RAM/SDRAM).
uint8_t * buf
Caller-owned backing bytes.
size_t cap
Capacity of buf.
size_t len
Bytes appended so far (see sink).