Repository navigation
Closed
Description
Phase P2 of the color pipeline implementation (see parent issue). Independently mergeable.
Scope
The FastLED-side type system and per-channel binding API — no pipeline math yet.
- Extend
EmitterProfile(src/fl/gfx/colorimetric_response.hlineage): physical chromaticities + relative peak Y, optional per-channel code-to-light response/LUT, native code depth, per-chip 5-bit semantics (B1), calibration provenance + reference conditions, separate electrical power profile. Constexpr-constructible. - Source profile types: linear default, named spaces (sRGB/BT.709, Display-P3, BT.2020), custom xy primaries + white — decoupled from chipset selection (§2).
ChannelOptionsgains source profile, emitter profile, gamut policy fields (C1). Enum template parameter onFastLED.add<>()/Channel::create<>()resolves to a constexpr profile and stores its pointer there (C8.4 — sugar over one runtime slot); the slot equally accepts a user-built inline struct (per-fixture calibration, first-class in v1).CFastLEDcarries only global defaults; no barefl::set_*free functions.- Mutual exclusion: binding a profile clears legacy
setCorrection/setTemperatureand vice versa, one-time warning each way (C1).setTemperature()is legacy-mode-only; profile-mode white intent = target-white override in the profile API. - Fallback observability (C8.5): driver-only chipset + no profile → legacy path with one-time bind warning, queryable
isColorManaged()/bound-profile accessors, fallback flag in channel events, opt-in global strict mode (onCFastLED, per the Public Settings Pattern) upgrading fallback to a hard error. - Placeholder built-in defaults for fixed-package chipsets (WS2812B-class) so the API is exercisable before P3's generated set lands.
Decisions implemented
C1, C8.3 (floating alias + versioned pin symbol shape), C8.4, C8.5, B1 (semantics field), §2. Clean-up: stale "lands in PR 3" comment in colorimetric_response.h (audit smaller-note).
Acceptance criteria owned
- Source-profile types: linear/custom primaries + named spaces, decoupled from chipset.
Dependencies
None blocking. Schema co-design with P1; P3, P5, P6, P9 build on these types.
Deliverables
Types + binding API + fallback contract, unit-tested; tree-shaking proven (unused profiles cost zero flash) at this phase's scale.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Sep 7, 2026
Delivered in #4161 (
8f6c0502ec).Acceptance criterion
src/fl/gfx/color_profile.h—SourceProfile::linearSrgb / srgbBt709 / bt709 / displayP3 / bt2020 / custom, constexpr-constructible and independent of chipset selection.Deliverables
EmitterProfileextensionsrc/fl/gfx/colorimetric_response.hChannelOptions(C1)src/fl/channels/options.hFastLED.add<>()/Channel::create<>()(C8.4)CFastLEDonlysetColorManagementStrict(),setDefaultSourceProfile()— no barefl::set_*setColorProfile↔setLegacyCorrection, one-time warning each wayhasColorProfileFallback(),colorProfileStatus(), channel events, opt-in strict modecolor_profile_tiny_layout/color_profile_tiny_runtime, dedicated no-PCH executablesTree-shaking, and the baseline
The deliverable asked for "tree-shaking proven (unused profiles cost zero flash) at this phase's scale." Proven: a
Blinkbuild for esp32s3 was searched across all 4,321 symbols forcolorprofile/sourceprofile/emitterprofile/colorimetric/gamut— zero matches. No profile data or code links into a binary that binds no profile.The esp32s3 baseline still moved 341,250 → 342,393. That is not un-tree-shaken profile data. Symbol diff of master vs this branch attributes it:
ChannelOptionsctor (per-channel state)shared_ptr<ColorProfileStorage>750 B of that was removed before bumping, by giving both color-profile events one payload type —
fl::function_listinstantiates per signature, so two payload types cost two complete template stacks that every build pays whether or not anything subscribes.What remains is the last event signature. Eliminating it needs C8.5's "fallback flag in channel events" read literally — a flag on the existing events rather than a distinct event type — which in turn needs
colorProfileStatus()onIChannel, a public virtual-interface change with its own cost. That belongs with P9 (#4043), which owns bloat and throughput budgets per the tracker; this attribution is its starting point.Two results worth carrying forward, because both contradict what I first reported:
shared_ptr<ColorProfileStorage>costs 52 B, despite owning threefl::vectorand threefl::string.Boundary with P6
isColorManaged()returns false for a bound profile, deliberately — P2 binds, P6 (#4040) installs the streaming transform. A test now pins that so the accessor cannot be flipped true ahead of the transform.Closing.