Pigweed
C/C++ API Reference
|
Functions | |
constexpr ColorRgb565 | pw::display::EncodeRgb565 (uint8_t r, uint8_t g, uint8_t b) |
constexpr ColorRgb565 | pw::display::EncodeRgb565 (ColorRgba8888 rgba8888) |
Encode an RGBA8888 value into RGB565. | |
constexpr ColorRgba8888 | pw::display::EncodeRgba8888 (uint8_t r, uint8_t g, uint8_t b, uint8_t a) |
constexpr ColorRgba8888 | pw::display::EncodeRgba8888 (ColorRgb565 rgb565) |
Color conversion functions used by the pw_display draw library and tests.
|
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.
|
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.
|
constexpr |
Encode an RGBA8888 value from individual red, green, blue and alpha values.