#[non_exhaustive]pub enum ColorPolicy {
Sdk,
Override {
matrix: YuvMatrix,
range: YuvRange,
},
}Expand description
How YUV frames are converted to RGB.
RGB frames are encoded as they are; the policy still decides whether
their ndi_color_info must be readable. RGB-received frames already carry
the SDK’s BT.709 limited-range YUV conversion, whatever that tag says.
This enum is marked #[non_exhaustive] so that policies can be added
without a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Sdk
Convert with BT.709 and limited range, unless the frame’s
ndi_color_info metadata names another matrix, which is then used.
An untagged source with different color encoding needs
ColorPolicy::Override.
RGB-received frames already hold the SDK’s BT.709 limited-range
conversion, which ignores the tag; this policy cannot apply its matrix
afterward. Tags still govern color admission and the PNG cICP chunk.
See the color guidance for receiving YUV when the
tag’s matrix matters, including sources with alpha.
A frame whose ndi_color_info cannot be read, including received
metadata withheld as non-UTF-8 or unterminated text, is refused with
Error::InvalidFrame, so the encoder
never guesses at a frame that says something it cannot read.
Override
Convert with this matrix and range, whatever the frame says.
The caller takes responsibility for the frame’s color: unreadable
ndi_color_info and withheld received metadata are ignored, and the
frame then counts as SDR with
unknown primaries. Readable metadata still decides the HDR check and
a PNG’s color tag.