pub enum JxlColorProfile {
Icc(Vec<u8>),
Simple(JxlColorEncoding),
}Variants§
Icc(Vec<u8>)
Simple(JxlColorEncoding)
Implementations§
Source§impl JxlColorProfile
impl JxlColorProfile
Sourcepub fn as_icc(&self) -> Cow<'_, Vec<u8>>
pub fn as_icc(&self) -> Cow<'_, Vec<u8>>
Returns the ICC profile, panicking if unavailable.
§Panics
Panics if the color encoding cannot generate an ICC profile.
Consider using try_as_icc for fallible conversion.
Sourcepub fn try_as_icc(&self) -> Option<Cow<'_, Vec<u8>>>
pub fn try_as_icc(&self) -> Option<Cow<'_, Vec<u8>>>
Attempts to get an ICC profile, returning None if unavailable.
Returns None for color encodings that cannot generate ICC profiles.
Sourcepub fn same_color_encoding(&self, other: &Self) -> bool
pub fn same_color_encoding(&self, other: &Self) -> bool
Returns true if both profiles represent the same color encoding.
Two profiles are the same if they are both simple color encodings with matching color space (primaries, white point) and transfer function, or if they are both ICC profiles with identical bytes.
Sourcepub fn transfer_function(&self) -> Option<&JxlTransferFunction>
pub fn transfer_function(&self) -> Option<&JxlTransferFunction>
Returns the transfer function if this is a simple color profile. Returns None for ICC profiles or XYB.
Sourcepub fn can_output_to(&self) -> bool
pub fn can_output_to(&self) -> bool
Returns true if the decoder can output to this color profile without a CMS.
This is the equivalent of libjxl’s CanOutputToColorEncoding. Output is possible
when the profile is a simple encoding (not ICC) with a natively-supported transfer
function. For grayscale, the white point must be D65.
Sourcepub fn with_linear_tf(&self) -> Option<Self>
pub fn with_linear_tf(&self) -> Option<Self>
Returns a copy of this profile with linear transfer function. For ICC profiles, returns None since we can’t modify embedded ICC profiles. This is used to create the CMS input profile for XYB images where XybStage outputs linear data.
Trait Implementations§
Source§impl Clone for JxlColorProfile
impl Clone for JxlColorProfile
Source§fn clone(&self) -> JxlColorProfile
fn clone(&self) -> JxlColorProfile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more