|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Caller-owned temporary buffers the pipeline stage needs. More...
#include <ra8_rabook_pipeline.h>
Data Fields | |
| uint8_t * | xhtml |
| Chapter XHTML scratch buffer. | |
| size_t | xhtml_cap |
Capacity of xhtml in bytes. | |
| uint8_t * | image_raw |
| Raw encoded cover/image byte buffer. | |
| size_t | image_cap |
Capacity of image_raw in bytes. | |
| ra8_img_arena_t * | img_arena |
| stb_image bump arena (caller-sized scratch). | |
| uint8_t * | gray |
| Intermediate gray-pixel downscale buffer. | |
| uint32_t | gray_cap |
Capacity of gray in pixels (bytes). | |
| char * | css |
| Stylesheet load scratch (NUL-terminated). | |
| size_t | css_cap |
Capacity of css in bytes. | |
| bool | skip_images |
| Drop all images (text/CSS-only). | |
| uint16_t | max_image_edge |
| Opt-in downscale clamp on the longer edge in pixels; 0 (the zero-init default) preserves source resolution (full-res manga for the zoom loupe). | |
| uint8_t | pixel_format |
| Device profile: raster depth to emit, book_image_pixfmt_t. | |
| ra8_rabook_xml_workspace_t * | xml_workspace |
| Caller-owned XHTML parser state. | |
Caller-owned temporary buffers the pipeline stage needs.
All buffer fields must be set to valid, non-NULL pointers with the capacities large enough for the book being compiled. The pipeline never allocates; it writes only into these buffers and the builder arenas inside ra8_rabook_buffers_t.
skip_images (default false): when true the image stage is a no-op – no image-table entries are added and the cover index stays nil, so the blob is text/CSS-only. It is the on-device equivalent of the desktop epub_compile.py --no-images option (its empty manifest.items() image loop), and yields a blob byte-identical to that desktop --no-images golden. Stylesheets, chapters and metadata are unaffected. The image_raw / img_arena / gray buffers may stay tiny when skip_images is true.
pixel_format (default 0 == k_book_pixfmt_gray4) is the device profile that selects the raster depth: 4-bpp packed grayscale for an even 16-level e-ink panel, or k_book_pixfmt_gray8 for the lossless 8-bpp source on a deeper panel. It only affects raster transcode; SVG, stylesheets, chapters and metadata are unaffected.
xhtml, image_raw, gray and the img_arena backing store do not overlap. The transcode stage reuses image_raw in place as the encode output (4-bpp nibbles or the 8-bpp copy) while the decoded source pixels are still live in img_arena (and gray on the downscale path), so an aliased buffer would corrupt the still-live source. image_raw is overwritten with the encoded output while img_arena / gray still hold the pixels being read. Definition at line 110 of file ra8_rabook_pipeline.h.
| char* ra8_rabook_pipeline_scratch_t::css |
Stylesheet load scratch (NUL-terminated).
Definition at line 118 of file ra8_rabook_pipeline.h.
Referenced by internal_compile_stylesheets().
| size_t ra8_rabook_pipeline_scratch_t::css_cap |
Capacity of css in bytes.
Definition at line 119 of file ra8_rabook_pipeline.h.
Referenced by internal_compile_stylesheets().
| uint8_t* ra8_rabook_pipeline_scratch_t::gray |
Intermediate gray-pixel downscale buffer.
Definition at line 116 of file ra8_rabook_pipeline.h.
Referenced by internal_downscale_if_needed().
| uint32_t ra8_rabook_pipeline_scratch_t::gray_cap |
Capacity of gray in pixels (bytes).
Definition at line 117 of file ra8_rabook_pipeline.h.
Referenced by internal_downscale_if_needed().
| size_t ra8_rabook_pipeline_scratch_t::image_cap |
Capacity of image_raw in bytes.
Definition at line 114 of file ra8_rabook_pipeline.h.
Referenced by internal_add_manifest_image(), and internal_encode_gray().
| uint8_t* ra8_rabook_pipeline_scratch_t::image_raw |
Raw encoded cover/image byte buffer.
Definition at line 113 of file ra8_rabook_pipeline.h.
Referenced by internal_add_manifest_image(), internal_encode_gray(), and internal_transcode_image().
| ra8_img_arena_t* ra8_rabook_pipeline_scratch_t::img_arena |
stb_image bump arena (caller-sized scratch).
Definition at line 115 of file ra8_rabook_pipeline.h.
Referenced by internal_transcode_image().
| uint16_t ra8_rabook_pipeline_scratch_t::max_image_edge |
Opt-in downscale clamp on the longer edge in pixels; 0 (the zero-init default) preserves source resolution (full-res manga for the zoom loupe).
Mirrors the desktop tool's opt-in --max-edge knob.
Definition at line 121 of file ra8_rabook_pipeline.h.
Referenced by internal_transcode_image().
| uint8_t ra8_rabook_pipeline_scratch_t::pixel_format |
Device profile: raster depth to emit, book_image_pixfmt_t.
0 (the zero-init default) is k_book_pixfmt_gray4 – the 4-bpp packing a grayscale panel wants; k_book_pixfmt_gray8 keeps the lossless 8-bpp source for a deeper panel.
Definition at line 126 of file ra8_rabook_pipeline.h.
Referenced by internal_encode_gray(), and internal_transcode_image().
| bool ra8_rabook_pipeline_scratch_t::skip_images |
Drop all images (text/CSS-only).
See below.
Definition at line 120 of file ra8_rabook_pipeline.h.
Referenced by internal_compile_images().
| uint8_t* ra8_rabook_pipeline_scratch_t::xhtml |
Chapter XHTML scratch buffer.
Definition at line 111 of file ra8_rabook_pipeline.h.
Referenced by internal_compile_chapters().
| size_t ra8_rabook_pipeline_scratch_t::xhtml_cap |
Capacity of xhtml in bytes.
Definition at line 112 of file ra8_rabook_pipeline.h.
Referenced by internal_compile_chapters().
| ra8_rabook_xml_workspace_t* ra8_rabook_pipeline_scratch_t::xml_workspace |
Caller-owned XHTML parser state.
Definition at line 133 of file ra8_rabook_pipeline.h.
Referenced by internal_compile_chapters(), and priv_rabook_pipeline_check_common().