34typedef enum : uint32_t {
66 const size_t flat = ((size_t)y * (size_t)src_w) + (
size_t)x;
67 const uint8_t
byte = src[flat >> 1U];
97 for (int32_t dy = 0; dy < zoom; ++dy) {
98 for (int32_t dx = 0; dx < zoom; ++dx) {
118 if (src ==
nullptr) {
124 if ((src_w <= 0) || (src_h <= 0)) {
130 const int32_t x_lo = (sx > 0) ? sx : 0;
131 const int32_t y_lo = (sy > 0) ? sy : 0;
132 const int32_t x_hi = ((sx + sw) < src_w) ? (sx + sw) : src_w;
133 const int32_t y_hi = ((sy + sh) < src_h) ? (sy + sh) : src_h;
134 for (int32_t py = y_lo; py < y_hi; ++py) {
135 const int32_t by = dst_y + ((py - sy) * zoom);
136 for (int32_t px = x_lo; px < x_hi; ++px) {
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
@ 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.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Software 2D graphics primitives layered on top of a caller-ownedframebuffer (DRW / D/AVE 2D / GLCDC r...
static void internal_gray4_block(int32_t bx, int32_t by, int32_t zoom, uint32_t color)
Fill the zoom x zoom framebuffer block at (bx, by) with color.
ra8_err_t ra8_gfx_blit_gray4_zoom(const uint8_t *src, int32_t src_w, int32_t src_h, int32_t sx, int32_t sy, int32_t sw, int32_t sh, int32_t zoom, int32_t dst_x, int32_t dst_y)
Nearest-neighbour integer-zoom blit of a sub-rectangle of a packed 4-bit grayscale image into the fra...
static uint32_t internal_gray4_color(const uint8_t *src, int32_t src_w, int32_t x, int32_t y)
Expand the packed gray4 pixel at (x, y) to a 0x00RRGGBB gray colour.
ra8_gfx_g4_const_t
Nibble-unpack + gray-to-colour expansion constants for the gray4 blit.
@ k_ra8_g4_rgb_r_sh
Red shift of the 0x00RRGGBB gray expand.
@ k_ra8_g4_rgb_g_sh
Green shift of the 0x00RRGGBB gray expand.
@ k_ra8_g4_nib_sh
Nibble shift (and the 4->8-bit replicate).
@ k_ra8_g4_nib_lo
Low-nibble mask.
Module-private declarations shared across the ra8_gfx software rasteriser TUs.
ra8_gfx_state_t g_gfx_text_state
Single module-wide framebuffer binding shared by every ra8_gfx TU.
void priv_gfx_text_plot(int32_t x, int32_t y, uint32_t color)
Plot a single pixel with bounds checking against the active clip.