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; 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
The color every SDR export is tagged with: BT.709 primaries, transfer and matrix, limited range.
The working space is display-referred, so export encodes with the sRGB curve (the exact inverse of SDR input linearization) and tags the result BT.709 like other SDR video.
Sourcepub const UNDECLARED: Self = Self::EXPORT
pub const UNDECLARED: Self = Self::EXPORT
How a source without declared color is decoded: BT.709 limited SDR. The renderer reports
it as ColorDiagnostic::MissingMetadataFallback.
Sourcepub const fn is_hdr(self) -> bool
pub const fn is_hdr(self) -> bool
Whether the signal is HDR by transfer (PQ or HLG) or classification. Every consumer uses this one rule.
Sourcepub const fn is_consistent(self) -> bool
pub const fn is_consistent(self) -> bool
Whether dynamic_range matches transfer (HDR exactly for PQ or HLG). Projects with an
inconsistent color are rejected.