|
smartledz-protocol
Smart LEDZ protocol v1 command and state codec library
|
Color-temperature and RGB conversion helpers for Smart LEDZ v1. More...
#include <array>#include <cstdint>

Go to the source code of this file.
Functions | |
| std::array< uint8_t, 3 > | smartledz_protocol::v1::lookup_ct_rgb (uint16_t kelvin, float duv) |
| Converts correlated color temperature and Duv into RGB. | |
| uint16_t | smartledz_protocol::v1::estimate_cct_from_rgb (uint8_t target_red, uint8_t target_green, uint8_t target_blue, float duv) |
| Estimates correlated color temperature from an RGB sample. | |
Color-temperature and RGB conversion helpers for Smart LEDZ v1.
| uint16_t smartledz_protocol::v1::estimate_cct_from_rgb | ( | uint8_t | target_red, |
| uint8_t | target_green, | ||
| uint8_t | target_blue, | ||
| float | duv | ||
| ) |
Estimates correlated color temperature from an RGB sample.
| target_red | Red channel of the target sample. |
| target_green | Green channel of the target sample. |
| target_blue | Blue channel of the target sample. |
| duv | Duv offset used by the fitted model. |
[1800, 12000]. | std::array< uint8_t, 3 > smartledz_protocol::v1::lookup_ct_rgb | ( | uint16_t | kelvin, |
| float | duv | ||
| ) |
Converts correlated color temperature and Duv into RGB.
| kelvin | Correlated color temperature in kelvin. |
| duv | Duv offset used by the fitted model. |
kelvin is clamped to [1800, 12000] and duv to [-6.0, 6.0].