FastLED 3.9.15
Loading...
Searching...
No Matches

◆ invert3x3()

bool fl::colorimetric_detail::invert3x3 ( const float in[3][3],
float out[3][3] )
inline

Definition at line 75 of file rgbw_colorimetric.h.

75 {
76 const float a = in[0][0], b = in[0][1], c = in[0][2];
77 const float d = in[1][0], e = in[1][1], f = in[1][2];
78 const float g = in[2][0], h = in[2][1], i = in[2][2];
79 const float det = a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g);
80 if (fl::fabs(det) < 1e-20f) {
81 return false;
82 }
83 const float inv_det = 1.0f / det;
84 out[0][0] = (e * i - f * h) * inv_det;
85 out[0][1] = (c * h - b * i) * inv_det;
86 out[0][2] = (b * f - c * e) * inv_det;
87 out[1][0] = (f * g - d * i) * inv_det;
88 out[1][1] = (a * i - c * g) * inv_det;
89 out[1][2] = (c * d - a * f) * inv_det;
90 out[2][0] = (d * h - e * g) * inv_det;
91 out[2][1] = (b * g - a * h) * inv_det;
92 out[2][2] = (a * e - b * d) * inv_det;
93 return true;
94}
double fabs(double value) FL_NOEXCEPT
Definition math.h:509

References fl::fabs(), and FL_NOEXCEPT.

Referenced by build_source_matrix().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: