Skip to content

Color pipeline P4: .fled color metadata and rgb16_linear #4038

Closed

Description

@zackees

Phase P4 of the color pipeline implementation (see parent issue). Independently mergeable; touches src/fl/fled/ and the canonical ledmapper spec.

Scope

The .fled color-metadata contract, end to end.

  • Spec sync first: re-read the canonical ledmapper v1 spec (audit smaller-note — the local mirror src/fl/fled/FLED_FORMAT.md declares only video.fps today), then bring mirror, builder, parser (src/fl/fled/detail/parser.cpp.hpp), and video consumer to the same contract.
  • video.color tuple {primaries, transfer, matrix, range} with the feat(color): design a profiled high-precision color-accurate output pipeline #4032 semantics; absent metadata ⇒ exactly {bt709, srgb, rgb, full}; missing individual keys inherit from the default tuple only for pixel formats with a defined default tuple (B5).
  • Validation rules: reject transfer ∈ {linear, PQ, HLG} with rgb8 (B4); reject range: "limited" with rgb8 in v1 (B5); non-RGB pixel formats must declare matrix/range explicitly or be rejected (B5); unknown explicit values ⇒ clear unsupported-profile diagnostic.
  • New pixel_format: rgb16_linear (A4): 16-bit LE per channel, linear-light, full-range; transfer MUST be linear, matrix MUST be rgb, range MUST be full; primaries follow the rgb8 rules. HDR/float format names reserved, rejected (B2).
  • Forward compatibility (C6): video.color is advisory for rgb8; payloads requiring color semantics gate on new pixel_format values old parsers already reject. No container version bump.
  • Headless rejection contract (audit smaller-note): defined error return, serial log where available, dark output — never garbage; best-effort playback only via explicit opt-in flag on the player.

Decisions implemented

A4, B4, B5, B6 (documentation half: legacy files change appearance with CM enabled, intentionally; plus the video-display-referred vs buffer-linear rationale), C6, C8.6 (source names owned by ledmapper spec).

Acceptance criteria owned

  • .fled spec/producer/mirror/parser/playback carry and honor video.color; tests prove the absent-metadata default, that linear payloads are never labeled rgb8, and that unknown explicit profiles are rejected clearly.

Dependencies

None on other phases (playback honoring the profile colorimetrically arrives with P6; this phase carries/validates/exposes it).

Deliverables

Updated canonical spec + mirror + parser + producer, validation test suite, rgb16_linear support behind the parser.

Activity

  1. zackees commented on Sep 6, 2026

    @zackees
    MemberAuthor

    Producer implementation is now under review in zackees/ledmapper#513 (commit f8516cd3404c64fc0e5d092ce603f5e1aff23ac7). It adds direct RGB16LE serialization, format-aware artifact sizing/linear metadata, mirrored gfx exports, explicit RGB8-renderer rejection, and prepares gfx 0.2.0. Local full unit suite: 791/791; packed consumer/build/API/policy/release/parity/adapter checks passed; independent review clean. Remote CI is running. This phase remains open: producer merge/release, downstream FastLED pin, and FastLED source PR review/merge are still required. No claim that RGB16 browser colorimetric rendering is implemented.

  2. zackees commented on Sep 6, 2026

    @zackees
    MemberAuthor

    Producer PR zackees/ledmapper#513 is now merged as 34cc22d4855dd2b0ba182dfe85f69b818f0e5fed after all remote lint/build/unit/smoke checks passed. The producer checkout is clean on main. Package publication and downstream FastLED pin/source PR remain outstanding; this phase stays open.

  3. zackees commented on Sep 6, 2026

    @zackees
    MemberAuthor

    Delivered across two PRs, both merged.

    Acceptance criteria

    .fled spec/producer/mirror/parser/playback carry and honor video.color; tests prove the absent-metadata default, that linear payloads are never labeled rgb8, and that unknown explicit profiles are rejected clearly.

    item where
    spec / mirror src/fl/fled/FLED_FORMAT.md — video.color, the four-field table, default tuple, color classes by pixel format
    producer FledBuilder::setVideoColor() (#4164)
    parser resolveVideoColor() + ColorStatus in color.cpp.hpp
    playback Fled::videoColor(), PixelStream, Video
    absent-metadata default round-trip test asserts the default tuple with declared == false
    linear never labeled rgb8 TransferConflictsWithFormat, asserted from both the parser and the builder
    unknown profiles rejected UnknownPrimaries / UnknownTransfer / UnknownMatrix / UnknownRange, each with a diagnostic string
    headless rejection defined error return + dark output in Video::draw()

    On the "spec sync first" note

    The scope note said the mirror declared only video.fps while the canonical ledmapper v1 spec had moved ahead. Checked directly: zackees/ledmapper docs/fled-format.md already documents video.color, so this phase was a mirror sync, not a canonical-spec change. Nothing is left owed to the other repo.

    Per the tracker, playback honoring the profile colorimetrically belongs to P6 (#4040); this phase carries, validates and exposes it, which it now does.

    Closing. Reopen if the ledmapper contract moves and the mirror needs to follow.

  4. moved this from Triage to Done in FastLED Trackeron Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions