16 uint16_t target = value * 257;
22 return (target - a <=
b - target) ? lo : lo + 1;
uint8_t gamma_correct_(uint8_t value) const
Forward gamma: read uint16 PROGMEM table, convert to uint8.
const uint16_t * gamma_table_
uint8_t gamma_uncorrect_(uint8_t value) const
Reverse gamma: binary search the forward PROGMEM table.
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)