roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
color_format.h
Go to the documentation of this file.
1#pragma once
2
8#include "roo_io/data/byte_order.h"
9
10namespace roo_display {
11namespace internal {
12
13template <typename ColorMode>
18
19template <>
24
25template <>
30
31template <>
36
37template <>
42
43template <>
48
49template <>
54
55template <>
60
61template <>
66
67template <>
72
73template <>
78
79template <>
84
85template <>
90
91template <>
96
97template <>
102
103template <>
108
109template <>
114
115template <>
120
121template <typename ColorMode, roo_io::ByteOrder kByteOrder,
124 public:
125 ColorFormatImpl(const ColorMode& mode)
128 mode_(mode) {}
129
130 void decode(const roo::byte* data, size_t row_width_bytes, int16_t x0,
131 int16_t y0, int16_t x1, int16_t y1,
132 Color* output) const override {
134 io.decode(data, row_width_bytes, x0, y0, x1, y1, output, mode_);
135 }
136
137 bool decodeIfUniform(const roo::byte* data, size_t row_width_bytes,
138 int16_t x0, int16_t y0, int16_t x1, int16_t y1,
139 Color* output) const override {
141 return io.decodeIfUniform(data, row_width_bytes, x0, y0, x1, y1, output,
142 mode_);
143 }
144
145 private:
146 const ColorMode& mode_;
147};
148
149} // namespace internal
150} // namespace roo_display
16-bit ARGB 4-4-4-4 color mode.
24-bit ARGB 6-6-6-6 color mode.
ColorMode template contract.
Definition color_modes.h:35
ARGB8888 color stored as a 32-bit unsigned integer.
Definition color.h:16
ColorFormat(Mode mode, roo_io::ByteOrder byte_order, ColorPixelOrder pixel_order=ColorPixelOrder::kMsbFirst)
Definition device.h:358
The abstraction for drawing to a display.
Definition device.h:15
RGB565 with a reserved value representing transparency.
16-bit RGB565 color mode (opaque).
24-bit RGB color mode (opaque).
Definition color_modes.h:85
32-bit RGBA color mode.
Definition color_modes.h:51
void decode(const roo::byte *data, size_t row_width_bytes, int16_t x0, int16_t y0, int16_t x1, int16_t y1, Color *output) const override
Decodes a sub-rectangle of data, converting it to an array of colors.
ColorFormatImpl(const ColorMode &mode)
bool decodeIfUniform(const roo::byte *data, size_t row_width_bytes, int16_t x0, int16_t y0, int16_t x1, int16_t y1, Color *output) const override
Returns true if all pixels in the specified rectangle have the same raw representation in this format...
Defines 140 opaque HTML named colors.
static constexpr const DisplayOutput::ColorFormat::Mode mode