Used in color conversion from floating point to uint8_t
| 295 | |
| 296 | // Used in color conversion from floating point to uint8_t |
| 297 | inline uint8_t floatToByte(float val, bool doClamp = false) { |
| 298 | if (doClamp) |
| 299 | val = clamp(val, 0.0f, 1.0f); |
| 300 | return (uint8_t)(val * 255.0f); |
| 301 | } |
| 302 | |
| 303 | // Used in color conversion from uint8_t to normalized float. |
| 304 | inline float byteToFloat(uint8_t val) { |
no test coverage detected