8
9
10
11
12
25 void setValue(uint8_t b, uint8_t g, uint8_t r) {
26 value = (
static_cast<uint16_t>(b & 0xF8) << 8) |
27 (
static_cast<uint16_t>(g & 0xFC) << 3) |
28 (
static_cast<uint16_t>(r) >> 3);
36 const uint8_t blue = (
value >> 11) & 0x1F;
37 return (blue << 3) | (blue >> 2);
42 const uint8_t green = (
value >> 5) & 0x3F;
43 return (green << 2) | (green >> 4);
48 const uint8_t red =
value & 0x1F;
49 return (red << 3) | (red >> 2);
56 static uint8_t
size() {
return 16; }
BGR color stored in 16-bit BGR565 format.
Definition: BGR565.h:13
BGR565(uint8_t b, uint8_t g, uint8_t r)
Creates a color from 8-bit blue, green, and red components.
Definition: BGR565.h:19
BGR565()=default
Creates a black BGR565 color.
uint16_t getValue() const
Returns the packed BGR565 value.
Definition: BGR565.h:53
uint8_t getBlue() const
Returns the blue component expanded to 8 bits.
Definition: BGR565.h:35
static uint8_t size()
Returns size in bits.
Definition: BGR565.h:56
uint8_t getGreen() const
Returns the green component expanded to 8 bits.
Definition: BGR565.h:41
BGR565(uint16_t packed)
Creates a color from a packed BGR565 value.
Definition: BGR565.h:22
uint8_t getRed() const
Returns the red component expanded to 8 bits.
Definition: BGR565.h:47
void setValue(uint16_t packed)
Sets the color from a packed BGR565 value.
Definition: BGR565.h:32
uint16_t value
Definition: BGR565.h:59
void setValue(uint8_t b, uint8_t g, uint8_t r)
Sets the color from 8-bit blue, green, and red components.
Definition: BGR565.h:25
Definition: AVIWriter.h:9
bool operator!=(const tinygpu::BGR565 &lhs, const tinygpu::BGR565 &rhs)
Definition: BGR565.h:62