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_icc_and_cicp(icc: impl Into<Arc<[u8]>>, cicp: Cicp) -> Self
pub fn from_icc_and_cicp(icc: impl Into<Arc<[u8]>>, cicp: Cicp) -> Self
Create from both ICC and CICP.
Sourcepub fn as_profile_source(&self) -> Option<ColorProfileSource<'_>>
pub fn as_profile_source(&self) -> Option<ColorProfileSource<'_>>
Get a ColorProfileSource reference for CMS integration.
Returns CICP if present (takes precedence per AVIF/HEIF specs), otherwise returns the ICC profile bytes.
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColorContext
impl Debug for ColorContext
Source§impl PartialEq for ColorContext
impl PartialEq for ColorContext
impl Eq for ColorContext
impl StructuralPartialEq for ColorContext
Auto Trait Implementations§
impl Freeze for ColorContext
impl RefUnwindSafe for ColorContext
impl Send for ColorContext
impl Sync for ColorContext
impl Unpin for ColorContext
impl UnsafeUnpin for ColorContext
impl UnwindSafe for ColorContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more