Struct lcms2::Transform [] [src]

pub struct Transform<InputPixelFormat, OutputPixelFormat, Context = GlobalContext, Flags = AllowCache> { /* fields omitted */ }

Conversion between two ICC profiles.

The transform ensures type safety and thread safety at compile time. To do this, it has a few generic types associated with it. Usually, you don't need to specify any of the generic parameters (like InputPixelFormat/OutputPixelFormat) explicitly, because they are inferred from calls to constructors and transform_pixels or transform_in_place.

If you get error such as:

cannot infer type for InputPixelFormat type annotations required: cannot resolve _: std::marker::Copy

then don't worry! Write some code that calls transform_pixels(), because this is the function that makes the type of the transform clear.

In case you need to store the transform in a struct or return from a function, the full type of Transform is:

This example is not tested
Transform<InputPixelFormat, OutputPixelFormat, Context = GlobalContext, Flags = AllowCache>

Thread-safety:

Methods

impl<InputPixelFormat: Copy + Clone, OutputPixelFormat: Copy + Clone> Transform<InputPixelFormat, OutputPixelFormat, GlobalContext, AllowCache>
[src]

[src]

Creates a color transform for translating bitmaps.

Basic, non-tread-safe version.

  • Input: Handle to a profile object capable to work in input direction
  • InputFormat: A bit-field format specifier
  • Output: Handle to a profile object capable to work in output direction
  • OutputFormat: A bit-field format specifier
  • Intent: Rendering intent

    See documentation of these types for more detail.

[src]

Non-thread-safe

[src]

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 cmsSetAlarmCodes
  • FLAGS_SOFTPROOFING: does emulate the Proofing device.

[src]

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, C> Transform<PixelFormat, PixelFormat, Ctx, C>
[src]

[src]

impl<InputPixelFormat: Copy + Clone, OutputPixelFormat: Copy + Clone, Ctx: Context> Transform<InputPixelFormat, OutputPixelFormat, Ctx, AllowCache>
[src]

[src]

impl<InputPixelFormat: Copy + Clone, OutputPixelFormat: Copy + Clone, Ctx: Context, Fl: CacheFlag> Transform<InputPixelFormat, OutputPixelFormat, Ctx, Fl>
[src]

[src]

This function translates bitmaps according of parameters setup when creating the color transform.

[src]

[src]

[src]

[src]

impl<InputPixelFormat: Copy + Clone, OutputPixelFormat: Copy + Clone, C> Transform<InputPixelFormat, OutputPixelFormat, GlobalContext, C>
[src]

[src]

Adaptation state for absolute colorimetric intent, on all but cmsCreateExtendedTransform.

See ThreadContext::adaptation_state()

[src]

Deprecated

: 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.

[src]

Deprecated

: 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()

[src]

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()

Trait Implementations

impl<'a, F, T, C: Send, Z> Send for Transform<F, T, C, Z>
[src]

impl<'a, F, T, C: Send> Sync for Transform<F, T, C, DisallowCache>
[src]

impl<F, T, C, L> Drop for Transform<F, T, C, L>
[src]

[src]

Executes the destructor for this type. Read more