39typedef enum : uint8_t {
49typedef enum : uint16_t {
198ra8_gfx_blit_gray8(
const uint8_t* src, int32_t w, int32_t h, int32_t dst_x, int32_t dst_y);
278ra8_gfx_line(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint32_t color);
298ra8_gfx_rect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color,
bool filled);
319ra8_gfx_circle(int32_t cx, int32_t cy, int32_t r, uint32_t color,
bool filled);
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_gfx_circle(int32_t cx, int32_t cy, int32_t r, uint32_t color, bool filled)
Draw a circle using midpoint algorithm.
ra8_gfx_format_t
Pixel format of the framebuffer bound by ra8_gfx_init().
@ k_ra8_gfx_format_rgb565
16-bit RGB565, little-endian in memory.
@ k_ra8_gfx_format_argb8888
32-bit ARGB, A in MSB.
@ k_ra8_gfx_format_rgb888
24-bit packed R,G,B bytes.
ra8_err_t ra8_gfx_line(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint32_t color)
Draw a line from (x0,y0) to (x1,y1) with Bresenham's algorithm.
ra8_err_t ra8_gfx_reset_clip(void)
Reset the clip rectangle to the whole framebuffer.
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...
ra8_err_t ra8_gfx_blit(const void *src_buf, uint16_t src_w, uint16_t src_h, ra8_gfx_format_t src_format, int32_t dst_x, int32_t dst_y)
Copy a sub-image from src_buf into the framebuffer at (dst_x,dst_y).
ra8_gfx_dim_limits_t
Bounds on framebuffer dimensions accepted by ra8_gfx_init().
@ k_ra8_gfx_min_dim
Minimum width or height in pixels.
@ k_ra8_gfx_max_dim
Maximum supported edge length.
ra8_err_t ra8_gfx_set_clip(int32_t x, int32_t y, int32_t w, int32_t h)
Restrict all subsequent drawing to a rectangle (dirty-region updates).
ra8_err_t ra8_gfx_clear(uint32_t color)
Fill the bound framebuffer's clip region with a single colour.
ra8_err_t ra8_gfx_text_size(const char *str, const ra8_gfx_font_t *font, uint32_t *out_w, uint32_t *out_h)
Compute rendered pixel dimensions of a string.
ra8_err_t ra8_gfx_pixel(int32_t x, int32_t y, uint32_t color)
Set a single pixel.
ra8_err_t ra8_gfx_text_out(int32_t x, int32_t y, const char *str, const ra8_gfx_font_t *font, uint32_t fg_color, uint32_t bg_color)
Render a NUL-terminated ASCII string.
ra8_err_t ra8_gfx_init(void *fb, uint16_t width, uint16_t height, ra8_gfx_format_t format)
Bind ra8_gfx to a caller-owned framebuffer.
ra8_err_t ra8_gfx_blit_gray8(const uint8_t *src, int32_t w, int32_t h, int32_t dst_x, int32_t dst_y)
Blit an 8-bit grayscale image to a framebuffer rectangle.
ra8_err_t ra8_gfx_rect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color, bool filled)
Draw an axis-aligned rectangle.
Bitmap font descriptor + bundled font handles for ra8_gfx.
Monochrome, fixed-width bitmap font descriptor.