#[non_exhaustive]pub struct ColorOrigin {
pub icc: Option<Arc<[u8]>>,
pub cicp: Option<Cicp>,
pub provenance: ColorProvenance,
}Expand description
Immutable record of how the source file described its color.
Tracks the original color description from the decoded file so encoders can make provenance-aware decisions (e.g., re-embed the original ICC profile, or prefer CICP when re-encoding to AVIF).
ColorOrigin is immutable once set. It records how color was
described, not what the pixels currently are. The encoder uses
PixelDescriptor for the current state
and can consult ColorOrigin for provenance decisions.
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]>>Raw ICC profile bytes from the source file, if any.
cicp: Option<Cicp>CICP parameters from the source file, if any.
provenance: ColorProvenanceHow the color information was originally described.
Implementations§
Source§impl ColorOrigin
impl ColorOrigin
Sourcepub fn from_cicp(cicp: Cicp) -> ColorOrigin
pub fn from_cicp(cicp: Cicp) -> ColorOrigin
Create from CICP parameters.
Sourcepub fn from_icc_and_cicp(icc: impl Into<Arc<[u8]>>, cicp: Cicp) -> ColorOrigin
pub fn from_icc_and_cicp(icc: impl Into<Arc<[u8]>>, cicp: Cicp) -> ColorOrigin
Create from both ICC and CICP (e.g., AVIF with both).
Sourcepub fn from_gama_chrm() -> ColorOrigin
pub fn from_gama_chrm() -> ColorOrigin
Create from gAMA/cHRM chunks (no ICC or CICP).
Sourcepub fn assumed() -> ColorOrigin
pub fn assumed() -> ColorOrigin
Create for assumed/default color (no explicit metadata).
Trait Implementations§
Source§impl Clone for ColorOrigin
impl Clone for ColorOrigin
Source§fn clone(&self) -> ColorOrigin
fn clone(&self) -> ColorOrigin
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more