feat: add ColorDescription::with_full_range and is_hdr - #30
Merged
Conversation
From the hgaiser/moonshine#146 review. The presets pin primaries, transfer and matrix as a group, and full range is the only field that changes on its own, so every consumer ends up writing `ColorDescription { full_range, ..ColorDescription::bt2020_pq() }`. `with_full_range` gives that the same shape as the EncodeConfig builders, and ColorDescription is `#[must_use]` now like the other builder types. `is_hdr` moves the "PQ transfer function is what makes the stream HDR" check onto the type instead of every consumer redefining it; the luma range and primaries don't decide it. The H.273 code points the presets use are named constants now instead of bare numbers.
lutyjj
force-pushed
the
feat/color-description-api
branch
from
August 2, 2026 09:33
2af716a to
0c14370
Compare
lutyjj
added a commit
to lutyjj/pixelforge
that referenced
this pull request
Aug 2, 2026
Integration branch for the local moonshine build: - feat/color-description-api (hgaiser#30) - fix/av1-keyframe-rc-reset (not yet submitted upstream)
Owner
|
Perfect, thanks 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation of the hgaiser/moonshine#146 review. Implements builder-style
with_full_rangeforColorDescriptionto avoid struct-update syntax at every call site. Also makesColorDescription#[must_use]to catch a discarded builder result - on aCopytype that's a silent no-op. Additionally addsis_hdras per request - replaces the "PQ transfer function is what makes the stream HDR" check that consumers keep redefining. Also replaces magic numbers with a little bit more readable constants.Verified against moonshine: reworked the 7 sites from hgaiser/moonshine#146 on top of this and the whole thing compiles just fine.