8
9
10
11
12
26 void setValue(uint8_t r, uint8_t g, uint8_t b) {
27 value = (
static_cast<uint16_t>(r & 0xF8) << 8) |
28 (
static_cast<uint16_t>(g & 0xFC) << 3) |
29 (
static_cast<uint16_t>(b) >> 3);
37 const uint8_t red = (
value >> 11) & 0x1F;
38 return (red << 3) | (red >> 2);
43 const uint8_t green = (
value >> 5) & 0x3F;
44 return (green << 2) | (green >> 4);
49 const uint8_t blue =
value & 0x1F;
50 return (blue << 3) | (blue >> 2);
57 static uint8_t
size() {
return 16; }
RGB color stored in 16-bit RGB565 format.
Definition: RGB565.h:13
uint16_t getValue() const
Returns the packed RGB565 value.
Definition: RGB565.h:54
RGB565()=default
Creates a black RGB565 color.
uint8_t getBlue() const
Returns the blue component expanded to 8 bits.
Definition: RGB565.h:48
RGB565(uint16_t packed)
Creates a color from a packed RGB565 value.
Definition: RGB565.h:23
static uint8_t size()
Returns size in bits.
Definition: RGB565.h:57
uint8_t getGreen() const
Returns the green component expanded to 8 bits.
Definition: RGB565.h:42
uint8_t getRed() const
Returns the red component expanded to 8 bits.
Definition: RGB565.h:36
void setValue(uint16_t packed)
Sets the color from a packed RGB565 value.
Definition: RGB565.h:33
uint16_t value
Definition: RGB565.h:60
RGB565(uint8_t r, uint8_t g, uint8_t b)
Creates a color from 8-bit red, green, and blue components.
Definition: RGB565.h:20
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:26
Definition: AVIWriter.h:9
bool operator!=(const tinygpu::RGB565 &lhs, const tinygpu::RGB565 &rhs)
Definition: RGB565.h:63