Color conversion functions used by the pw_display draw library and tests.
◆ EncodeRgb565()
constexpr ColorRgb565 pw::display::EncodeRgb565 |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b |
|
) |
| |
|
constexpr |
Encode an RGB565 value from individual red, green, blue and alpha values.
This will introduce some loss in color as values are mapped from 8 bits per color down to 5 for red, 6 for green, and 5 for blue.
◆ EncodeRgba8888() [1/2]
constexpr ColorRgba8888 pw::display::EncodeRgba8888 |
( |
ColorRgb565 |
rgb565 | ) |
|
|
constexpr |
Encode an RGBA8888 value from RGB565.
This will scale each color up to 8 bits per pixel. Red and blue are scaled from 5 bits to 8 bits. Green from 6 bits to 8 bits. There is no alpha channel in the RGB565 format so alpha is set to 255 representing 100% opaque.
◆ EncodeRgba8888() [2/2]
constexpr ColorRgba8888 pw::display::EncodeRgba8888 |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b, |
|
|
uint8_t |
a |
|
) |
| |
|
constexpr |
Encode an RGBA8888 value from individual red, green, blue and alpha values.