FastLED 3.10.6
Loading...
Searching...
No Matches

◆ buildTwoWhiteAllocationFromSolveQ16()

bool fl::buildTwoWhiteAllocationFromSolveQ16 ( const EmitterSolveMatrixQ16 & solve,
const i32(&) white1_xyz[3],
const i32(&) white2_xyz[3],
WhiteAllocationPolicy policy,
TwoWhiteAllocationQ16 * out )

Bind two adapted white columns with an RGB solve in the same XYZ domain.

Definition at line 356 of file white_allocation.cpp.hpp.

359 {
360 if (out == nullptr) {
361 return false;
362 }
363 out->policy = policy;
364 out->rgb_solve = solve;
365 i32 per_white1[3];
366 solveRgbDrivesQ16(out->rgb_solve, white1_xyz, per_white1);
367 solveRgbDrivesQ16(out->rgb_solve, white2_xyz, out->per_white2);
368
369 for (int i = 0; i < 3; ++i) {
370 // The difference is what the split multiplies, so it is the one that
371 // has to fit; both columns are checked because it is derived from
372 // them and because each is a bound coefficient in its own right.
373 if (per_white1[i] > kTwoWhiteMaxColumn || per_white1[i] < -kTwoWhiteMaxColumn ||
374 out->per_white2[i] > kTwoWhiteMaxColumn ||
375 out->per_white2[i] < -kTwoWhiteMaxColumn) {
376 return false;
377 }
378 out->difference[i] = per_white1[i] - out->per_white2[i];
379 }
380 return true;
381}
void solveRgbDrivesQ16(const EmitterSolveMatrixQ16 &matrix, const i32(&xyz)[3], i32(&drives)[3]) FL_NO_EXCEPT
One pixel: XYZ in s16.16 to three emitter drives in s16.16.
i32 per_white2[3]
M^-1 . w2: the RGB drives one unit of the second white replaces.
WhiteAllocationPolicy policy
Which end of the feasible total this profile takes.
EmitterSolveMatrixQ16 rgb_solve
Inverse RGB emitter matrix.

References FL_NO_EXCEPT, and solveRgbDrivesQ16().

Referenced by buildGamutMapRgbwwFromSolveQ16(), and buildTwoWhiteAllocationQ16().

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