FastLED 3.10.6
Loading...
Searching...
No Matches
white_allocation.h File Reference
#include "fl/gfx/device_solve.h"
#include "fl/stl/int.h"
#include "fl/stl/noexcept.h"
+ Include dependency graph for white_allocation.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fl::TwoWhiteAllocationQ16
 Everything the two-white allocation needs, derived once when a profile binds (C3, #4198). More...
 
struct  fl::WhiteAllocationQ16
 Everything the per-pixel allocation needs, derived once when a profile binds. More...
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 

Enumerations

enum class  fl::WhiteAllocationPolicy { fl::WhitePreferred , fl::RgbPreferred }
 Which end of the feasible white interval to take (C3). More...
 

Functions

bool fl::allocateEmitterDrivesQ16 (const WhiteAllocationQ16 &allocation, const i32(&xyz)[3], i32(&drives)[4]) FL_NO_EXCEPT
 One pixel: XYZ in s16.16 to four drives, in the order red, green, blue, white, at whichever end of the feasible interval the profile's policy names.
 
bool fl::allocateTwoWhiteDrivesQ16 (const TwoWhiteAllocationQ16 &allocation, const i32(&xyz)[3], i32(&drives)[5]) FL_NO_EXCEPT
 One pixel: XYZ in s16.16 to five drives – red, green, blue, white1, white2 – at whichever end of the feasible total the profile's policy names.
 
bool fl::buildTwoWhiteAllocationFromSolveQ16 (const EmitterSolveMatrixQ16 &solve, const i32(&white1_xyz)[3], const i32(&white2_xyz)[3], WhiteAllocationPolicy policy, TwoWhiteAllocationQ16 *out) FL_NO_EXCEPT
 Bind two adapted white columns with an RGB solve in the same XYZ domain.
 
bool fl::buildTwoWhiteAllocationQ16 (const colorimetric_response::EmitterProfile &profile, const i32(&white1_xyz)[3], const i32(&white2_xyz)[3], WhiteAllocationPolicy policy, TwoWhiteAllocationQ16 *out) FL_NO_EXCEPT
 Derive the allocation for three primaries plus two white emitters.
 
bool fl::buildWhiteAllocationFromSolveQ16 (const colorimetric_response::EmitterProfile &profile, const EmitterSolveMatrixQ16 &solve, const i32(&white_xyz)[3], WhiteAllocationPolicy policy, WhiteAllocationQ16 *out) FL_NO_EXCEPT
 Bind from an RGB solve already adapted to the D65 working domain.
 
bool fl::buildWhiteAllocationQ16 (const colorimetric_response::EmitterProfile &profile, const i32(&white_xyz)[3], WhiteAllocationPolicy policy, WhiteAllocationQ16 *out) FL_NO_EXCEPT
 Derive the allocation for a three-primary profile plus one white emitter.
 

Class Documentation

◆ fl::TwoWhiteAllocationQ16

struct fl::TwoWhiteAllocationQ16
+ Collaboration diagram for fl::TwoWhiteAllocationQ16:
Class Members
i32 difference[3] M^-1 .

w1 - M^-1 . w2, the difference column.

Held rather than recomputed because it is the coefficient of the split variable in every bound, and the per-pixel path reads it eight times. The first white's own column is not kept: it only ever appears through this difference.

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.

◆ fl::WhiteAllocationQ16

struct fl::WhiteAllocationQ16
+ Collaboration diagram for fl::WhiteAllocationQ16:
Class Members
i32 per_white[3] M^-1 .

white: the RGB drives one unit of white light replaces.

Precomputing this is what leaves the per-pixel path with a single matrix multiply. It does not depend on the pixel.

WhiteAllocationPolicy policy Which end of the interval this profile takes.
EmitterSolveMatrixQ16 rgb_solve Inverse RGB emitter matrix.
i32 slack[3] Per-channel drive slack, in s16.16 raw units.

The allowance a drive may fall outside [0, 1] and still be treated as reachable. It is per channel because its cost is per channel: one drive unit of an emitter is that emitter's XYZ column, and a saturated blue primary carries a column an order of magnitude larger than a green one. A single number in drive space therefore buys a different amount of colour error on each channel. FastLED#4303.