FastLED 3.10.6
Loading...
Searching...
No Matches
gamut_map.cpp.hpp File Reference
#include "fl/gfx/gamut_map.h"
#include "fl/gfx/oklab_q16.h"
+ Include dependency graph for gamut_map.cpp.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fl::anonymous_namespace{gamut_map.cpp.hpp}::RgbFeasible
 Feasibility against the three-emitter hull. More...
 
struct  fl::anonymous_namespace{gamut_map.cpp.hpp}::RgbwFeasible
 Feasibility against the device's real hull when it has a white emitter. More...
 
struct  fl::anonymous_namespace{gamut_map.cpp.hpp}::RgbwwFeasible
 Feasibility against the device's real hull when it has two white emitters. More...
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 
namespace  fl::anonymous_namespace{gamut_map.cpp.hpp}
 

Functions

bool fl::buildGamutMapFromSolveQ16 (const EmitterSolveMatrixQ16 &solve, GamutMapQ16 *out) FL_NO_EXCEPT
 Build a mapper from a bind-time solve already transformed into D65 working coordinates.
 
bool fl::buildGamutMapQ16 (const colorimetric_response::EmitterProfile &profile, GamutMapQ16 *out) FL_NO_EXCEPT
 Derive the mapper for a three-emitter profile.
 
bool fl::buildGamutMapRgbwFromSolveQ16 (const colorimetric_response::EmitterProfile &profile, const EmitterSolveMatrixQ16 &solve, const i32(&white_xyz)[3], WhiteAllocationPolicy policy, GamutMapRgbwQ16 *out) FL_NO_EXCEPT
 Bind a four-emitter map from an effective RGB solve and a white column already adapted into the same D65 working coordinates.
 
bool fl::buildGamutMapRgbwQ16 (const colorimetric_response::EmitterProfile &profile, const i32(&white_xyz)[3], WhiteAllocationPolicy policy, GamutMapRgbwQ16 *out) FL_NO_EXCEPT
 Derive the mapper for a three-primary profile plus one white emitter.
 
bool fl::buildGamutMapRgbwwFromSolveQ16 (const colorimetric_response::EmitterProfile &profile, const EmitterSolveMatrixQ16 &solve, const i32(&white1_xyz)[3], const i32(&white2_xyz)[3], WhiteAllocationPolicy policy, GamutMapRgbwwQ16 *out) FL_NO_EXCEPT
 Bind a five-emitter map from one effective RGB solve and two white columns, all in the same D65 working coordinates.
 
bool fl::buildGamutMapRgbwwQ16 (const colorimetric_response::EmitterProfile &profile, const i32(&white1_xyz)[3], const i32(&white2_xyz)[3], WhiteAllocationPolicy policy, GamutMapRgbwwQ16 *out) FL_NO_EXCEPT
 Derive the mapper for a three-primary profile plus two white emitters.
 
void fl::anonymous_namespace{gamut_map.cpp.hpp}::chromaCandidateXyz (const i32(&lab)[3], i32 lightness, i32 factor, i32(&out_xyz)[3]) FL_NO_EXCEPT
 XYZ of the candidate at factor of the target's chroma.
 
i32 fl::anonymous_namespace{gamut_map.cpp.hpp}::clampChromaFactor (i32 low, i32 high) FL_NO_EXCEPT
 The target's chroma clamped into [low, high], in factor space.
 
void fl::anonymous_namespace{gamut_map.cpp.hpp}::clampGamutDrives (i32(&drives)[3]) FL_NO_EXCEPT
 Clamp drives into [0, 1].
 
template<typename Feasible>
bool fl::anonymous_namespace{gamut_map.cpp.hpp}::feasibleChromaInterval (const i32(&lab)[3], i32 lightness, Feasible feasible, i32 *out_low, i32 *out_high) FL_NO_EXCEPT
 The feasible chroma interval at the target's own lightness, as factors of the target's chroma.
 
bool fl::anonymous_namespace{gamut_map.cpp.hpp}::gamutDrivesAreInRange (const i32(&drives)[3], i32 slack) FL_NO_EXCEPT
 True when every drive is inside [0, 1], allowing slack ULP either side.
 
template<typename Feasible>
i32 fl::anonymous_namespace{gamut_map.cpp.hpp}::highestReachableLightness (const i32(&lab)[3], i32 cap, i32 requested, Feasible feasible) FL_NO_EXCEPT
 The highest lightness at or below requested whose feasible chroma interval the probe scan can still find.
 
template<typename Feasible>
i32 fl::anonymous_namespace{gamut_map.cpp.hpp}::largestFeasibleChroma (const i32(&lab)[3], i32 lightness, Feasible feasible) FL_NO_EXCEPT
 Largest chroma factor the hull accepts, by a fixed count of halvings.
 
void fl::mapAndAllocateRgbwQ16 (const GamutMapRgbwQ16 &map, const i32(&xyz)[3], i32(&drives)[4]) FL_NO_EXCEPT
 One pixel: XYZ in s16.16 to four in-gamut drives, red, green, blue, white.
 
void fl::mapAndAllocateRgbwwQ16 (const GamutMapRgbwwQ16 &map, const i32(&xyz)[3], i32(&drives)[5]) FL_NO_EXCEPT
 One pixel: XYZ in s16.16 to five in-gamut drives – red, green, blue, white1, white2.
 
void fl::mapAndSolveDrivesQ16 (const GamutMapQ16 &map, const i32(&xyz)[3], i32(&drives)[3]) FL_NO_EXCEPT
 One pixel: XYZ in s16.16 to in-gamut emitter drives in s16.16.
 
i32 fl::anonymous_namespace{gamut_map.cpp.hpp}::scaleGamutQ16 (i32 value, i32 factor) FL_NO_EXCEPT
 Scale an s16.16 value by an s16.16 factor, rounding to nearest.
 

Variables

constexpr i32 fl::anonymous_namespace{gamut_map.cpp.hpp}::kGamutD65Q16 [3] = {62289, 65536, 71372}
 D65 in s16.16, the white the working domain is normalized to.
 
constexpr i32 fl::anonymous_namespace{gamut_map.cpp.hpp}::kGamutFeasibilitySlack = 64
 Slack allowed on the drive bounds, in s16.16 raw units.
 
constexpr i32 fl::anonymous_namespace{gamut_map.cpp.hpp}::kGamutFullDrive = 65536
 Full drive, as an s16.16 raw value.
 
constexpr int fl::anonymous_namespace{gamut_map.cpp.hpp}::kGamutMapProbes = 8
 Probes used to find a seed inside the feasible chroma interval when the target is brighter than the device's brightest neutral (#4245).
 
constexpr i32 fl::anonymous_namespace{gamut_map.cpp.hpp}::kGamutProbeCeilingQ16 = 4 << 16
 How far above the target's own chroma the probes reach, in Q16.