picofuse

Files | Macros | Typedefs | Functions
Pixels

The Pixel module provides shared types and drawing primitives for software framebuffers and display-backed surfaces. More...

Files

file  color.h
 RGBA color type and helpers.
 

Macros

#define PIX_COLOR_BLACK   0x000000FFu
 Common opaque colors (0xRRGGBBAA).
 
#define PIX_COLOR_RGBA(r, g, b, a)
 Construct a pix_color_t from separate R/G/B/A components. More...
 
#define PIX_COLOR_RGB(r, g, b)   PIX_COLOR_RGBA(r, g, b, 0xFFu)
 Construct a fully-opaque pix_color_t from R/G/B components.
 

Typedefs

typedef uint32_t pix_color_t
 Color value type for pixel operations. More...
 

Functions

static uint8_t pix_color_r (pix_color_t color)
 Extract the red channel.
 
static uint8_t pix_color_g (pix_color_t color)
 Extract the green channel.
 
static uint8_t pix_color_b (pix_color_t color)
 Extract the blue channel.
 
static uint8_t pix_color_a (pix_color_t color)
 Extract the alpha channel.
 

Detailed Description

The Pixel module provides shared types and drawing primitives for software framebuffers and display-backed surfaces.

Macro Definition Documentation

◆ PIX_COLOR_RGBA

#define PIX_COLOR_RGBA (   r,
  g,
  b,
 
)
Value:
((pix_color_t)(((uint32_t)(uint8_t)(r) << 24) | \
((uint32_t)(uint8_t)(g) << 16) | \
((uint32_t)(uint8_t)(b) << 8) | \
(uint32_t)(uint8_t)(a)))
uint32_t pix_color_t
Color value type for pixel operations.
Definition: color.h:17

Construct a pix_color_t from separate R/G/B/A components.

Definition at line 38 of file color.h.

Typedef Documentation

◆ pix_color_t

typedef uint32_t pix_color_t

Color value type for pixel operations.

Encoded as 0xRRGGBBAA (red in the most-significant byte, alpha in the least-significant byte). This is independent of any particular storage layout (e.g. a bitmap's own pixel format) - it's how a single color is passed around, not how a buffer of pixels is packed in memory.

Definition at line 17 of file color.h.