11 uint8_t lo = 0, hi = 255;
13 uint8_t mid = (lo + hi + 1) / 2;
31 this->color_correct_blue(color.blue), this->color_correct_white(color.white));
34 uint8_t res = esp_scale8_twice(red, this->
max_brightness_.
red, this->local_brightness_);
52 this->color_uncorrect_blue(color.blue), this->color_uncorrect_white(color.white));
59 return (uint8_t) std::min(res, uint16_t(255));
66 return (uint8_t) std::min(res, uint16_t(255));
73 return (uint8_t) std::min(res, uint16_t(255));
80 return (uint8_t) std::min(res, uint16_t(255));
uint8_t gamma_correct_(uint8_t value) const
Forward gamma: read uint16 PROGMEM table, convert to uint8.
uint8_t color_uncorrect_red(uint8_t red) const ESPHOME_ALWAYS_INLINE
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)
Color color_correct(Color color) const ESPHOME_ALWAYS_INLINE
uint8_t color_uncorrect_blue(uint8_t blue) const ESPHOME_ALWAYS_INLINE
void set_gamma_table(const uint16_t *table)
Color color_uncorrect(Color color) const ESPHOME_ALWAYS_INLINE
uint8_t color_uncorrect_green(uint8_t green) const ESPHOME_ALWAYS_INLINE
const uint16_t * gamma_table_
uint8_t color_correct_green(uint8_t green) 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 color_uncorrect_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)