48 *out_row = (uint32_t)frame->
width * 3U;
52 if ((frame->
width & 1U) != 0U) {
55 *out_row = (uint32_t)frame->
width * 2U;
63 if (frame ==
nullptr) {
66 if (frame->
data ==
nullptr) {
69 if (frame->
width == 0U) {
76 if (frame->
bytes == 0U) {
84 uint32_t row_bytes = 0U;
117 if (source ==
nullptr) {
120 if (source->
iface ==
nullptr) {
135 if (out_info ==
nullptr) {
150 if (buffer ==
nullptr) {
153 if (out_frame ==
nullptr) {
161 if (buffer->
data ==
nullptr) {
172 if (out_frame->
data != buffer->
data) {
192 if (codec ==
nullptr) {
195 if (input ==
nullptr) {
198 if (output_buffer ==
nullptr) {
201 if (out_frame ==
nullptr) {
205 if (codec->
iface ==
nullptr) {
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
static ra8_err_t internal_source_validate(const ra8_camera_source_t *source)
Validate a source handle and its mandatory vtable rows.
ra8_err_t ra8_camera_frame_validate(const ra8_camera_frame_t *frame)
Validate the geometry and storage coverage of a frame view.
static ra8_err_t internal_frame_row_bytes(const ra8_camera_frame_t *frame, uint32_t *out_row)
Return the minimum bytes in one uncompressed row.
ra8_err_t ra8_camera_source_get_info(ra8_camera_source_t *source, ra8_camera_source_info_t *out_info)
Query a bound source's native output and capture-buffer bound.
ra8_err_t ra8_camera_source_capture(ra8_camera_source_t *source, const ra8_camera_buffer_t *buffer, ra8_camera_frame_t *out_frame)
Capture one frame into a caller-owned buffer.
ra8_err_t ra8_camera_codec_encode(ra8_camera_codec_t *codec, const ra8_camera_frame_t *input, const ra8_camera_buffer_t *output_buffer, ra8_camera_frame_t *out_frame)
Encode or transform one frame through a bound codec.
Transport-neutral camera source and image-codec facade.
@ k_ra8_camera_format_rgb888
Packed R, G, B bytes per pixel.
@ k_ra8_camera_format_uyvy422
Packed Cb, Y0, Cr, Y1 pixel pairs.
@ k_ra8_camera_format_jpeg
Complete encoded JPEG byte stream.
Private source and codec vtables for ra8_camera backends.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
@ k_ra8_err_invalid_size
Invalid size parameter (too large, too small, or misaligned).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Caller-owned writable byte-buffer description.
uint32_t capacity
Writable byte capacity.
uint8_t * data
First writable byte, or NULL when capacity is zero.
ra8_err_t(* encode)(void *ctx, const ra8_camera_frame_t *input, const ra8_camera_buffer_t *output_buffer, ra8_camera_frame_t *out_frame)
Produce one encoded frame.
Caller-owned handle binding one image codec and its context.
void * ctx
Caller-owned backend context.
const ra8_camera_codec_iface_t * iface
Bound codec vtable (private).
Immutable view of one captured or encoded image.
ra8_camera_format_t format
Pixel or compressed-image layout.
const uint8_t * data
Borrowed immutable image bytes.
uint32_t bytes
Valid bytes beginning at data.
uint16_t height
Image height in pixels.
uint16_t width
Image width in pixels.
uint32_t stride_bytes
Bytes between uncompressed rows.
ra8_err_t(* capture)(void *ctx, const ra8_camera_buffer_t *buffer, ra8_camera_frame_t *out_frame)
Capture one frame.
ra8_err_t(* get_info)(void *ctx, ra8_camera_source_info_t *out_info)
Query geometry.
Native geometry and worst-case storage required by a source.
Caller-owned handle binding one source backend and its context.
void * ctx
Caller-owned backend context.
const ra8_camera_source_iface_t * iface
Bound source vtable (private).