ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_rabook_comic.h
Go to the documentation of this file.
1
20#pragma once
21
22#include <stddef.h>
23#include <stdint.h>
24
25#include "ra8_err.h"
26#include "ra8_rabook_raster.h"
27#include "rabook_compile.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
34typedef enum : uint16_t {
37
54 uint32_t offset,
55 const uint8_t* source,
56 uint32_t requested,
57 uint32_t* out_written);
58
66typedef struct {
67 const char* title;
68 const char* author;
69 const char* language;
70 const char* identifier;
72
92
117
141 const ra8_rabook_comic_workspace_t* workspace,
142 ra8_rabook_image_read_fn image_read,
144 void* image_ctx,
145 uint16_t max_image_edge,
146 uint8_t pixel_format);
147
169 const char* page_id,
170 const uint8_t* source,
171 size_t source_size);
172
194 const ra8_rabook_comic_metadata_t* metadata,
196 void* write_ctx,
197 uint32_t* out_len);
198
199#ifdef __cplusplus
200} /* extern "C" */
201#endif
-proof
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t ra8_rabook_comic_init(ra8_rabook_comic_t *comic, const ra8_rabook_comic_workspace_t *workspace, ra8_rabook_image_read_fn image_read, ra8_rabook_comic_write_at_fn image_write, void *image_ctx, uint16_t max_image_edge, uint8_t pixel_format)
Initialize one bounded streaming comic builder.
ra8_err_t(* ra8_rabook_comic_write_at_fn)(void *ctx, uint32_t offset, const uint8_t *source, uint32_t requested, uint32_t *out_written)
Write normalized image bytes at one logical spool offset.
ra8_err_t ra8_rabook_comic_add_page(ra8_rabook_comic_t *comic, const char *page_id, const uint8_t *source, size_t source_size)
Normalize and append one source image as one comic chapter.
ra8_err_t ra8_rabook_comic_finish(ra8_rabook_comic_t *comic, const ra8_rabook_comic_metadata_t *metadata, ra8_rabook_write_fn write, void *write_ctx, uint32_t *out_len)
Finalize the completed comic as one canonical flat RABOOK1 stream.
ra8_rabook_comic_limit_t
Bounded string dimensions accepted by the comic facade.
@ k_ra8_rabook_comic_string_max
Bytes including the terminating NUL.
Caller-arena raster normalizer for RABOOK image records.
Zero-heap builder that emits a RABOOK1 blob (the #149 compiler back-end).
ra8_err_t(* ra8_rabook_image_read_fn)(void *ctx, uint32_t offset, uint8_t *dst, uint32_t requested, uint32_t *out_read)
Read bytes from an externally stored image pool.
ra8_err_t(* ra8_rabook_write_fn)(void *ctx, const uint8_t *src, uint32_t requested, uint32_t *out_written)
Append bytes to a streaming RABOOK1 destination.
Caller-owned, fixed-capacity arenas the builder appends into (no heap).
Header metadata interned when the comic is finalized.
const char * title
Human-readable book title.
const char * author
Human-readable author or source.
const char * identifier
Stable book identifier.
const char * language
BCP-47 language spelling.
Mutable state for one image-sequence-to-RABOOK build.
void * image_ctx
Shared image-spool context.
uint8_t * normalized
One normalized page payload.
uint8_t pixel_format
Gray4 or gray8 output depth.
uint16_t max_image_edge
Optional output edge clamp.
uint32_t page_count
Successfully appended pages.
uint8_t * stream_scratch
Finalizer transfer scratch.
uint32_t stream_scratch_cap
Finalizer scratch capacity.
bool active
Build accepts more operations.
size_t normalized_cap
Normalized output capacity.
ra8_rabook_raster_workspace_t raster
Retained raster workspace.
ra8_rabook_ctx_t builder
Canonical table builder.
ra8_rabook_image_read_fn image_read
Repeatable image-spool reader.
ra8_rabook_comic_write_at_fn image_write
Image-spool random writer.
Caller-owned arenas retained for one streaming comic build.
uint8_t * stream_scratch
Finalizer transfer scratch.
size_t normalized_cap
Writable normalized bytes.
uint8_t * normalized
One normalized page payload.
uint32_t stream_scratch_cap
Finalizer scratch bytes.
ra8_rabook_raster_workspace_t raster
Codec and scaling arenas.
ra8_rabook_buffers_t builder
Resident table/string arenas.
Builder state: the arenas plus running counts and a sticky-fail flag.
Exclusive caller-owned scratch used by one raster conversion.