Struct lcms2::Profile
[−]
[src]
pub struct Profile<Context = GlobalContext> { /* fields omitted */ }
An ICC color profile
Methods
impl Profile<GlobalContext>
[src]
These are the basic functions on opening profiles.
For simpler operation, you must open two profiles using new_file
, and then create a transform with these open profiles with Transform
.
Using this transform you can color correct your bitmaps.
pub fn new_icc(data: &[u8]) -> LCMSResult<Self>
[src]
Parse ICC profile from the in-memory array
pub fn new_file<P: AsRef<Path>>(path: P) -> Result<Self>
[src]
Load ICC profile file from disk
pub fn new_srgb() -> Self
[src]
Create an ICC virtual profile for sRGB space. sRGB is a standard RGB color space created cooperatively by HP and Microsoft in 1996 for use on monitors, printers, and the Internet.
pub fn new_rgb(
white_point: &CIExyY,
primaries: &CIExyYTRIPLE,
transfer_function: &[&ToneCurve]
) -> LCMSResult<Self>
[src]
white_point: &CIExyY,
primaries: &CIExyYTRIPLE,
transfer_function: &[&ToneCurve]
) -> LCMSResult<Self>
This function creates a display RGB profile based on White point, primaries and transfer functions. It populates following tags; this conform a standard RGB Display Profile, and then I add (As per addendum II) chromaticity tag.
- ProfileDescriptionTag
- MediaWhitePointTag
- RedColorantTag
- GreenColorantTag
- BlueColorantTag
- RedTRCTag
- GreenTRCTag
- BlueTRCTag
- Chromatic adaptation Tag
- ChromaticityTag
pub fn new_gray(white_point: &CIExyY, curve: &ToneCurve) -> LCMSResult<Self>
[src]
This function creates a gray profile based on White point and transfer function. It populates following tags; this conform a standard gray display profile.
- ProfileDescriptionTag
- MediaWhitePointTag
- GrayTRCTag
pub fn new_xyz() -> Self
[src]
Creates a XYZ XYZ identity, marking it as v4 ICC profile. WhitePoint used in Absolute colorimetric intent is D50.
pub fn new_null() -> Self
[src]
Creates a fake NULL profile. This profile return 1 channel as always 0. Is useful only for gamut checking tricks.
pub fn new_placeholder() -> Self
[src]
Creates an empty profile object, ready to be populated by the programmer.
WARNING: The obtained profile without adding any information is not directly useable.
pub fn ink_limiting(
color_space: ColorSpaceSignature,
limit: f64
) -> LCMSResult<Self>
[src]
color_space: ColorSpaceSignature,
limit: f64
) -> LCMSResult<Self>
This is a devicelink operating in CMYK for ink-limiting. Currently only cmsSigCmykData is supported. Limit: Amount of ink limiting in % (0..400%)
pub fn new_device_link<F, T>(
transform: &Transform<F, T>,
version: f64,
flags: Flags
) -> LCMSResult<Self>
[src]
transform: &Transform<F, T>,
version: f64,
flags: Flags
) -> LCMSResult<Self>
Generates a device-link profile from a given color transform. This profile can then be used by any other function accepting profile handle. Depending on the specified version number, the implementation of the devicelink may vary. Accepted versions are in range 1.0…4.3
impl<Ctx: Context> Profile<Ctx>
[src]
pub fn icc(&self) -> LCMSResult<Vec<u8>>
[src]
Create ICC file in memory buffer
pub fn device_class(&self) -> ProfileClassSignature
[src]
Gets the device class signature from profile header.
pub fn set_device_class(&mut self, cls: ProfileClassSignature)
[src]
Sets the device class signature in profile header.
pub fn encoded_icc_version(&self) -> u32
[src]
Returns the profile ICC version in the same format as it is stored in the header.
pub fn set_encoded_icc_version(&self, v: u32)
[src]
pub fn header_attributes(&self) -> u64
[src]
Gets the attribute flags. Currently defined values correspond to the low 4 bytes of the 8 byte attribute quantity.
Reflective
Transparency
Glossy
Matte
pub fn set_header_attributes(&mut self, flags: u64)
[src]
Sets the attribute flags in the profile header.
pub fn header_creator(&self) -> u32
[src]
pub fn header_flags(&self) -> u32
[src]
Get header flags of given ICC profile object.
The profile flags field does contain flags to indicate various hints for the CMM such as distributed processing and caching options. The least-significant 16 bits are reserved for the ICC. Flags in bit positions 0 and 1 shall be used as indicated in Table 7 of LCMS PDF.
pub fn set_header_flags(&mut self, flags: u32)
[src]
Sets header flags of given ICC profile object. Valid flags are defined in Table 7 of LCMS PDF.
pub fn header_manufacturer(&self) -> u32
[src]
Returns the manufacturer signature as described in the header.
This funcionality is widely superseded by the manufaturer tag. Of use only in elder profiles.
pub fn set_header_manufacturer(&mut self, m: u32)
[src]
: This funcionality is widely superseded by the manufaturer tag
Sets the manufacturer signature in the header.
This funcionality is widely superseded by the manufaturer tag. Of use only in elder profiles.
pub fn header_model(&self) -> u32
[src]
Returns the model signature as described in the header.
This funcionality is widely superseded by the model tag. Of use only in elder profiles.
pub fn set_header_model(&mut self, model: u32)
[src]
: This funcionality is widely superseded by the model tag
Sets the model signature in the profile header.
This funcionality is widely superseded by the model tag. Of use only in elder profiles.
pub fn header_rendering_intent(&self) -> Intent
[src]
Gets the profile header rendering intent.
From the ICC spec: “The rendering intent field shall specify the rendering intent which should be used (or, in the case of a Devicelink profile, was used) when this profile is (was) combined with another profile. In a sequence of more than two profiles, it applies to the combination of this profile and the next profile in the sequence and not to the entire sequence. Typically, the user or application will set the rendering intent dynamically at runtime or embedding time. Therefore, this flag may not have any meaning until the profile is used in some context, e.g. in a Devicelink or an embedded source profile.”
pub fn set_header_rendering_intent(&mut self, intent: Intent)
[src]
pub fn pcs(&self) -> ColorSpaceSignature
[src]
Gets the profile connection space used by the given profile, using the ICC convention.
pub fn set_pcs(&mut self, pcs: ColorSpaceSignature)
[src]
Sets the profile connection space signature in profile header, using ICC convention.
pub fn info(&self, info: InfoType, locale: Locale) -> Option<String>
[src]
pub fn version(&self) -> f64
[src]
Returns the profile ICC version. The version is decoded to readable floating point format.
pub fn set_version(&mut self, ver: f64)
[src]
Sets the ICC version in profile header. The version is given to this function as a float n.m
pub fn tag_signatures(&self) -> Vec<TagSignature>
[src]
pub fn detect_black_point(&self, intent: Intent) -> Option<CIEXYZ>
[src]
pub fn detect_destination_black_point(&self, intent: Intent) -> Option<CIEXYZ>
[src]
pub fn detect_tac(&self) -> f64
[src]
pub fn color_space(&self) -> ColorSpaceSignature
[src]
Gets the color space used by the given profile, using the ICC convention.
pub fn set_color_space(&mut self, sig: ColorSpaceSignature)
[src]
Sets the profile connection space signature in profile header, using ICC convention.
pub fn is_clut(&self, intent: Intent, used_direction: u32) -> bool
[src]
pub fn is_intent_supported(&self, intent: Intent, used_direction: u32) -> bool
[src]
pub fn is_matrix_shaper(&self) -> bool
[src]
pub fn has_tag(&self, sig: TagSignature) -> bool
[src]
pub fn read_tag(&self, sig: TagSignature) -> Tag
[src]
pub fn write_tag(&mut self, sig: TagSignature, tag: Tag) -> bool
[src]
pub fn profile_id(&self) -> ProfileID
[src]
Retrieves the Profile ID stored in the profile header.
pub fn set_default_profile_id(&mut self)
[src]
Computes a MD5 checksum and stores it as Profile ID in the profile header.
pub fn set_profile_id(&mut self, id: ProfileID)
[src]
impl<Ctx: Context> Profile<Ctx>
[src]
Per-context functions that can be used with a ThreadContext
pub fn new_icc_context(context: Ctx, data: &[u8]) -> LCMSResult<Self>
[src]
pub fn new_file_context<P: AsRef<Path>>(context: Ctx, path: P) -> Result<Self>
[src]
pub fn new_srgb_context(context: Ctx) -> Self
[src]
pub fn new_rgb_context(
context: Ctx,
white_point: &CIExyY,
primaries: &CIExyYTRIPLE,
transfer_function: &[&ToneCurve]
) -> LCMSResult<Self>
[src]
context: Ctx,
white_point: &CIExyY,
primaries: &CIExyYTRIPLE,
transfer_function: &[&ToneCurve]
) -> LCMSResult<Self>
pub fn new_gray_context(
context: Ctx,
white_point: &CIExyY,
curve: &ToneCurve
) -> LCMSResult<Self>
[src]
context: Ctx,
white_point: &CIExyY,
curve: &ToneCurve
) -> LCMSResult<Self>
pub unsafe fn new_linearization_device_link_context(
context: Ctx,
color_space: ColorSpaceSignature,
curves: &[ToneCurveRef]
) -> LCMSResult<Self>
[src]
context: Ctx,
color_space: ColorSpaceSignature,
curves: &[ToneCurveRef]
) -> LCMSResult<Self>
This is a devicelink operating in the target colorspace with as many transfer functions as components. Number of tone curves must be sufficient for the color space.
pub fn new_bchsw_abstract_context(
context: Ctx,
lut_points: usize,
bright: f64,
contrast: f64,
hue: f64,
saturation: f64,
temp_src_dst: Option<(u32, u32)>
) -> LCMSResult<Self>
[src]
context: Ctx,
lut_points: usize,
bright: f64,
contrast: f64,
hue: f64,
saturation: f64,
temp_src_dst: Option<(u32, u32)>
) -> LCMSResult<Self>
Creates an abstract devicelink operating in Lab for Bright/Contrast/Hue/Saturation and white point translation. White points are specified as temperatures ºK
nLUTPoints : Resulting color map resolution Bright: Bright increment. May be negative Contrast : Contrast increment. May be negative. Hue : Hue displacement in degree. Saturation: Saturation increment. May be negative TempSrc: Source white point temperature TempDest: Destination white point temperature. To prevent white point adjustment, set Temp to None
pub fn ink_limiting_context(
context: Ctx,
color_space: ColorSpaceSignature,
limit: f64
) -> LCMSResult<Self>
[src]
context: Ctx,
color_space: ColorSpaceSignature,
limit: f64
) -> LCMSResult<Self>
This is a devicelink operating in CMYK for ink-limiting. Currently only cmsSigCmykData is supported. Limit: Amount of ink limiting in % (0..400%)
pub fn new_xyz_context(context: Ctx) -> Self
[src]
Creates a XYZ XYZ identity, marking it as v4 ICC profile. WhitePoint used in Absolute colorimetric intent is D50.
pub fn new_null_context(context: Ctx) -> Self
[src]
Creates a fake NULL profile. This profile return 1 channel as always 0. Is useful only for gamut checking tricks.
pub fn new_lab2_context(context: Ctx, white_point: &CIExyY) -> LCMSResult<Self>
[src]
Creates a Lab Lab identity, marking it as v2 ICC profile.
Adjustments for accomodating PCS endoing shall be done by Little CMS when using this profile.
pub fn new_lab4_context(context: Ctx, white_point: &CIExyY) -> LCMSResult<Self>
[src]
Creates a Lab Lab identity, marking it as v4 ICC profile.