ESPHome 2026.6.5
Loading...
Searching...
No Matches
esphome::light::ESPColorCorrection Class Reference

#include <esp_color_correction.h>

Public Member Functions

void set_max_brightness (const Color &max_brightness)
 
void set_local_brightness (uint8_t local_brightness)
 
void set_gamma_table (const uint16_t *table)
 
Color color_correct (Color color) const ESPHOME_ALWAYS_INLINE
 
uint8_t color_correct_red (uint8_t red) const ESPHOME_ALWAYS_INLINE
 
uint8_t color_correct_green (uint8_t green) const ESPHOME_ALWAYS_INLINE
 
uint8_t color_correct_blue (uint8_t blue) const ESPHOME_ALWAYS_INLINE
 
uint8_t color_correct_white (uint8_t white) const ESPHOME_ALWAYS_INLINE
 
Color color_uncorrect (Color color) const
 
uint8_t color_uncorrect_red (uint8_t red) const ESPHOME_ALWAYS_INLINE
 
uint8_t color_uncorrect_green (uint8_t green) const ESPHOME_ALWAYS_INLINE
 
uint8_t color_uncorrect_blue (uint8_t blue) const ESPHOME_ALWAYS_INLINE
 
uint8_t color_uncorrect_white (uint8_t white) const ESPHOME_ALWAYS_INLINE
 

Protected Member Functions

uint8_t gamma_correct_ (uint8_t value) const
 Forward gamma: read uint16 PROGMEM table, convert to uint8.
 
uint8_t gamma_uncorrect_ (uint8_t value) const
 Reverse gamma: binary search the forward PROGMEM table.
 
uint8_t color_uncorrect_channel_ (uint8_t value, uint8_t max_brightness) const
 Shared body of color_uncorrect_{red,green,blue,white}.
 

Protected Attributes

const uint16_t * gamma_table_ {nullptr}
 
Color max_brightness_ {255, 255, 255, 255}
 
uint8_t local_brightness_ {255}
 

Detailed Description

Definition at line 23 of file esp_color_correction.h.

Member Function Documentation

◆ color_correct()

Color esphome::light::ESPColorCorrection::color_correct ( Color color) const
inline

Definition at line 28 of file esp_color_correction.h.

◆ color_correct_blue()

uint8_t esphome::light::ESPColorCorrection::color_correct_blue ( uint8_t blue) const
inline

Definition at line 41 of file esp_color_correction.h.

◆ color_correct_green()

uint8_t esphome::light::ESPColorCorrection::color_correct_green ( uint8_t green) const
inline

Definition at line 37 of file esp_color_correction.h.

◆ color_correct_red()

uint8_t esphome::light::ESPColorCorrection::color_correct_red ( uint8_t red) const
inline

Definition at line 33 of file esp_color_correction.h.

◆ color_correct_white()

uint8_t esphome::light::ESPColorCorrection::color_correct_white ( uint8_t white) const
inline

Definition at line 45 of file esp_color_correction.h.

◆ color_uncorrect()

Color esphome::light::ESPColorCorrection::color_uncorrect ( Color color) const

Definition at line 25 of file esp_color_correction.cpp.

◆ color_uncorrect_blue()

uint8_t esphome::light::ESPColorCorrection::color_uncorrect_blue ( uint8_t blue) const
inline

Definition at line 56 of file esp_color_correction.h.

◆ color_uncorrect_channel_()

uint8_t esphome::light::ESPColorCorrection::color_uncorrect_channel_ ( uint8_t value,
uint8_t max_brightness ) const
protected

Shared body of color_uncorrect_{red,green,blue,white}.

Kept out-of-line to avoid duplicating two 16-bit divides at every call site.

Definition at line 31 of file esp_color_correction.cpp.

◆ color_uncorrect_green()

uint8_t esphome::light::ESPColorCorrection::color_uncorrect_green ( uint8_t green) const
inline

Definition at line 53 of file esp_color_correction.h.

◆ color_uncorrect_red()

uint8_t esphome::light::ESPColorCorrection::color_uncorrect_red ( uint8_t red) const
inline

Definition at line 50 of file esp_color_correction.h.

◆ color_uncorrect_white()

uint8_t esphome::light::ESPColorCorrection::color_uncorrect_white ( uint8_t white) const
inline

Definition at line 59 of file esp_color_correction.h.

◆ gamma_correct_()

uint8_t esphome::light::ESPColorCorrection::gamma_correct_ ( uint8_t value) const
protected

Forward gamma: read uint16 PROGMEM table, convert to uint8.

Definition at line 5 of file esp_color_correction.cpp.

◆ gamma_uncorrect_()

uint8_t esphome::light::ESPColorCorrection::gamma_uncorrect_ ( uint8_t value) const
protected

Reverse gamma: binary search the forward PROGMEM table.

Definition at line 11 of file esp_color_correction.cpp.

◆ set_gamma_table()

void esphome::light::ESPColorCorrection::set_gamma_table ( const uint16_t * table)
inline

Definition at line 27 of file esp_color_correction.h.

◆ set_local_brightness()

void esphome::light::ESPColorCorrection::set_local_brightness ( uint8_t local_brightness)
inline

Definition at line 26 of file esp_color_correction.h.

◆ set_max_brightness()

void esphome::light::ESPColorCorrection::set_max_brightness ( const Color & max_brightness)
inline

Definition at line 25 of file esp_color_correction.h.

Field Documentation

◆ gamma_table_

const uint16_t* esphome::light::ESPColorCorrection::gamma_table_ {nullptr}
protected

Definition at line 72 of file esp_color_correction.h.

◆ local_brightness_

uint8_t esphome::light::ESPColorCorrection::local_brightness_ {255}
protected

Definition at line 74 of file esp_color_correction.h.

◆ max_brightness_

Color esphome::light::ESPColorCorrection::max_brightness_ {255, 255, 255, 255}
protected

Definition at line 73 of file esp_color_correction.h.


The documentation for this class was generated from the following files: