FastLED 3.10.6
Loading...
Searching...
No Matches
colorimetric_response.h File Reference

Detailed Description

Shared colorimetric primitives reusable by the RGBW and (future) RGB colorimetric paths (issue #3255).

This module is the topology-independent layer extracted from rgbw_colorimetric.h: small-matrix linear algebra, chromaticity conversions, the source-primary matrix construction, and the LUT quantization constants. None of these helpers know about W diodes, RGBW sub-gamuts, or the boosted / RGBCCT solver topology.

All helpers are header-inline — they appear in hot inner loops and the optimizer needs to fold them. Tests at tests/fl/gfx/colorimetric_response.cpp exercise them in isolation of the RGBW topology, complementing the RGBW-flavored coverage in tests/fl/gfx/rgbw_colorimetric.cpp.

Backward compatibility: the existing fl::colorimetric_detail:: namespace re-exports every name from here via using-declarations, so callers reaching into colorimetric_detail::xyY_to_XYZ(...) etc. keep compiling unchanged. New code should reach colorimetric_response:: directly.

Definition in file colorimetric_response.h.

#include "fl/math/math.h"
#include "fl/gfx/color_profile.h"
#include "fl/stl/stdint.h"
+ Include dependency graph for colorimetric_response.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fl::colorimetric_response::EmitterProfile
 
struct  fl::colorimetric_response::RgbColorimetricCache
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 
namespace  fl::colorimetric_response
 
namespace  fl::colorimetric_response::detail
 
namespace  fl::colorimetric_response::profiles
 
namespace  fl::profiles
 

Typedefs

using fl::colorimetric_response::RgbColorimetricProfile = EmitterProfile
 

Enumerations

enum class  fl::colorimetric_response::EmitterTopology : u8 { fl::colorimetric_response::RGB = 0 , fl::colorimetric_response::RGBW = 1 , fl::colorimetric_response::RGBWW = 2 }
 
enum class  fl::colorimetric_response::LutInterp : u8 { fl::colorimetric_response::Bilinear = 0 , fl::colorimetric_response::Hermite = 1 }
 

Functions

bool fl::colorimetric_response::barycentric_xy (const float t[2], const float A[2], const float B[2], const float C[2], float bary[3]) FL_NO_EXCEPT
 
bool fl::colorimetric_response::build_rgb_colorimetric_cache (const EmitterProfile &p, RgbColorimetricCache *cache) FL_NO_EXCEPT
 
bool fl::colorimetric_response::build_source_matrix (const float xy_r[2], const float xy_g[2], const float xy_b[2], const float xy_w[2], float M_out[3][3]) FL_NO_EXCEPT
 
void fl::colorimetric_response::cct_to_xy (int cct, float out[2]) FL_NO_EXCEPT
 
float fl::colorimetric_response::detail::columnScale (float a, float b, float c) FL_NO_EXCEPT
 Largest absolute entry of a column, which is its infinity norm.
 
void fl::colorimetric_response::hermite_basis (float t, float out[4]) FL_NO_EXCEPT
 
bool fl::colorimetric_response::invert3x3 (const float in[3][3], float out[3][3]) FL_NO_EXCEPT
 
void fl::colorimetric_response::matvec3 (const float M[3][3], const float v[3], float out[3]) FL_NO_EXCEPT
 
void fl::colorimetric_response::nnls3 (const float M[3][3], const float b[3], float t_out[3], float *residual_out) FL_NO_EXCEPT
 
i16 fl::colorimetric_response::quantize_lut_cell (float v) FL_NO_EXCEPT
 
u8 fl::colorimetric_response::quantize_u8 (float v) FL_NO_EXCEPT
 
void fl::colorimetric_response::rgb_source_to_XYZ (const RgbColorimetricCache &cache, float s_r, float s_g, float s_b, float X_t[3]) FL_NO_EXCEPT
 
bool fl::colorimetric_response::solve_rgb_colorimetric (const RgbColorimetricCache &cache, float s_r, float s_g, float s_b, float out_rgb[3]) FL_NO_EXCEPT
 
void fl::colorimetric_response::xyY_to_XYZ (float x, float y, float Y, float out[3]) FL_NO_EXCEPT
 

Variables

constexpr i16 fl::colorimetric_response::kLutQ = 4096
 
constexpr int fl::colorimetric_response::kLutStrideBilinear = 4
 
constexpr int fl::colorimetric_response::kLutStrideHermite = 12
 
constexpr float fl::colorimetric_response::detail::kRelativeSingularity = 1e-6f
 How small a determinant may be, relative to the matrix's own scale, before the inverse is rounding noise.
 
static constexpr EmitterProfile fl::colorimetric_response::profiles::WS2812B
 
static constexpr EmitterProfile fl::profiles::WS2812B
 

Class Documentation

◆ fl::colorimetric_response::RgbColorimetricCache

struct fl::colorimetric_response::RgbColorimetricCache
Class Members
bool has_source_space
float M_src[3][3]
float P_B[3]
float P_G[3]
float P_R[3]
float P_RGB_inv[3][3]