54typedef enum : uint16_t {
70typedef enum : uint8_t {
81typedef enum : uint8_t {
349[[nodiscard]] uint32_t
mg_fnv1a(
const void* buf, uint32_t len);
JOF band-tile atlas: the display-native normalized image format (#231, shared with the longstrip scro...
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).
bool mg_reader_tap(mg_reader_t *r, int32_t x, int32_t y)
Apply a tap: pan or toggle zoom, and report whether state changed.
ra8_err_t mg_tile_decode(void *ctx, const ra8_tile_key_t *key, uint8_t *cell, uint32_t cell_bytes, uint16_t *out_w, uint16_t *out_h)
Tile-cache decode-on-miss callback: page one atlas tile into a cell.
ra8_err_t mg_reader_status(const mg_reader_t *r, char *buf, uint32_t cap)
Format the status-bar string ("MANGA 1:1 x=.. y=..").
mg_zone_t mg_zone_hit(const mg_reader_t *r, int32_t x, int32_t y)
Classify a panel coordinate into its tap-zone.
uint32_t mg_fnv1a(const void *buf, uint32_t len)
FNV-1a-32 over a byte buffer (framebuffer render hash for the banner).
mg_zone_t
The tap-zone a panel coordinate falls in (mg_zone_hit result).
@ k_mg_zone_pan_up
Top edge band: slide viewport up.
@ k_mg_zone_zoom
Centre: toggle 1:1 <-> fit-page.
@ k_mg_zone_pan_left
Left edge band: slide left.
@ k_mg_zone_pan_right
Right edge band: slide right.
@ k_mg_zone_none
Outside every actionable zone.
@ k_mg_zone_pan_down
Bottom edge band: slide down.
ra8_err_t mg_reader_prefetch(mg_reader_t *r)
Warm the tiles one step ahead of the last pan (predictive prefetch).
ra8_err_t mg_reader_render(mg_reader_t *r)
Render the current viewport + chrome into the framebuffer.
mg_layout_t
Fixed chrome + navigation geometry, in panel/page pixels.
@ k_mg_minimap_h
Minimap overlay height, panel px.
@ k_mg_edge_band
Edge pan tap-zone thickness, panel px.
@ k_mg_minimap_w
Minimap overlay width, panel px.
@ k_mg_pan_step
Viewport slide per edge tap, page px.
@ k_mg_statusbar_h
Top status-bar band height, panel px.
@ k_mg_minimap_in
Minimap interior inset, px.
@ k_mg_minimap_pad
Minimap inset from the panel edge, px.
mg_zoom_t
The two zoom states cycled by a centre tap.
@ k_mg_zoom_fit
Fit-page – whole page decimated to the panel.
@ k_mg_zoom_full
1:1 – one page pixel per panel pixel; panned.
ra8_err_t mg_reader_init(mg_reader_t *r, const mg_reader_cfg_t *cfg)
Bind a viewer to a produced atlas and reset it to 1:1 top-left.
bool mg_reader_toggle_zoom(mg_reader_t *r)
Toggle the zoom between 1:1 and fit-page (SW-button entry point).
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Fixed-RAM-budget image-tile cache with LRU eviction (Layer 3b, #147).
ra8_tile_pan_dir_t
Direction of viewport travel, for predictive pan prefetch.
Parsed + validated geometry of one JOF atlas.
Everything mg_reader_init needs to bind a viewer to a page.
uint16_t * fb
RGB565 framebuffer (panel).
const jof_info_t * info
Parsed atlas geometry.
ra8_tile_cache_t * cache
Tile cache over the atlas.
int32_t fb_h
Framebuffer height, pixels.
uint32_t image_id
Tile-cache key image id.
int32_t fb_w
Framebuffer width, pixels.
Viewer state: the page geometry plus the current viewport + zoom.
int32_t view_x
Viewport left in page px (1:1 anchor).
int32_t view_y
Viewport top in page px (1:1 anchor).
uint32_t image_id
Tile-cache key image id.
int32_t fb_w
Framebuffer width, pixels.
uint16_t tile_h
Atlas tile height, pixels.
uint8_t fit_factor
Decimation factor for fit-page (>= 1).
uint16_t tile_w
Atlas tile width, pixels.
uint16_t page_h
Full page height, pixels.
uint16_t * fb
RGB565 panel framebuffer.
int32_t fb_h
Framebuffer height, pixels.
uint16_t page_w
Full page width, pixels.
ra8_tile_cache_t * cache
Tile cache paging the atlas.
uint8_t zoom
Current mg_zoom_t.
uint16_t tile_cols
Atlas tile columns.
uint16_t tile_rows
Atlas tile rows.
ra8_tile_pan_dir_t last_pan
Last pan direction (mg_reader_prefetch seed).
Decode-on-miss context bound into the tile cache (DIP seam).
const jof_info_t * info
Parsed atlas geometry.
jof_pread_fn pread
Atlas positioned-read seam.
uint8_t * scratch
Deflate stored-stream staging.
void * pread_ctx
Context for pread.
uint32_t scratch_cap
Capacity of scratch.
Tile-cache state (caller-owned; treat as private).
Identifies one decoded image tile.