8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
50 return static_cast<uint16_t>((v << 8) | (v >> 8));
54 void setValue(uint8_t r, uint8_t g, uint8_t b) {
55 const uint16_t packed = (
static_cast<uint16_t>(r & 0xF8) << 8) |
56 (
static_cast<uint16_t>(g & 0xFC) << 3) |
57 (
static_cast<uint16_t>(b) >> 3);
68 return (red << 3) | (red >> 2);
74 return (green << 2) | (green >> 4);
80 return (blue << 3) | (blue >> 2);
94 static uint8_t
size() {
return 16; }
RGB color stored in 16-bit RGB565 format, byte-swapped from the conventional bit layout.
Definition: RGB565.h:24
uint16_t getValue() const
Definition: RGB565.h:86
RGB565()=default
Creates a black RGB565 color.
uint8_t getBlue() const
Returns the blue component expanded to 8 bits.
Definition: RGB565.h:78
RGB565(uint16_t packed)
Definition: RGB565.h:38
static uint8_t size()
Returns size in bits.
Definition: RGB565.h:94
uint8_t getGreen() const
Returns the green component expanded to 8 bits.
Definition: RGB565.h:72
uint16_t getValueSwapped() const
Definition: RGB565.h:91
uint8_t getRed() const
Returns the red component expanded to 8 bits.
Definition: RGB565.h:66
void setValue(uint16_t packed)
Definition: RGB565.h:63
uint16_t value
Definition: RGB565.h:97
static uint16_t swapBytes(uint16_t v)
Definition: RGB565.h:49
RGB565(uint8_t r, uint8_t g, uint8_t b)
Creates a color from 8-bit red, green, and blue components.
Definition: RGB565.h:31
void setValue(uint8_t r, uint8_t g, uint8_t b)
Sets the color from 8-bit red, green, and blue components.
Definition: RGB565.h:54
static RGB565 fromRGB(uint8_t r, uint8_t g, uint8_t b)
Definition: RGB565.h:43
Definition: DSIBusESP32.h:19
bool operator!=(const tinygpu::RGB565 &lhs, const tinygpu::RGB565 &rhs)
Definition: RGB565.h:100