#[repr(C)]pub struct ColorProfile {Show 34 fields
pub pcs: DataColorSpace,
pub color_space: DataColorSpace,
pub profile_class: ProfileClass,
pub rendering_intent: RenderingIntent,
pub red_colorant: Xyzd,
pub green_colorant: Xyzd,
pub blue_colorant: Xyzd,
pub white_point: Xyzd,
pub black_point: Option<Xyzd>,
pub media_white_point: Option<Xyzd>,
pub luminance: Option<Xyzd>,
pub measurement: Option<Measurement>,
pub red_trc: Option<ToneReprCurve>,
pub green_trc: Option<ToneReprCurve>,
pub blue_trc: Option<ToneReprCurve>,
pub gray_trc: Option<ToneReprCurve>,
pub cicp: Option<CicpProfile>,
pub chromatic_adaptation: Option<Matrix3d>,
pub lut_a_to_b_perceptual: Option<LutWarehouse>,
pub lut_a_to_b_colorimetric: Option<LutWarehouse>,
pub lut_a_to_b_saturation: Option<LutWarehouse>,
pub lut_b_to_a_perceptual: Option<LutWarehouse>,
pub lut_b_to_a_colorimetric: Option<LutWarehouse>,
pub lut_b_to_a_saturation: Option<LutWarehouse>,
pub gamut: Option<LutWarehouse>,
pub copyright: Option<ProfileText>,
pub description: Option<ProfileText>,
pub device_manufacturer: Option<ProfileText>,
pub device_model: Option<ProfileText>,
pub char_target: Option<ProfileText>,
pub viewing_conditions: Option<ViewingConditions>,
pub viewing_conditions_description: Option<ProfileText>,
pub technology: Option<TechnologySignatures>,
pub calibration_date: Option<ColorDateTime>,
/* private fields */
}
Expand description
ICC Profile representation
Fields§
§pcs: DataColorSpace
§color_space: DataColorSpace
§profile_class: ProfileClass
§rendering_intent: RenderingIntent
§red_colorant: Xyzd
§green_colorant: Xyzd
§blue_colorant: Xyzd
§white_point: Xyzd
§black_point: Option<Xyzd>
§media_white_point: Option<Xyzd>
§luminance: Option<Xyzd>
§measurement: Option<Measurement>
§red_trc: Option<ToneReprCurve>
§green_trc: Option<ToneReprCurve>
§blue_trc: Option<ToneReprCurve>
§gray_trc: Option<ToneReprCurve>
§cicp: Option<CicpProfile>
§chromatic_adaptation: Option<Matrix3d>
§lut_a_to_b_perceptual: Option<LutWarehouse>
§lut_a_to_b_colorimetric: Option<LutWarehouse>
§lut_a_to_b_saturation: Option<LutWarehouse>
§lut_b_to_a_perceptual: Option<LutWarehouse>
§lut_b_to_a_colorimetric: Option<LutWarehouse>
§lut_b_to_a_saturation: Option<LutWarehouse>
§gamut: Option<LutWarehouse>
§copyright: Option<ProfileText>
§description: Option<ProfileText>
§device_manufacturer: Option<ProfileText>
§device_model: Option<ProfileText>
§char_target: Option<ProfileText>
§viewing_conditions: Option<ViewingConditions>
§viewing_conditions_description: Option<ProfileText>
§technology: Option<TechnologySignatures>
§calibration_date: Option<ColorDateTime>
Implementations§
Source§impl ColorProfile
impl ColorProfile
Sourcepub fn new_srgb() -> ColorProfile
pub fn new_srgb() -> ColorProfile
Creates new sRGB profile
Sourcepub fn new_adobe_rgb() -> ColorProfile
pub fn new_adobe_rgb() -> ColorProfile
Creates new Adobe RGB profile
Sourcepub fn new_display_p3() -> ColorProfile
pub fn new_display_p3() -> ColorProfile
Creates new Display P3 profile
Sourcepub fn new_display_p3_pq() -> ColorProfile
pub fn new_display_p3_pq() -> ColorProfile
Creates new Display P3 PQ profile
Sourcepub fn new_dci_p3() -> ColorProfile
pub fn new_dci_p3() -> ColorProfile
Creates new DCI P3 profile
Sourcepub fn new_pro_photo_rgb() -> ColorProfile
pub fn new_pro_photo_rgb() -> ColorProfile
Creates new ProPhoto RGB profile
Sourcepub fn new_bt2020() -> ColorProfile
pub fn new_bt2020() -> ColorProfile
Creates new Bt.2020 profile
Sourcepub fn new_bt2020_pq() -> ColorProfile
pub fn new_bt2020_pq() -> ColorProfile
Creates new Bt.2020 PQ profile
Sourcepub fn new_bt2020_hlg() -> ColorProfile
pub fn new_bt2020_hlg() -> ColorProfile
Creates new Bt.2020 HLG profile
Sourcepub fn new_gray_with_gamma(gamma: f32) -> ColorProfile
pub fn new_gray_with_gamma(gamma: f32) -> ColorProfile
Creates new Monochrome profile
Sourcepub fn new_aces_aces_2065_1_linear() -> ColorProfile
pub fn new_aces_aces_2065_1_linear() -> ColorProfile
Creates new ACES 2065-1/AP0 profile
Sourcepub fn new_aces_cg_linear() -> ColorProfile
pub fn new_aces_cg_linear() -> ColorProfile
Creates new ACEScg profile
Source§impl ColorProfile
impl ColorProfile
Sourcepub fn version(&self) -> ProfileVersion
pub fn version(&self) -> ProfileVersion
Returns profile version
pub fn new_from_slice(slice: &[u8]) -> Result<Self, CmsError>
pub fn new_from_slice_with_options( slice: &[u8], options: ParsingOptions, ) -> Result<Self, CmsError>
Source§impl ColorProfile
impl ColorProfile
pub fn colorant_matrix(&self) -> Matrix3d
Sourcepub const fn colorants_matrix(
white_point: XyY,
primaries: ColorPrimaries,
) -> Matrix3d
pub const fn colorants_matrix( white_point: XyY, primaries: ColorPrimaries, ) -> Matrix3d
Computes colorants matrix. Returns not transposed matrix.
To work on const
context this method does have restrictions.
If invalid values were provided it may return invalid matrix or NaNs.
Sourcepub const fn update_rgb_colorimetry(
&mut self,
white_point: XyY,
primaries: ColorPrimaries,
)
pub const fn update_rgb_colorimetry( &mut self, white_point: XyY, primaries: ColorPrimaries, )
Updates RGB triple colorimetry from 3 Chromaticity and white point
Sourcepub const fn update_rgb_colorimetry_triplet(
&mut self,
white_point: XyY,
red_xyz: Xyzd,
green_xyz: Xyzd,
blue_xyz: Xyzd,
)
pub const fn update_rgb_colorimetry_triplet( &mut self, white_point: XyY, red_xyz: Xyzd, green_xyz: Xyzd, blue_xyz: Xyzd, )
Updates RGB triple colorimetry from 3 Xyzd and white point
To work on const
context this method does have restrictions.
If invalid values were provided it may return invalid matrix or NaNs.
Sourcepub fn update_rgb_colorimetry_from_cicp(&mut self, cicp: CicpProfile) -> bool
pub fn update_rgb_colorimetry_from_cicp(&mut self, cicp: CicpProfile) -> bool
Updates RGB triple colorimetry from CICP
pub const fn rgb_to_xyz(&self, xyz_matrix: Matrix3f, wp: Xyz) -> Matrix3f
Sourcepub const fn rgb_to_xyz_d(xyz_matrix: Matrix3d, wp: Xyzd) -> Matrix3d
pub const fn rgb_to_xyz_d(xyz_matrix: Matrix3d, wp: Xyzd) -> Matrix3d
If Primaries is invalid will return invalid matrix on const context
pub fn rgb_to_xyz_matrix(&self) -> Matrix3d
Sourcepub fn transform_matrix(&self, dest: &ColorProfile) -> Matrix3d
pub fn transform_matrix(&self, dest: &ColorProfile) -> Matrix3d
Computes transform matrix RGB -> XYZ -> RGB Current profile is used as source, other as destination
Sourcepub fn profile_volume(&self) -> Option<f32>
pub fn profile_volume(&self) -> Option<f32>
Returns volume of colors stored in profile
Source§impl ColorProfile
impl ColorProfile
Sourcepub fn is_matrix_shaper(&self) -> bool
pub fn is_matrix_shaper(&self) -> bool
Checks if profile is valid Matrix Shaper profile
Sourcepub fn create_transform_16bit(
&self,
src_layout: Layout,
dst_pr: &ColorProfile,
dst_layout: Layout,
options: TransformOptions,
) -> Result<Box<Transform16BitExecutor>, CmsError>
pub fn create_transform_16bit( &self, src_layout: Layout, dst_pr: &ColorProfile, dst_layout: Layout, options: TransformOptions, ) -> Result<Box<Transform16BitExecutor>, CmsError>
Creates transform between source and destination profile Use for 16 bit-depth data bit-depth only.
Sourcepub fn create_transform_12bit(
&self,
src_layout: Layout,
dst_pr: &ColorProfile,
dst_layout: Layout,
options: TransformOptions,
) -> Result<Box<Transform16BitExecutor>, CmsError>
pub fn create_transform_12bit( &self, src_layout: Layout, dst_pr: &ColorProfile, dst_layout: Layout, options: TransformOptions, ) -> Result<Box<Transform16BitExecutor>, CmsError>
Creates transform between source and destination profile Use for 12 bit-depth data bit-depth only.
Sourcepub fn create_transform_10bit(
&self,
src_layout: Layout,
dst_pr: &ColorProfile,
dst_layout: Layout,
options: TransformOptions,
) -> Result<Box<Transform16BitExecutor>, CmsError>
pub fn create_transform_10bit( &self, src_layout: Layout, dst_pr: &ColorProfile, dst_layout: Layout, options: TransformOptions, ) -> Result<Box<Transform16BitExecutor>, CmsError>
Creates transform between source and destination profile Use for 10 bit-depth data bit-depth only.
Sourcepub fn create_transform_f32(
&self,
src_layout: Layout,
dst_pr: &ColorProfile,
dst_layout: Layout,
options: TransformOptions,
) -> Result<Box<TransformF32BitExecutor>, CmsError>
pub fn create_transform_f32( &self, src_layout: Layout, dst_pr: &ColorProfile, dst_layout: Layout, options: TransformOptions, ) -> Result<Box<TransformF32BitExecutor>, CmsError>
Creates transform between source and destination profile
Data has to be normalized into [0, 1] range.
ICC profiles and LUT tables do not exist in infinite precision.
Thus, this implementation considers f32
as 14-bit values.
Floating point transformer works in extended mode, that means returned data might be negative
or more than 1.
Sourcepub fn create_transform_f64(
&self,
src_layout: Layout,
dst_pr: &ColorProfile,
dst_layout: Layout,
options: TransformOptions,
) -> Result<Box<TransformF64BitExecutor>, CmsError>
pub fn create_transform_f64( &self, src_layout: Layout, dst_pr: &ColorProfile, dst_layout: Layout, options: TransformOptions, ) -> Result<Box<TransformF64BitExecutor>, CmsError>
Creates transform between source and destination profile
Data has to be normalized into [0, 1] range.
ICC profiles and LUT tables do not exist in infinite precision.
Thus, this implementation considers f64
as 16-bit values.
Floating point transformer works in extended mode, that means returned data might be negative
or more than 1.
Sourcepub fn create_transform_8bit(
&self,
src_layout: Layout,
dst_pr: &ColorProfile,
dst_layout: Layout,
options: TransformOptions,
) -> Result<Box<Transform8BitExecutor>, CmsError>
pub fn create_transform_8bit( &self, src_layout: Layout, dst_pr: &ColorProfile, dst_layout: Layout, options: TransformOptions, ) -> Result<Box<Transform8BitExecutor>, CmsError>
Creates transform between source and destination profile Only 8 bit is supported.
Source§impl ColorProfile
impl ColorProfile
Sourcepub fn build_8bit_lin_table(
&self,
trc: &Option<ToneReprCurve>,
) -> Result<Box<[f32; 256]>, CmsError>
pub fn build_8bit_lin_table( &self, trc: &Option<ToneReprCurve>, ) -> Result<Box<[f32; 256]>, CmsError>
Produces LUT for 8 bit tone linearization
Sourcepub fn build_gray_linearize_table<T: PointeeSizeExpressible, const N: usize, const BIT_DEPTH: usize>(
&self,
) -> Result<Box<[f32; N]>, CmsError>
pub fn build_gray_linearize_table<T: PointeeSizeExpressible, const N: usize, const BIT_DEPTH: usize>( &self, ) -> Result<Box<[f32; N]>, CmsError>
Produces LUT for Gray transfer curve with N depth
Sourcepub fn build_r_linearize_table<T: PointeeSizeExpressible, const N: usize, const BIT_DEPTH: usize>(
&self,
use_cicp: bool,
) -> Result<Box<[f32; N]>, CmsError>
pub fn build_r_linearize_table<T: PointeeSizeExpressible, const N: usize, const BIT_DEPTH: usize>( &self, use_cicp: bool, ) -> Result<Box<[f32; N]>, CmsError>
Produces LUT for Red transfer curve with N depth
Sourcepub fn build_g_linearize_table<T: PointeeSizeExpressible, const N: usize, const BIT_DEPTH: usize>(
&self,
use_cicp: bool,
) -> Result<Box<[f32; N]>, CmsError>
pub fn build_g_linearize_table<T: PointeeSizeExpressible, const N: usize, const BIT_DEPTH: usize>( &self, use_cicp: bool, ) -> Result<Box<[f32; N]>, CmsError>
Produces LUT for Green transfer curve with N depth
Sourcepub fn build_b_linearize_table<T: PointeeSizeExpressible, const N: usize, const BIT_DEPTH: usize>(
&self,
use_cicp: bool,
) -> Result<Box<[f32; N]>, CmsError>
pub fn build_b_linearize_table<T: PointeeSizeExpressible, const N: usize, const BIT_DEPTH: usize>( &self, use_cicp: bool, ) -> Result<Box<[f32; N]>, CmsError>
Produces LUT for Blue transfer curve with N depth
Sourcepub fn build_8bit_gamma_table(
&self,
trc: &Option<ToneReprCurve>,
use_cicp: bool,
) -> Result<Box<[u16; 65536]>, CmsError>
pub fn build_8bit_gamma_table( &self, trc: &Option<ToneReprCurve>, use_cicp: bool, ) -> Result<Box<[u16; 65536]>, CmsError>
Build gamma table for 8 bit depth Only 4092 first bins are used and values scaled in 0..255
Sourcepub fn build_10bit_gamma_table(
&self,
trc: &Option<ToneReprCurve>,
use_cicp: bool,
) -> Result<Box<[u16; 65536]>, CmsError>
pub fn build_10bit_gamma_table( &self, trc: &Option<ToneReprCurve>, use_cicp: bool, ) -> Result<Box<[u16; 65536]>, CmsError>
Build gamma table for 10 bit depth Only 8192 first bins are used and values scaled in 0..1023
Sourcepub fn build_12bit_gamma_table(
&self,
trc: &Option<ToneReprCurve>,
use_cicp: bool,
) -> Result<Box<[u16; 65536]>, CmsError>
pub fn build_12bit_gamma_table( &self, trc: &Option<ToneReprCurve>, use_cicp: bool, ) -> Result<Box<[u16; 65536]>, CmsError>
Build gamma table for 12 bit depth Only 16384 first bins are used and values scaled in 0..4095
Sourcepub fn build_16bit_gamma_table(
&self,
trc: &Option<ToneReprCurve>,
use_cicp: bool,
) -> Result<Box<[u16; 65536]>, CmsError>
pub fn build_16bit_gamma_table( &self, trc: &Option<ToneReprCurve>, use_cicp: bool, ) -> Result<Box<[u16; 65536]>, CmsError>
Build gamma table for 16 bit depth Only 16384 first bins are used and values scaled in 0..65535
Sourcepub fn build_gamma_table<T: Default + Copy + 'static + PointeeSizeExpressible + GammaLutInterpolate, const BUCKET: usize, const N: usize, const BIT_DEPTH: usize>(
&self,
trc: &Option<ToneReprCurve>,
use_cicp: bool,
) -> Result<Box<[T; BUCKET]>, CmsError>
pub fn build_gamma_table<T: Default + Copy + 'static + PointeeSizeExpressible + GammaLutInterpolate, const BUCKET: usize, const N: usize, const BIT_DEPTH: usize>( &self, trc: &Option<ToneReprCurve>, use_cicp: bool, ) -> Result<Box<[T; BUCKET]>, CmsError>
Builds gamma table checking CICP for Transfer characteristics first.
Trait Implementations§
Source§impl Clone for ColorProfile
impl Clone for ColorProfile
Source§fn clone(&self) -> ColorProfile
fn clone(&self) -> ColorProfile
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more