FastLED 3.10.6
Loading...
Searching...
No Matches
color_profile.h
Go to the documentation of this file.
1#pragma once
2
4#include "fl/stl/shared_ptr.h"
5#include "fl/stl/string.h"
6#include "fl/stl/vector.h"
7
8namespace fl {
9
10using colorimetric_response::EmitterProfile; // ok bare using: public P2 profile API
11
24
25 explicit ColorProfileStorage(const EmitterProfile& source) FL_NO_EXCEPT : mProfile(source),
26 mId(source.id == nullptr ? "" : source.id),
27 mProvenanceKind(source.provenance_kind == nullptr ? "" : source.provenance_kind),
28 mReportId(source.report_id == nullptr ? "" : source.report_id) {
29 if (source.response_lut_size != 0) {
30 mResponseRed.assign(source.response_lut_r, source.response_lut_r + source.response_lut_size);
31 mResponseGreen.assign(source.response_lut_g, source.response_lut_g + source.response_lut_size);
32 mResponseBlue.assign(source.response_lut_b, source.response_lut_b + source.response_lut_size);
33 mProfile.response_lut_r = mResponseRed.data();
34 mProfile.response_lut_g = mResponseGreen.data();
35 mProfile.response_lut_b = mResponseBlue.data();
36 if (source.response_lut_white1 != nullptr) {
37 mResponseWhite1.assign(source.response_lut_white1,
38 source.response_lut_white1 + source.response_lut_size);
39 mProfile.response_lut_white1 = mResponseWhite1.data();
40 }
41 if (source.response_lut_white2 != nullptr) {
42 mResponseWhite2.assign(source.response_lut_white2,
43 source.response_lut_white2 + source.response_lut_size);
44 mProfile.response_lut_white2 = mResponseWhite2.data();
45 }
46 }
47 mProfile.id = mId.empty() ? nullptr : mId.c_str();
48 mProfile.provenance_kind = mProvenanceKind.empty() ? nullptr : mProvenanceKind.c_str();
49 mProfile.report_id = mReportId.empty() ? nullptr : mReportId.c_str();
50 }
51
56};
57
72
73namespace detail {
74// Defined in color_profile.cpp.hpp, not here. A function-local static in a
75// header gives every DLL that includes it its own copy, so on Windows the
76// test module set one instance of these while Channel::create() read
77// another; `SourceProfile` also has a non-trivial constructor, which the
78// header rule prohibits outright.
79bool& colorProfileStrictMode() FL_NO_EXCEPT;
80SourceProfile& defaultSourceProfile() FL_NO_EXCEPT;
81} // namespace detail
82
83} // namespace fl
Shared colorimetric primitives reusable by the RGBW and (future) RGB colorimetric paths (issue #3255)...
GamutPolicy
InputGamut g FL_NO_EXCEPT
Definition rgbw.h:121
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NO_EXCEPT
CIE 1931 xy chromaticity, independent of encoded storage and chipset.
const EmitterProfile * profile() const FL_NO_EXCEPT
const EmitterProfile * mStaticProfile
fl::shared_ptr< const ColorProfileStorage > mStorage
bool active() const FL_NO_EXCEPT
Immutable profile binding carried by a channel.
ColorProfileStorage(const EmitterProfile &source) FL_NO_EXCEPT
fl::vector< u16 > mResponseWhite2
fl::vector< u16 > mResponseGreen
ColorProfileStorage(ColorProfileStorage &&) FL_NO_EXCEPT=delete
fl::vector< u16 > mResponseRed
EmitterProfile mProfile
fl::vector< u16 > mResponseBlue
ColorProfileStorage(const ColorProfileStorage &) FL_NO_EXCEPT=delete
fl::vector< u16 > mResponseWhite1
static constexpr SourceProfile linearSrgb() FL_NO_EXCEPT
A source declaration, not a container or an output-device selection.