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

◆ toSourceProfile()

bool fl::fled::toSourceProfile ( const VideoColor & color,
SourceProfile * out )

Definition at line 365 of file color.cpp.hpp.

365 {
366 if (out == nullptr) {
367 return false;
368 }
370 switch (color.primaries) {
373 break;
376 break;
378 primaries = SourceProfile::bt2020().primaries;
379 break;
381 primaries = RgbPrimaries(
382 Chromaticity(color.customPrimaries[0], color.customPrimaries[1]),
383 Chromaticity(color.customPrimaries[2], color.customPrimaries[3]),
384 Chromaticity(color.customPrimaries[4], color.customPrimaries[5]),
385 Chromaticity(color.customPrimaries[6], color.customPrimaries[7]));
386 break;
387 }
389 switch (color.transfer) {
391 transfer = TransferFunction::Srgb;
392 break;
394 transfer = TransferFunction::Bt709;
395 break;
397 transfer = TransferFunction::Linear;
398 break;
399 }
400 // matrix and range: v1 defines only rgb / full, which is what the
401 // pipeline assumes, so there is nothing further to carry.
402 *out = SourceProfile(primaries, transfer);
403 return true;
404}
ColorTransfer transfer
Definition color.h:86
TransferFunction
CIE 1931 xy chromaticity, independent of encoded storage and chipset.
RgbPrimaries primaries
static constexpr SourceProfile srgbBt709() FL_NO_EXCEPT
static constexpr SourceProfile bt2020() FL_NO_EXCEPT
static constexpr SourceProfile displayP3() FL_NO_EXCEPT

References Bt2020, fl::SourceProfile::bt2020(), Bt709, fl::Bt709, Custom, DisplayP3, fl::SourceProfile::displayP3(), fl::FL_NO_EXCEPT, Linear, fl::Linear, fl::SourceProfile::primaries, Srgb, fl::Srgb, and fl::SourceProfile::srgbBt709().

Referenced by fl::Video::sourceProfile().

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