ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_rabook_raster.h
Go to the documentation of this file.
1
19#pragma once
20
21#include <stddef.h>
22#include <stdint.h>
23
24#include "book.h"
25#include "ra8_err.h"
26#include "ra8_img_arena.h"
27#include "ra8_webp_arena.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
53
59typedef struct {
60 uint32_t encoded_size;
61 uint16_t width;
62 uint16_t height;
63 uint8_t pixel_format;
65
98[[nodiscard]] ra8_err_t ra8_rabook_raster_encode(const uint8_t* source,
99 size_t source_size,
100 uint16_t max_edge,
101 uint8_t pixel_format,
103 uint8_t* encoded,
104 size_t encoded_cap,
106
107#ifdef __cplusplus
108} /* extern "C" */
109#endif
Flat, execute-in-place container for a build-time "compiled" e-book.
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
Heap-free scratch allocator hooks for the stb_image single-TU build.
ra8_err_t ra8_rabook_raster_encode(const uint8_t *source, size_t source_size, uint16_t max_edge, uint8_t pixel_format, ra8_rabook_raster_workspace_t *workspace, uint8_t *encoded, size_t encoded_cap, ra8_rabook_raster_result_t *result)
Decode and normalize one encoded raster into a RABOOK image payload.
Heap-free scratch allocator hooks for the vendored libwebp decoder.
Caller-owned bump arena backing a single image decode.
Geometry and byte count of a normalized RABOOK raster payload.
uint16_t height
Output height in pixels.
uint32_t encoded_size
Bytes written to the encoded destination.
uint8_t pixel_format
book_image_pixfmt_t emitted.
uint16_t width
Output width in pixels.
Exclusive caller-owned scratch used by one raster conversion.
size_t gray_cap
Capacity of gray in bytes.
uint8_t * rgba
WebP RGBA frame storage.
uint8_t * gray
Downscaled grayscale storage.
ra8_webp_arena_t * webp_arena
WebP decoder scratch arena.
ra8_img_arena_t * stb_arena
JPEG/PNG/GIF/BMP decoder arena.
size_t rgba_cap
Capacity of rgba in bytes.
Caller-owned bump arena backing a single WebP decode.