#[non_exhaustive]pub struct OutputMetadata {
pub icc: Option<Arc<[u8]>>,
pub cicp: Option<Cicp>,
pub hdr: Option<HdrMetadata>,
}Expand description
Metadata that the encoder should embed alongside the pixel data.
Generated atomically by finalize_for_output to guarantee that
the metadata matches the pixel values.
§Not the same as ColorContext / ColorOrigin
Three carriers touch color and overlap on icc / cicp, but each answers
a different question and lives at a different point in the pipeline:
ColorOrigin— how the source file described its color (provenance + which field is authoritative). Immutable, set once at decode, consulted for re-encode decisions.ColorContext— what the working pixels are right now (the profile needed to interpret their values:icc/cicp/diffuse_white). Rides on thePixelSliceviaArcand is rewritten as conversions change the pixels. It deliberately carries no content light level / mastering display — those don’t change how a value is interpreted, only how a display should present it.OutputMetadata(this type) — the color blocks the encoder writes into the container (icc/cicp). It is the lowering target of a codec’s color plan (zencodec::ColorEmitPlanis itself just{ cicp, icc }) and mirrors that shape. Its reason to exist as a distinct type is theEncodeReadyatomicity guarantee: the converted bytes and the embedded color are produced together and cannot drift apart — which a re-usedColorContextwould not give. HDR content descriptors (content light level, mastering display,diffuse_white) are deliberately not here: they are not color-profile data and ride the codec-boundary metadata carrier (zencodec::Metadata, which already holds all three) instead.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.icc: Option<Arc<[u8]>>ICC profile bytes to embed, if any.
cicp: Option<Cicp>CICP code points to embed, if any.
hdr: Option<HdrMetadata>unwired bundled HDR carrier; replaced by sibling content_light_level / mastering_display fields when the encoder path that populates them lands (0.3.0).
HDR metadata to embed (content light level, mastering display), if any.
Deprecated and never wired — finalize_for_output always sets it to
None. The bundled HdrMetadata carrier is
being removed at 0.3.0 (it has frozen public fields and bundles
transfer, which the prior art keeps on the descriptor).
What replaces it: nothing — and that is correct by design, not a
stub. Removing this leaves OutputMetadata { icc, cicp }, which
mirrors the color plan a codec lowers here (zencodec::ColorEmitPlan
is itself just { cicp, icc }). The HDR content descriptors — content
light level, mastering display, and the diffuse_white /
intensity_target anchor — are not color-profile data: they ride
the codec-boundary metadata carrier instead. zencodec::Metadata
already carries all three as sibling fields (the un-bundled shape this
HdrMetadata bundle should have been), threaded by its metadata policy,
and the codec embeds them from there. Nothing ever read them off this
field — HdrMetadata had zero consumers across ~/work, and zencodec
routed around it from the start. See CHANGELOG.md
“QUEUED BREAKING CHANGES”.
Trait Implementations§
Source§impl Clone for OutputMetadata
impl Clone for OutputMetadata
Source§fn clone(&self) -> OutputMetadata
fn clone(&self) -> OutputMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more