ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_gfx_dither.h
Go to the documentation of this file.
1
45
46#pragma once
47
48#include <stdint.h>
49
50#include "ra8_err.h"
51
79
93
130uint8_t ra8_gfx_dither_gray4_level(uint8_t gray8, int32_t x, int32_t y);
131
172[[nodiscard]] ra8_err_t ra8_gfx_dither_gray8_to_gray4(const uint8_t* src,
173 int32_t w,
174 int32_t h,
175 int32_t origin_x,
176 int32_t origin_y,
177 uint8_t* out,
178 uint32_t out_cap,
179 uint32_t* out_size);
180
216[[nodiscard]] ra8_err_t
217ra8_gfx_blit_gray8_dither(const uint8_t* src, int32_t w, int32_t h, int32_t dst_x, int32_t dst_y);
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
ra8_gfx_dither_scale_t
Fixed-point scales for the unbiased threshold comparison.
@ k_ra8_gfx_dither_mask_len
Mask entry count (mask_dim * mask_dim).
@ k_ra8_gfx_dither_byte_levels
Threshold texture depth (mask range +1).
ra8_gfx_dither_const_t
16-level palette, packing, and blue-noise mask geometry constants.
@ k_ra8_gfx_dither_levels
Panel gray levels (4 bpp).
@ k_ra8_gfx_dither_nib_shift
High-nibble shift (packing + gray8 expand).
@ k_ra8_gfx_dither_ppb
Pixels packed per output byte.
@ k_ra8_gfx_dither_step
Palette step 255/15; also the 4->8 replicate.
@ k_ra8_gfx_dither_mask_index_mask
Toroidal index bitmask (mask_dim - 1).
@ k_ra8_gfx_dither_mask_dim
Blue-noise mask edge (power of two).
@ k_ra8_gfx_dither_rgb_r_shift
Red shift of the 0x00RRGGBB gray expand.
@ k_ra8_gfx_dither_max_level
Maximum 4-bit level.
@ k_ra8_gfx_dither_rgb_g_shift
Green shift of the 0x00RRGGBB gray expand.
ra8_err_t ra8_gfx_blit_gray8_dither(const uint8_t *src, int32_t w, int32_t h, int32_t dst_x, int32_t dst_y)
Blit a gray8 image into the bound framebuffer, blue-noise dithered.
uint8_t ra8_gfx_dither_gray4_level(uint8_t gray8, int32_t x, int32_t y)
Quantise one gray8 sample to a 4-bit panel level via the blue-noise mask.
ra8_err_t ra8_gfx_dither_gray8_to_gray4(const uint8_t *src, int32_t w, int32_t h, int32_t origin_x, int32_t origin_y, uint8_t *out, uint32_t out_cap, uint32_t *out_size)
Dither a gray8 tile to packed 4-bpp nibbles (panel-native), seamlessly.