|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Private source-image to RBKC formatter for the media app. More...
#include <stddef.h>#include <stdint.h>#include "ra8_attributes.h"#include "ra8_err.h"#include "ra8_rabook_comic.h"#include "ra8_rabook_container.h"Go to the source code of this file.
Data Structures | |
| struct | media_download_format_config_t |
| Immutable policy for one fetched-image conversion. More... | |
| struct | media_download_format_workspace_t |
| Complete caller-owned storage for image-to-RBKC conversion. More... | |
| struct | media_download_memory_t |
| Mutable bounds for one formatter-owned in-memory spool. More... | |
Functions | |
| ra8_err_t | priv_media_download_memory_write_at (media_download_memory_t *memory, uint64_t offset, const uint8_t *source, uint32_t requested, uint32_t *written) |
| Write one exact span at an absolute private-spool offset. | |
| ra8_err_t | priv_media_download_memory_read (void *context, uint32_t offset, uint8_t *destination, uint32_t requested, uint32_t *out_read) |
| Read one exact initialized range from a private spool. | |
| ra8_err_t | priv_media_download_format_rabook (const uint8_t *source, size_t source_size, const media_download_format_config_t *config, media_download_format_workspace_t *workspace, uint64_t *packed_size) |
| Format one encoded source image as a reader-native .rabook. | |
Private source-image to RBKC formatter for the media app.
Declares the caller-workspace contract that lets the RA8 normalize one fetched image into a reader-native RABOOK1 book and wrap it as the chunked RBKC .rabook artifact saved by the application.
Definition in file media_download_format_internal.h.
|
nodiscard |
Format one encoded source image as a reader-native .rabook.
| [in] | source | Complete encoded JPEG, PNG, GIF, BMP, or WebP bytes. |
| [in] | source_size | Exact encoded byte count. |
| [in] | config | Page, book, raster, and chunk policy. |
| [in,out] | workspace | Exclusive caller-owned conversion storage. |
| [out] | packed_size | Exact RBKC artifact byte count. |
| k_ra8_ok | A complete RBKC artifact occupies workspace->packed. |
| k_ra8_err_null_ptr | A required pointer or workspace span is NULL. |
| k_ra8_err_invalid_size | A capacity, source, or callback extent failed. |
source is disjoint from every mutable workspace span. packed_size bytes of packed storage. packed_size to zero and publishes no external object. Definition at line 234 of file media_download_format.c.
References media_download_format_config_t::chunk_bytes, media_download_format_workspace_t::comic, media_download_format_workspace_t::container, media_download_format_workspace_t::flat, media_download_format_workspace_t::flat_cap, media_download_format_workspace_t::image, media_download_format_workspace_t::image_cap, internal_flat_append(), internal_image_write(), internal_packed_write(), internal_validate_format_request(), k_ra8_err_validation_failed, k_ra8_ok, media_download_memory_t::length, media_download_format_config_t::max_image_edge, media_download_format_config_t::metadata, media_download_format_workspace_t::packed, media_download_format_workspace_t::packed_cap, media_download_format_config_t::page_id, media_download_format_config_t::pixel_format, priv_media_download_memory_read(), RA8_PRIV, ra8_rabook_comic_add_page(), ra8_rabook_comic_finish(), ra8_rabook_comic_init(), and ra8_rabook_container_write().
Referenced by internal_format().
|
nodiscard |
Read one exact initialized range from a private spool.
| [in] | context | Bound media_download_memory_t source. |
| [in] | offset | Absolute source offset. |
| [out] | destination | Writable destination span. |
| [in] | requested | Exact byte count. |
| [out] | out_read | Copied byte count. |
| k_ra8_ok | The complete range was copied. |
| k_ra8_err_null_ptr | A required pointer was NULL. |
| k_ra8_err_invalid_size | The requested range exceeded initialized bytes. |
requested and initializes the destination range. out_read is available and preserves source state. Definition at line 53 of file media_download_format.c.
References media_download_memory_t::bytes, k_ra8_err_invalid_size, k_ra8_err_null_ptr, k_ra8_ok, media_download_memory_t::length, memcpy(), and RA8_PRIV.
Referenced by priv_media_download_format_rabook().
|
nodiscard |
Write one exact span at an absolute private-spool offset.
| [in,out] | memory | Destination spool. |
| [in] | offset | Absolute destination offset. |
| [in] | source | Complete source span. |
| [in] | requested | Exact byte count. |
| [out] | written | Accepted byte count. |
| k_ra8_ok | The complete span was copied. |
| k_ra8_err_null_ptr | A required pointer was NULL. |
| k_ra8_err_invalid_size | The requested range exceeded capacity. |
requested and extends length monotonically. written is available and preserves length. Definition at line 20 of file media_download_format.c.
References media_download_memory_t::bytes, media_download_memory_t::capacity, k_ra8_err_invalid_size, k_ra8_err_null_ptr, k_ra8_ok, media_download_memory_t::length, memcpy(), and RA8_PRIV.
Referenced by internal_flat_append(), internal_image_write(), and internal_packed_write().