138 uint32_t frame_bytes,
271 uint32_t out_stride);
308 uint32_t chapter_idx,
Flat, execute-in-place container for a build-time "compiled" e-book.
ra8_err_t book_src_paged(book_src_t *out, ra8_vmem_t *vm, uint32_t object_id, uint32_t frame_bytes, uint32_t size)
Bind a paged book source over an ra8_vmem cache + ra8_vsource object.
ra8_err_t book_src_image_rect(const book_src_t *src, const book_image_t *img, uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint8_t *out, uint32_t out_stride)
Read a sub-rectangle of a raster image (4bpp or 8bpp) as gray8, row by row.
ra8_err_t book_src_prefetch_chapter(const book_src_t *src, uint32_t chapter_idx)
Warm the cache frame holding a chapter's first content bytes, without pinning it (single-threaded rea...
ra8_err_t book_src_resident(book_src_t *out, const void *base, uint32_t size)
Bind a resident (already-inflated, fully resident) book as a source.
ra8_err_t book_src_image(const book_src_t *src, uint32_t idx, book_image_t *out_img)
Read one image descriptor out of a book source (resident or paged).
ra8_err_t book_src_read(const book_src_t *src, uint32_t off, void *dst, uint32_t len)
Copy a byte range out of a book source (resident memcpy or paged fault).
ra8_err_t book_chapter_text_src(const book_src_t *src, uint32_t chapter_idx, char *out, size_t cap, size_t *out_len)
Extract one chapter's plain text from a book source (resident or paged).
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Byte-range page cache with SLRU eviction (Layer 2, #147).
Descriptor for one transcoded image in the image pool.
A book data source: resident (zero-copy) or paged (demand-fetched).
book_header_t hdr
Resident copy of the blob header.
uint32_t size
Total blob length in bytes.
const uint8_t * base
Resident blob base, or NULL in paged mode.
uint32_t frame_bytes
Paged: ra8_vmem frame size, for slice math.
ra8_vmem_t * vm
Paged page cache, or NULL in resident mode.
uint32_t object_id
Paged: the book's ra8_vsource object id.
Page-cache state (caller-owned; treat as private).