pub struct ColorInfo { /* private fields */ }Expand description
The color description a video frame carries in its ndi_color_info
metadata.
NDI 6 describes a frame’s colorimetry with one element in its metadata,
standing alone or inside an ndi_metadata_group:
<ndi_color_info primaries="bt_2020" transfer="bt_2100_pq" matrix="bt_2020"/>Each attribute may be missing, and its accessor then returns None. A
missing matrix means BT.709 and a missing transfer means SDR, which is
how image encoding reads them; missing primaries are unknown.
Separate attributes with XML whitespace. Color values may contain decimal
or hexadecimal character references. The reader recognizes predefined XML
entities and reads color values without expanding custom entities.
Every video frame’s color_info method reads it, for example
VideoFrame::color_info. That read refuses
received metadata withheld as non-UTF-8 or unterminated text, including
when its status was preserved on an owned copy. Measured with the
6.4 SDK, the SDK passes the element through unchanged to receivers in
every color format, YUV and RGB, but does not apply it: it converts
between YUV and RGB with BT.709 coefficients whatever the element says.
Document type declarations are skipped without expanding entities or loading external definitions.
Implementations§
Source§impl ColorInfo
impl ColorInfo
Sourcepub const fn primaries(&self) -> Option<ColorPrimaries>
pub const fn primaries(&self) -> Option<ColorPrimaries>
The color primaries, or None when the element does not give them.
Sourcepub const fn transfer(&self) -> Option<TransferFunction>
pub const fn transfer(&self) -> Option<TransferFunction>
The transfer function, or None when the element does not give one,
which means SDR.
Sourcepub const fn matrix(&self) -> Option<YuvMatrix>
pub const fn matrix(&self) -> Option<YuvMatrix>
The YUV matrix, or None when the element does not give one, which
means BT.709.
Sourcepub const fn is_hdr(&self) -> bool
pub const fn is_hdr(&self) -> bool
Whether the transfer function is HDR: TransferFunction::Pq or
TransferFunction::Hlg.