75static_assert(
sizeof(
ra8_glyph_key_t) ==
sizeof(uint32_t) +
sizeof(uint16_t) +
sizeof(uint16_t) +
76 sizeof(uint16_t) +
sizeof(uint16_t),
77 "ra8_glyph_key_t must be padding-free for byte-wise key comparison");
269 uint32_t* out_misses,
270 uint32_t* out_evictions);
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_glyph_atlas_put(ra8_glyph_atlas_t *atlas, const uint8_t *bitmap)
Release one pin on a glyph previously returned by ra8_glyph_atlas_get.
ra8_err_t(* ra8_glyph_render_fn)(void *ctx, const ra8_glyph_key_t *key, uint8_t *cell, uint32_t cell_bytes, uint16_t *out_w, uint16_t *out_h)
Rasterise a glyph into a cache cell (render-on-miss DIP seam).
ra8_err_t ra8_glyph_atlas_stats(const ra8_glyph_atlas_t *atlas, uint32_t *out_hits, uint32_t *out_misses, uint32_t *out_evictions)
Report the atlas hit / miss / eviction counters.
ra8_err_t ra8_glyph_atlas_get(ra8_glyph_atlas_t *atlas, const ra8_glyph_key_t *key, ra8_glyph_t *out_glyph)
Get (and pin) the rendered glyph for key.
ra8_err_t ra8_glyph_atlas_init(ra8_glyph_atlas_t *atlas, const ra8_glyph_atlas_cfg_t *cfg)
Initialise a glyph atlas over caller-supplied storage.
The one reusable hash + pin + evict cache engine (#147, #345).
Caller-supplied storage + renderer for ra8_glyph_atlas_init.
ra8_glyph_key_t * keys
cell_count key-storage entries.
uint32_t bucket_count
Number of hash buckets (>= 1).
ra8_glyph_render_fn render
Render-on-miss callback.
ra8_glyph_dims_t * dims
cell_count dimension descriptors.
uint32_t cell_count
Number of cells.
int32_t * buckets
bucket_count hash-bucket heads.
uint32_t cell_bytes
Bytes per cell (max glyph bitmap).
void * render_ctx
Opaque context passed to render.
uint8_t * cell_mem
cell_count * cell_bytes of bitmap storage.
ra8_keycache_cell_t * meta
cell_count link-metadata entries.
Glyph-cache state (caller-owned; treat as private).
ra8_glyph_render_fn render
Caller's glyph renderer.
void * render_ctx
Caller's renderer context.
ra8_keycache_t kc
Underlying keyed-LRU cache.
Per-cell user descriptor: the rendered glyph dimensions.
uint16_t w
Rendered glyph width in pixels.
uint16_t h
Rendered glyph height in pixels.
Identifies one rendered glyph.
uint16_t face_id
Font face identifier.
uint16_t mode
Render mode (AA / mono / hinting variant).
uint16_t size_px
Pixel size.
uint16_t reserved
Reserved; keep zero (padding-free byte-wise key).
uint32_t glyph_id
Font glyph index.
A pinned view of a cached glyph bitmap returned by ra8_glyph_atlas_get.
const uint8_t * bitmap
Glyph coverage bitmap (width*height bytes).
uint16_t height
Glyph height in pixels.
uint16_t width
Glyph width in pixels.
Per-cell link metadata (one caller-owned array entry per cell).
Cache engine state (caller-owned; treat as private).