24typedef enum : uint32_t {
29typedef enum : int32_t {
78 if (component > (int32_t)UINT8_MAX) {
81 return (uint8_t)component;
142 const uint32_t idx_180 =
145 uint8_t*
const outputs[4] = {
151 for (uint32_t output = 0U; output < 4U; output += 1U) {
152 outputs[output][0] = rgb.
red;
153 outputs[output][1] = rgb.
green;
154 outputs[output][2] = rgb.
blue;
171 for (uint32_t y = 0U; y < height; y += 1U) {
172 for (uint32_t x = 0U; x < width; x += 2U) {
173 const uint32_t source = ((y * width) + x) * 2U;
174 const uint8_t cb = uyvy[source];
175 const uint8_t y0 = uyvy[source + 1U];
176 const uint8_t cr = uyvy[source + 2U];
177 const uint8_t y1 = uyvy[source + 3U];
cam_image_yuv_coeff_t
BT.601 limited-range fixed-point YCbCr-to-RGB coefficients.
@ k_cam_yuv_red_cr
BT.601 red-from-Cr coefficient.
@ k_cam_yuv_blue_cb
BT.601 blue-from-Cb coefficient.
@ k_cam_yuv_luma_scale
BT.601 fixed-point luma coefficient.
@ k_cam_yuv_luma_black
Limited-range black luma code.
@ k_cam_yuv_chroma_mid
Neutral limited-range chroma code.
@ k_cam_yuv_shift
Fixed-point fractional-bit count.
@ k_cam_yuv_green_cb
BT.601 green-from-Cb coefficient.
@ k_cam_yuv_green_cr
BT.601 green-from-Cr coefficient.
@ k_cam_yuv_rounding
Fixed-point rounding bias.
ra8_err_t cam_image_generate(const uint8_t *uyvy, uint32_t source_bytes)
Convert one packed Cb-Y0-Cr-Y1 VGA frame into all four RGB views.
static void cam_image_convert(const uint8_t *uyvy)
Convert one complete UYVY frame into all four RGB orientations.
static ra8_err_t cam_image_clean_outputs(void)
Clean all generated RGB views from the data cache.
static void cam_image_scatter(uint32_t x, uint32_t y, cam_rgb_t rgb)
Write one RGB pixel to all four rotated row-major destinations.
static uint8_t cam_image_clamp(int32_t component)
Clamp a signed RGB component to one byte.
cam_image_align_t
Cache-line alignment shared by the SDRAM buffers and cache API.
@ k_cam_image_cache_line_bytes
Cortex-M85 data-cache line size.
static cam_rgb_t cam_image_ycbcr_to_rgb(uint8_t y, uint8_t cb, uint8_t cr)
Convert one limited-range YCbCr pixel to RGB888.
SDRAM-backed RGB888 views of one packed VGA UYVY camera frame.
@ k_cam_uyvy_frame_bytes
640 x 480 x 2-byte packed UYVY input.
@ k_cam_image_height_px
Unrotated and 180-degree height.
@ k_cam_image_width_px
Unrotated and 180-degree width.
@ k_cam_rgb_frame_bytes
640 x 480 x 3 bytes.
@ k_cam_rgb_bytes_per_px
RGB888 bytes per output pixel.
const uint32_t g_cam_rgb_frame_bytes
Stable byte count of each exported RGB888 buffer.
uint8_t g_cam_rgb_180[k_cam_rgb_frame_bytes]
Clockwise-180-degree 640x480 RGB888 image in external SDRAM.
uint8_t g_cam_rgb_90[k_cam_rgb_frame_bytes]
Clockwise-90-degree 480x640 RGB888 image in external SDRAM.
uint8_t g_cam_rgb_0[k_cam_rgb_frame_bytes]
Unrotated 640x480 RGB888 image in external SDRAM.
uint8_t g_cam_rgb_270[k_cam_rgb_frame_bytes]
Clockwise-270-degree 480x640 RGB888 image in external SDRAM.
Cortex-M85 L1 cache maintenance, enable/disable, and I-cache invalidate.
ra8_err_t ra8_cache_dcache_clean_by_addr(const void *addr, uint32_t size)
Clean (write back) the D-cache lines covering a byte range.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_RETURN_ON_ERROR(err, tag, message)
Early return on error, propagating the code upward.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
@ k_ra8_err_invalid_arg
Invalid function argument.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
One RGB888 pixel used while scattering the four orientations.
uint8_t red
Red RGB888 component.
uint8_t blue
Blue RGB888 component.
uint8_t green
Green RGB888 component.