pub struct ColorMetadata {
pub primaries: ColorPrimaries,
pub transfer: TransferFunction,
pub matrix: ColorMatrix,
pub range: ColorRange,
pub dynamic_range: DynamicRange,
}Expand description
Host-independent video color description.
Fields§
§primaries: ColorPrimariesRGB chromaticity standard.
transfer: TransferFunctionNonlinear transfer curve.
matrix: ColorMatrixYUV-to-RGB coefficient family, or RGB for already converted sources.
range: ColorRangeEncoded component range.
dynamic_range: DynamicRangeSDR or HDR signal classification: HDR exactly when transfer is PQ
or HLG (Self::is_consistent).
Implementations§
Source§impl ColorMetadata
impl ColorMetadata
Sourcepub const EXPORT: Self
pub const EXPORT: Self
What every SDR export is encoded as and tagged with: BT.709 primaries, transfer, and matrix, in limited range.
The working space is display-referred: export encodes it with the sRGB curve, the exact inverse of how every SDR input is linearized, and tags the result BT.709, as SDR video is. Every export path, native and browser, packs and tags from this one value.
Sourcepub const UNDECLARED: Self = Self::EXPORT
pub const UNDECLARED: Self = Self::EXPORT
What a source that declares no color is decoded as: BT.709 limited
SDR. The fallback is reported: the renderer’s
ColorDiagnostic::MissingMetadataFallback for a frame without a
color, and conform’s undeclared_color for a video whose color
neither the project nor its media declares.
Sourcepub const fn is_hdr(self) -> bool
pub const fn is_hdr(self) -> bool
Whether the signal is HDR: carried by a PQ or HLG transfer, or
classified so. The one rule every consumer decides HDR by: lint,
conform, the renderer, and the native decoders and encoders. For a
consistent value (Self::is_consistent) the two fields agree.
Sourcepub const fn is_consistent(self) -> bool
pub const fn is_consistent(self) -> bool
Whether dynamic_range says what transfer does: HDR exactly when
the transfer is PQ or HLG. A project declaring or recording a color
that is not is refused, so no consumer has to choose between them.