|
ESPHome 2026.12.0-dev
|
Base class for color accessors backed by a buffer whose layout is described by ChannelColors. More...
#include <esp_color_view.h>
Public Member Functions | |
| BufferColorAccessor ()=default | |
| BufferColorAccessor (uint8_t *color_data, uint8_t *effect_data, ChannelColors channel_colors) | |
| Color | get_raw (int32_t index) const override |
| uint8_t | get_channel_raw (int32_t index, uint8_t channel) const override |
| uint8_t | get_effect_data (int32_t index) const override |
| void | set_raw (int32_t index, Color raw_color) override |
| void | set_channel_raw (int32_t index, uint8_t channel, uint8_t raw_value) override |
| void | set_effect_data (int32_t index, uint8_t value) override |
| bool | has_white_internal (int32_t index) const override |
| bool | allocate (RAMAllocator< uint8_t > &allocator, size_t num_leds, size_t extra_bytes=0) |
Allocate a zeroed block of buffer_bytes() plus extra_bytes for the caller, which start at effect_data + num_leds, and pass it to set_buffer(). | |
| uint8_t * | set_buffer (uint8_t *buffer, size_t num_leds) |
Use buffer for the color data of num_leds LEDs followed by their effect data, buffer_bytes() in all. | |
| void | clear_effect_data (size_t num_leds) |
Zero the effect data of the first num_leds LEDs; does nothing before the effect data is allocated. | |
Public Member Functions inherited from esphome::light::ESPColorAccessor | |
| virtual Color | get (int32_t index) const =0 |
| virtual uint8_t | get_channel (int32_t index, uint8_t channel) const =0 |
| virtual void | set (int32_t index, Color color)=0 |
| virtual void | set_channel (int32_t index, uint8_t channel, uint8_t value)=0 |
| virtual const ESPColorCorrection * | get_color_correction_internal (int32_t index) const |
Static Public Member Functions | |
| static constexpr size_t | buffer_bytes (size_t num_leds, uint8_t bytes_per_led) |
The color data of num_leds LEDs followed by one effect byte per LED. | |
Data Fields | |
| uint8_t * | color_data {nullptr} |
| uint8_t * | effect_data {nullptr} |
| ChannelColors | channel_colors {} |
Base class for color accessors backed by a buffer whose layout is described by ChannelColors.
Definition at line 65 of file esp_color_view.h.
|
default |
|
inline |
Definition at line 68 of file esp_color_view.h.
|
inline |
Allocate a zeroed block of buffer_bytes() plus extra_bytes for the caller, which start at effect_data + num_leds, and pass it to set_buffer().
Returns false if it failed.
Definition at line 91 of file esp_color_view.h.
|
inlinestaticconstexpr |
The color data of num_leds LEDs followed by one effect byte per LED.
Definition at line 102 of file esp_color_view.h.
|
inline |
Zero the effect data of the first num_leds LEDs; does nothing before the effect data is allocated.
Definition at line 115 of file esp_color_view.h.
|
inlineoverridevirtual |
Implements esphome::light::ESPColorAccessor.
Definition at line 72 of file esp_color_view.h.
|
inlineoverridevirtual |
Implements esphome::light::ESPColorAccessor.
Definition at line 75 of file esp_color_view.h.
|
inlineoverridevirtual |
Implements esphome::light::ESPColorAccessor.
Definition at line 71 of file esp_color_view.h.
|
inlineoverridevirtual |
Reimplemented from esphome::light::ESPColorAccessor.
Definition at line 86 of file esp_color_view.h.
|
inline |
Use buffer for the color data of num_leds LEDs followed by their effect data, buffer_bytes() in all.
Returns the first byte after the effect data.
Definition at line 108 of file esp_color_view.h.
|
inlineoverridevirtual |
Implements esphome::light::ESPColorAccessor.
Definition at line 80 of file esp_color_view.h.
|
inlineoverridevirtual |
Implements esphome::light::ESPColorAccessor.
Definition at line 83 of file esp_color_view.h.
|
inlineoverridevirtual |
Implements esphome::light::ESPColorAccessor.
Definition at line 77 of file esp_color_view.h.
| ChannelColors esphome::light::BufferColorAccessor::channel_colors {} |
Definition at line 123 of file esp_color_view.h.
| uint8_t* esphome::light::BufferColorAccessor::color_data {nullptr} |
Definition at line 121 of file esp_color_view.h.
| uint8_t* esphome::light::BufferColorAccessor::effect_data {nullptr} |
Definition at line 122 of file esp_color_view.h.