pub struct ColorContext {
pub icc: Option<Arc<[u8]>>,
pub cicp: Option<Cicp>,
}Expand description
Color space metadata for pixel data.
Bundles ICC profile bytes and/or CICP parameters into a single
shareable context. Carried via Arc on pixel slices and pipeline
sources so color metadata travels with pixel data without per-strip
cloning overhead.
Fields§
§icc: Option<Arc<[u8]>>Raw ICC profile bytes.
cicp: Option<Cicp>CICP parameters (ITU-T H.273).
Implementations§
Source§impl ColorContext
impl ColorContext
Sourcepub fn from_cicp(cicp: Cicp) -> ColorContext
pub fn from_cicp(cicp: Cicp) -> ColorContext
Create from CICP parameters.
Sourcepub fn from_icc_and_cicp(icc: impl Into<Arc<[u8]>>, cicp: Cicp) -> ColorContext
👎Deprecated since 0.2.6: use from_icc() or from_cicp(); roundtrip metadata belongs on ColorOrigin
pub fn from_icc_and_cicp(icc: impl Into<Arc<[u8]>>, cicp: Cicp) -> ColorContext
use from_icc() or from_cicp(); roundtrip metadata belongs on ColorOrigin
Create from both ICC and CICP.
Deprecated: Codecs should populate only the authoritative field —
use from_icc() or from_cicp().
Roundtrip metadata belongs on ColorOrigin, not ColorContext.
Sourcepub fn as_profile_source(&self) -> Option<ColorProfileSource<'_>>
pub fn as_profile_source(&self) -> Option<ColorProfileSource<'_>>
Get a ColorProfileSource reference for CMS integration.
Returns ICC if present, otherwise CICP. Returns None when neither
is present.
Codecs should populate only the authoritative field on ColorContext
at decode time, using ColorAuthority on ColorOrigin to
determine which. When only one field is set, this method returns it.
Sourcepub fn transfer_function(&self) -> TransferFunction
pub fn transfer_function(&self) -> TransferFunction
Derive transfer function from CICP (or Unknown if no CICP).
Trait Implementations§
Source§impl Clone for ColorContext
impl Clone for ColorContext
Source§fn clone(&self) -> ColorContext
fn clone(&self) -> ColorContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more