Struct lcms2::Transform
[−]
[src]
pub struct Transform<InputPixelFormat, OutputPixelFormat, Context = GlobalContext> { /* fields omitted */ }
Conversion between two ICC profiles
Usually you don't need to specify InputPixelFormat
/OutputPixelFormat
parameters explicitly.
They will be inferred from the call to transform_pixels
or transform_in_place
.
You might get "cannot infer type for InputPixelFormat
" error before you write calls to one of these functions.
Methods
impl<InputPixelFormat: Copy + Clone, OutputPixelFormat: Copy + Clone> Transform<InputPixelFormat, OutputPixelFormat, GlobalContext>
[src]
fn new(
input: &Profile,
in_format: PixelFormat,
output: &Profile,
out_format: PixelFormat,
intent: Intent
) -> LCMSResult<Self>
input: &Profile,
in_format: PixelFormat,
output: &Profile,
out_format: PixelFormat,
intent: Intent
) -> LCMSResult<Self>
Creates a color transform for translating bitmaps.
- Input: Handle to a profile object capable to work in input direction
- InputFormat: A bit-field format specifier as described in Formatters section.
- Output: Handle to a profile object capable to work in output direction
- OutputFormat: A bit-field format specifier as described in Formatters section.
- Intent: Rendering intent
fn new_flags(
input: &Profile,
in_format: PixelFormat,
output: &Profile,
out_format: PixelFormat,
intent: Intent,
flags: u32
) -> LCMSResult<Self>
input: &Profile,
in_format: PixelFormat,
output: &Profile,
out_format: PixelFormat,
intent: Intent,
flags: u32
) -> LCMSResult<Self>
fn new_proofing(
input: &Profile,
in_format: PixelFormat,
output: &Profile,
out_format: PixelFormat,
proofing: &Profile,
intent: Intent,
proofng_intent: Intent,
flags: u32
) -> LCMSResult<Self>
input: &Profile,
in_format: PixelFormat,
output: &Profile,
out_format: PixelFormat,
proofing: &Profile,
intent: Intent,
proofng_intent: Intent,
flags: u32
) -> LCMSResult<Self>
A proofing transform does emulate the colors that would appear as the image were rendered on a specific device. The obtained transform emulates the device described by the "Proofing" profile. Useful to preview final result without rendering to the physical medium.
That is, for example, with a proofing transform I can see how will look a photo of my little daughter if rendered on my HP printer. Since most printer profiles does include some sort of gamut-remapping, it is likely colors will not look as the original. Using a proofing transform, it can be done by using the appropriate function. Note that this is an important feature for final users, it is worth of all color-management stuff if the final media is not cheap.
To enable proofing and gamut check you need to include following flags:
FLAGS_GAMUTCHECK
: Color out of gamut are flagged to a fixed color defined by the function cmsSetAlarmCodesFLAGS_SOFTPROOFING
: does emulate the Proofing device.
fn new_multiprofile(
profiles: &[&Profile],
in_format: PixelFormat,
out_format: PixelFormat,
intent: Intent,
flags: u32
) -> LCMSResult<Self>
profiles: &[&Profile],
in_format: PixelFormat,
out_format: PixelFormat,
intent: Intent,
flags: u32
) -> LCMSResult<Self>
Multiprofile transforms
User passes in an array of handles to open profiles. The returned color transform do "smelt" all profiles in a single devicelink. Color spaces must be paired with the exception of Lab/XYZ, which can be interchanged.
impl<PixelFormat: Copy + Clone, Ctx: Context> Transform<PixelFormat, PixelFormat, Ctx>
[src]
fn transform_in_place(&self, srcdst: &mut [PixelFormat])
impl<InputPixelFormat: Copy + Clone, OutputPixelFormat: Copy + Clone, Ctx: Context> Transform<InputPixelFormat, OutputPixelFormat, Ctx>
[src]
fn transform_pixels(
&self,
src: &[InputPixelFormat],
dst: &mut [OutputPixelFormat]
)
&self,
src: &[InputPixelFormat],
dst: &mut [OutputPixelFormat]
)
This function translates bitmaps according of parameters setup when creating the color transform.
fn input_format(&self) -> PixelFormat
fn output_format(&self) -> PixelFormat
fn new_context(
context: Ctx,
input: &Profile<Ctx>,
in_format: PixelFormat,
output: &Profile<Ctx>,
out_format: PixelFormat,
intent: Intent
) -> LCMSResult<Self>
context: Ctx,
input: &Profile<Ctx>,
in_format: PixelFormat,
output: &Profile<Ctx>,
out_format: PixelFormat,
intent: Intent
) -> LCMSResult<Self>
fn new_flags_context(
context: Ctx,
input: &Profile<Ctx>,
in_format: PixelFormat,
output: &Profile<Ctx>,
out_format: PixelFormat,
intent: Intent,
flags: u32
) -> LCMSResult<Self>
context: Ctx,
input: &Profile<Ctx>,
in_format: PixelFormat,
output: &Profile<Ctx>,
out_format: PixelFormat,
intent: Intent,
flags: u32
) -> LCMSResult<Self>
fn new_proofing_context(
context: Ctx,
input: &Profile<Ctx>,
in_format: PixelFormat,
output: &Profile<Ctx>,
out_format: PixelFormat,
proofing: &Profile<Ctx>,
intent: Intent,
proofng_intent: Intent,
flags: u32
) -> LCMSResult<Self>
context: Ctx,
input: &Profile<Ctx>,
in_format: PixelFormat,
output: &Profile<Ctx>,
out_format: PixelFormat,
proofing: &Profile<Ctx>,
intent: Intent,
proofng_intent: Intent,
flags: u32
) -> LCMSResult<Self>
impl<InputPixelFormat: Copy + Clone, OutputPixelFormat: Copy + Clone> Transform<InputPixelFormat, OutputPixelFormat, GlobalContext>
[src]
fn global_adaptation_state() -> f64
Adaptation state for absolute colorimetric intent, on all but cmsCreateExtendedTransform.
See ThreadContext::adaptation_state()
fn set_global_adaptation_state(value: f64)
: Use ThreadContext::set_adaptation_state()
Sets adaptation state for absolute colorimetric intent, on all but cmsCreateExtendedTransform. Little CMS can handle incomplete adaptation states.
See ThreadContext::set_adaptation_state()
Degree on adaptation 0=Not adapted, 1=Complete adaptation, in-between=Partial adaptation.
fn set_global_alarm_codes(codes: [u16; 16])
: Use ThreadContext::set_alarm_codes()
Sets the global codes used to mark out-out-gamut on Proofing transforms. Values are meant to be encoded in 16 bits. AlarmCodes: Array [16] of codes. ALL 16 VALUES MUST BE SPECIFIED, set to zero unused channels.
See ThreadContext::set_alarm_codes()
fn global_alarm_codes() -> [u16; 16]
Gets the current global codes used to mark out-out-gamut on Proofing transforms. Values are meant to be encoded in 16 bits.
See ThreadContext::alarm_codes()