|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Single-image to JOF worker: the per-page transcode the cbz2jof Go driver shells out to. More...
Go to the source code of this file.
Enumerations | |
| enum | jof_worker_result_t : int { k_jof_worker_ok = 0 , k_jof_worker_usage = 1 , k_jof_worker_input = 2 , k_jof_worker_output = 3 , k_jof_worker_geometry = 4 , k_jof_worker_decode = 5 , k_jof_worker_memory = 6 } |
| Process exit code contract between the worker and its Go driver. More... | |
Functions | |
| jof_worker_result_t | jof_worker_convert (const char *in_path, const char *out_path) |
| Transcode one encoded image file into one JOF atlas file. | |
Single-image to JOF worker: the per-page transcode the cbz2jof Go driver shells out to.
The Go layer owns archive policy (CBZ entry selection, limits, atomic page publication); this worker owns pixels. It reads one encoded JPEG, PNG, or WebP source file through the firmware's own jof_produce() pipeline and writes one JOF band-tile atlas, so a page converted here is byte-identical to one the RA8 would produce from the same source bytes.
[Ring 4 / Domain] {World: NS}
Definition in file jof_worker.h.
| enum jof_worker_result_t : int |
Process exit code contract between the worker and its Go driver.
Explicitly sized so the ok=0 .. memory=6 mapping below is the ABI, not a compiler choice. ok is zero so the shell idiom if (rc) treats any failure as true.
Definition at line 33 of file jof_worker.h.
|
nodiscard |
Transcode one encoded image file into one JOF atlas file.
Opens and bounds-checks the input, probes its dimensions, sizes the exact jof_work_bytes() / jof_webp_work_bytes() arenas for them, runs jof_produce() with a full-width band tile (tile_w == width, tile_h == min(height, 256)), and closes the output. On any failure the output path is closed and removed, so no torn atlas is left behind; cleanup failure never masks the primary error.
| [in] | in_path | Encoded source image (JPEG, PNG, or WebP). |
| [in] | out_path | Destination JOF atlas (created/truncated). |
| k_jof_worker_ok | Atlas fully written to the output path. |
| k_jof_worker_usage | Wrong argument count or null path. |
| k_jof_worker_input | Input open/stat/read failed or was refused. |
| k_jof_worker_output | Output open/write/close failed. |
| k_jof_worker_geometry | Source dimensions unusable or unproduceable. |
| k_jof_worker_decode | Source is hostile or an unsupported variant. |
| k_jof_worker_memory | A bounded work arena could not be allocated. |
in_path and out_path are non-NULL NUL-terminated paths. in_path points to an existing readable file. out_path holds one complete JOF atlas. out_path does not exist. Definition at line 410 of file jof_worker.c.
References jof_probe_dims(), jof_work_bytes(), jof_worker_convert(), k_jof_worker_geometry, k_jof_worker_memory, k_jof_worker_ok, k_jof_worker_usage, k_ra8_ok, k_worker_tile_h, worker_alloc_webp(), worker_produce_to_file(), and worker_read_source().
Referenced by jof_worker_convert(), and main().