20 uint8_t lo = 0, hi = 255;
22 uint8_t mid = (lo + hi + 1) / 2;
36#ifdef USE_LIGHT_POWER_ESTIMATION
46 this->color_correct_blue(color.blue), this->color_correct_white(color.white));
68 this->color_uncorrect_blue(raw_color.
blue), this->color_uncorrect_white(raw_color.
white));
86 inline uint8_t
limit_(uint8_t res)
const ESPHOME_ALWAYS_INLINE {
87#ifdef USE_LIGHT_POWER_ESTIMATION
103#ifdef USE_LIGHT_POWER_ESTIMATION
uint8_t gamma_correct_(uint8_t value) const
Forward gamma: read uint16 PROGMEM table, convert to uint8.
void set_power_brightness(uint8_t power_brightness)
uint8_t color_correct_channel(uint8_t channel, uint8_t value) const ESPHOME_ALWAYS_INLINE
uint8_t power_brightness_
uint8_t color_correct_blue(uint8_t blue) const ESPHOME_ALWAYS_INLINE
void set_max_brightness(const Color &max_brightness)
uint8_t color_correct_red(uint8_t red) const ESPHOME_ALWAYS_INLINE
void set_local_brightness(uint8_t local_brightness)
uint8_t color_uncorrect_blue(uint8_t raw_blue) const ESPHOME_ALWAYS_INLINE
Color color_correct(Color color) const ESPHOME_ALWAYS_INLINE
void set_gamma_table(const uint16_t *table)
uint8_t color_uncorrect_white(uint8_t raw_white) const ESPHOME_ALWAYS_INLINE
uint8_t color_uncorrect_channel(uint8_t channel, uint8_t raw_value) const
uint8_t color_uncorrect_red(uint8_t raw_red) const ESPHOME_ALWAYS_INLINE
uint8_t get_power_brightness() const
uint8_t color_uncorrect_green(uint8_t raw_green) const ESPHOME_ALWAYS_INLINE
const uint16_t * gamma_table_
Color color_uncorrect(Color raw_color) const
uint8_t uncorrect_level_(uint8_t value) const
Reverse gamma and limit for one stored level.
uint8_t color_correct_green(uint8_t green) const ESPHOME_ALWAYS_INLINE
uint8_t limit_(uint8_t res) const ESPHOME_ALWAYS_INLINE
uint8_t gamma_uncorrect_(uint8_t value) const
Reverse gamma: binary search the forward PROGMEM table.
uint8_t color_correct_white(uint8_t white) const ESPHOME_ALWAYS_INLINE
uint8_t local_brightness_
uint8_t gamma_table_reverse_search(const uint16_t *table, uint16_t target)
Binary search a monotonically increasing uint16[256] PROGMEM table.
uint16_t progmem_read_uint16(const uint16_t *addr)
A gamma curve as codegen emits it into PROGMEM: the lookup table and the gamma it was built from.