ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_gfx_internal.h File Reference

Module-private declarations shared across the ra8_gfx software rasteriser TUs. More...

#include <stddef.h>
#include <stdint.h>
#include "ra8_attributes.h"
#include "ra8_gfx.h"
Include dependency graph for ra8_gfx_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_gfx_state_t
 Internal module state populated by ra8_gfx_init(). More...

Functions

uint16_t priv_gfx_text_pack_565 (uint32_t color)
 Pack a 32-bit colour into a single RGB565 word.
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.

Variables

ra8_gfx_state_t g_gfx_text_state
 Single module-wide framebuffer binding shared by every ra8_gfx TU.

Detailed Description

Module-private declarations shared across the ra8_gfx software rasteriser TUs.

The software pixel-pusher is split across several translation units that all operate on one framebuffer binding. This header exposes the single mutable module state object and the few low-level helpers that more than one TU needs, so the implementation can be partitioned without duplicating mutable state.

Read-only colour/format enum constants are intentionally NOT declared here: each TU keeps its own private copy of those compile-time literals.

Since
0.1.0

Definition in file ra8_gfx_internal.h.

Function Documentation

◆ priv_gfx_text_pack_565()

uint16_t priv_gfx_text_pack_565 ( uint32_t color)

Pack a 32-bit colour into a single RGB565 word.

Shared low-level colour packer. Promoted to module-external linkage so both the core rasteriser TU and the text/glyph TU pack colours identically.

Parameters
[in]color32-bit 0xAARRGGBB colour to pack.
Returns
uint16_t Packed RGB565 word.
Return values
0x0000When color is black.
0xFFFFWhen color is white.
Precondition
Module state is consistent.
The colour packing constants are valid compile-time literals.
Postcondition
The returned word is the RGB565 encoding of color.
No module state is modified.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Pack a 32-bit colour into a single RGB565 word.

Definition at line 187 of file ra8_gfx_text.c.

References internal_color_b(), internal_color_g(), internal_color_r(), k_565_b_shift_in, k_565_g_shift_in, k_565_g_shift_out, k_565_r_shift_in, and k_565_r_shift_out.

Referenced by internal_blit_glyph_565(), internal_blit_gray8_565(), internal_fill_rect_565(), and internal_put_pixel().

◆ priv_gfx_text_plot()

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.

Shared per-pixel plotter. Promoted to module-external linkage so the text/glyph TU can fall back to the exact per-pixel path used by the core rasteriser for non-RGB565 formats.

Parameters
[in]xFramebuffer x coordinate.
[in]yFramebuffer y coordinate.
[in]color32-bit 0xAARRGGBB colour.
Precondition
Module state is consistent.
g_gfx_text_state is initialised.
Postcondition
The pixel is written only if it lies within the active clip rectangle.
No pixel outside the clip rectangle is modified.
Note
Not thread-safe unless documented otherwise.
Since
0.1.0

Plot a single pixel with bounds checking against the active clip.

Definition at line 335 of file ra8_gfx_text.c.

References g_gfx_text_state, and internal_put_pixel().

Referenced by internal_blit_gray8_slow(), internal_circle_filled_step(), internal_circle_outline_step(), internal_fill_rect(), internal_gray4_block(), internal_rect_outline(), internal_render_glyph(), ra8_gfx_blit(), ra8_gfx_blit_gray8_dither(), ra8_gfx_line(), and ra8_gfx_pixel().

Variable Documentation

◆ g_gfx_text_state

ra8_gfx_state_t g_gfx_text_state
extern

Single module-wide framebuffer binding shared by every ra8_gfx TU.

Module-wide framebuffer binding (single shared object; see ra8_gfx_internal.h).

Defined once in ra8_gfx_text.c (populated by ra8_gfx_init()); the text/glyph TU reads it through this extern declaration. There is exactly one object so all draw entry points observe the same framebuffer, format, and clip rectangle.

Note
Not thread-safe; mutated only by ra8_gfx_init()/ra8_gfx_set_clip().
Warning
Do not redefine; this is a single shared object, not per-TU state.
Since
0.1.0

The one definition of the shared rasteriser state. Other ra8_gfx TUs read it through the extern declaration in ra8_gfx_internal.h.

Note
Not thread-safe; mutated only by ra8_gfx_init()/ra8_gfx_set_clip().
Warning
Do not redefine; this is the single shared object for all ra8_gfx TUs.
Since
0.1.0

Definition at line 106 of file ra8_gfx_text.c.

Referenced by internal_blit_glyph_565(), internal_blit_gray8_565(), internal_fill_rect(), internal_fill_rect_565(), internal_render_glyph(), priv_gfx_text_plot(), ra8_gfx_blit(), ra8_gfx_blit_gray4_zoom(), ra8_gfx_blit_gray8(), ra8_gfx_blit_gray8_dither(), ra8_gfx_circle(), ra8_gfx_clear(), ra8_gfx_init(), ra8_gfx_line(), ra8_gfx_pixel(), ra8_gfx_rect(), ra8_gfx_reset_clip(), ra8_gfx_set_clip(), and ra8_gfx_text_out().