#[non_exhaustive]pub struct SourceColor {
pub cicp: Option<Cicp>,
pub icc_profile: Option<Arc<[u8]>>,
pub bit_depth: Option<u8>,
pub channel_count: Option<u8>,
pub content_light_level: Option<ContentLightLevel>,
pub mastering_display: Option<MasteringDisplay>,
}Expand description
Source color description from the image file.
Groups color-related metadata from the original source: CICP tags, ICC profile, bit depth, channel count, and HDR descriptors (content light level, mastering display).
These describe the source color space — not the current pixel
data’s color space (which is tracked by zenpixels::PixelDescriptor).
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.cicp: Option<Cicp>CICP color description (ITU-T H.273).
When present, describes the color space without requiring an ICC profile. Both CICP and ICC may be present — CICP takes precedence per AVIF/HEIF specs, but callers should use ICC when CICP is absent.
icc_profile: Option<Arc<[u8]>>Embedded ICC color profile.
Stored as Arc<[u8]> for cheap sharing across pipeline stages
and pixel slices. Accepts Vec<u8> via with_icc_profile().
bit_depth: Option<u8>Bits per channel (e.g. 8, 10, 12, 16, 32).
None if unknown (e.g. from a header-only probe that doesn’t
report bit depth).
channel_count: Option<u8>Number of channels (1=gray, 2=gray+alpha, 3=RGB, 4=RGBA).
None if unknown.
content_light_level: Option<ContentLightLevel>Content Light Level Info (CEA-861.3) for HDR content.
mastering_display: Option<MasteringDisplay>Mastering Display Color Volume (SMPTE ST 2086) for HDR content.
Implementations§
Source§impl SourceColor
impl SourceColor
Sourcepub fn with_icc_profile(self, icc: impl Into<Arc<[u8]>>) -> Self
pub fn with_icc_profile(self, icc: impl Into<Arc<[u8]>>) -> Self
Set the ICC color profile.
Sourcepub fn with_bit_depth(self, bit_depth: u8) -> Self
pub fn with_bit_depth(self, bit_depth: u8) -> Self
Set the bit depth.
Sourcepub fn with_channel_count(self, channel_count: u8) -> Self
pub fn with_channel_count(self, channel_count: u8) -> Self
Set the channel count.
Sourcepub fn with_content_light_level(self, clli: ContentLightLevel) -> Self
pub fn with_content_light_level(self, clli: ContentLightLevel) -> Self
Set the Content Light Level Info.
Sourcepub fn with_mastering_display(self, mdcv: MasteringDisplay) -> Self
pub fn with_mastering_display(self, mdcv: MasteringDisplay) -> Self
Set the Mastering Display Color Volume.
Sourcepub fn transfer_function(&self) -> TransferFunction
pub fn transfer_function(&self) -> TransferFunction
Derive the transfer function from CICP metadata.
Sourcepub fn color_primaries(&self) -> ColorPrimaries
pub fn color_primaries(&self) -> ColorPrimaries
Derive the color primaries from CICP metadata.
Trait Implementations§
Source§impl Clone for SourceColor
impl Clone for SourceColor
Source§fn clone(&self) -> SourceColor
fn clone(&self) -> SourceColor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more