Skip to main content
Skip table of contents

(v13) Transform management with an alternate CMM

This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP


The Harlequin RIP will use the functions in this section to manage and invoke transforms composed of sequences of profiles.

A color transform is a concatenation of multiple ICC profiles in a sequence, with the condition that the sequence does not begin or end with the PCS. Where a profile may convert colors either into or out of the PCS, the conversion used is determined by the profile’s position in the sequence. Possible instances of a transform are:

  • one Input profile and one Output profile.
  • a single devicelink profile.
  • one input and two output profiles (for emulation workflows).
  • one input, one abstract, and one output profile (for special effects).

Prior to creating a transform, the RIP ensures compatibility with the capabilities of the alternate CMM, as indicated by its optional capabilities. If the transform is not compatible, color conversion is attempted using the built-in CMM. If the built-in CMM also fails, the job is aborted.

In those workflows where a sequence of profiles are configured and the overall sequence is incompatible as a single transform, the sequence is broken down into multiple subtransforms. Those which are compatible are processed by the alternate CMM, with the remainder processed by the built-in CMM.

The above definition of a transform may be at variance with the corresponding definition used by an individual alternate CMM, for example, an alternate CMM may not accept devicelink profiles within a sequence of input output devicelink. If so, it is the responsibility of the OEM glue code to break down the transform supplied by the RIP into sub-transforms acceptable to the alternate CMM. In this example, the OEM glue code divides the transform into two sub-transforms, one containing the input output profile pair, and one containing the devicelink.

open_transform

Create a color transformation comprising one or more alternate CMM profiles. See also open_transform2

The open_transform() prototype takes a CMM instance pointer, returns a

sw_cmm_result , and stores the transform handle into an output parameter.

This is an array of length num_profiles profile handles of type sw_cmm_profile , each of which refers to ICC or custom colorspace profiles in the same sequence as required by the transform. For example, for a standard input Output profile sequence there will be two profiles; for an emulation workflow, where a press will be emulated on a proofing device, there will be three profiles.


TEXT
                      sw_cmm_result (RIPCALL *open_transform)
                                      (sw_cmm_instance *instance, sw_cmm_profile profiles[], uint32 num_profiles,
                                      int32 intents[],
                                      HqBool black_point_compensations[], uint32 *num_input_channels,
                                      uint32 *num_output_channels, sw_cmm_transform *handle);


.

instance

The alternate CMM instance owning the profiles.

profiles

An array of num_profiles profile handles, returned by calls to

num_profiles

open_profile() or open_custom_colorspace(). The number of profiles in the transform chain.

intents

An array of length num_profiles-1 specifying the rendering intents use for color conversions between adjacent profiles in the \a profiles parameter.

black_point_compensations

An array of length num_profiles-1 containing Boolean flags, indicating if black point compensation is performed when converting colors between adjacent profiles in the profiles parameter.

num_input_channels

A location for the alternate CMM to fill in the number of color channels in the input space of the first profile in the transform.

num_output_channels

A location for the alternate CMM to fill in the number of color channels in the output space of the last profile in the transform.

handle

A pointer in which a CMM transform handle is stored by the alternate CMM implementation. This handle will be used to refer to the transform by close_transform () and invoke_transform () methods.

It returns SW_CMM_SUCCESS if the transform was successfully opened, in which case a nonNULL transform pointer should have been stored in handle. If the profile could not be opened, one of the sw_cmm_result error codes is returned. If a valid transform handle is returned, the close_transform () method will be called to destroy the profile later.

close_transform

The close_transform() prototype takes a CMM instance pointer as well as the transform handle, and does not return a value.


TEXT
                      void (RIPCALL *close_transform)(sw_cmm_instance *instance,
                                        sw_cmm_transform transform)


.

instance

The alternate CMM instance owning the color transform.

transform

A valid transform handle created by an open_transform() call on the same alternate CMM instance. The alternate CMM implementation should discard any resources associated with the transform.

invoke_transform

The invoke_transform() prototype takes a CMM instance pointer, and returns a


TEXT
                      sw_cmm_result.
                      sw_cmm_result (RIPCALL *invoke_transform)
                                      (sw_cmm_instance *instance, sw_cmm_transform transform, float *input_data,
                                      float *output_data,
                                      uint32 num_pixels);


instance

The alternate CMM instance owning the color transform.

transform

A valid transform handle created by an open_transform() call on the same alternate CMM instance.

input_data

An array of num_pixels sets of pixel-interleaved color values to transform. Colors are interleaved in the order specified by the input space of the first profile in the transform.

output_data

An array in which to store num_pixels sets of pixel-interleaved color values. Colors are interleaved in the order specified by the output space of the last profile in the transform.

num_pixels

The number of sets of input pixel color values to convert from the input space to the output space of the transform.

Returns SW_CMM_SUCCESS if the invocation succeeded or one of the sw_cmm_result error codes. In all cases, both the input and output data should be pixel interleaved with each color value contained in a 32-bit IEEE floating value. The interleaving of the input data is in the same order as that expected by the first profile in a transform and the interleaving of the output data should be in the same order as produced by the last profile in the transform. It is the responsibility of the alternate CMM to marshal the data into and out of the format required for its internal use. As an example, if five pixels of RGB data were to be converted to CMYK, the RIP will arrange the input data as follows:

RGBRGBRGBRGBRGB

and invoke_transform will produce this arrangement of output data:

CMYKCMYKCMYKCMYKCMYK

The number of channels for each pixel is derived from the first and last profiles in the transform as returned by open_transform.

The memory referenced by input_data and output_data is managed by the RIP and can be assumed to contain valid memory for the appropriate amount of data. The size, in bytes, allocated by the RIP to each is:


TEXT
                            input_data num_pixels * num_input_channels * sizeof(float)
                            output_data num_pixels * num_output_channels * sizeof(float)


The function returns TRUE for success, FALSE for error.

open_transform2

From v11.0r3 The CMM API has been updated to version SW_CMM_API_VERSION_20160819. The interface has been extended with an open_transform2() method which behaves similarly to open_transform but passes the additional information of object type, color model, and whether the transform is producing output color or whether it is part of transparency compositing.


TEXT
                      sw_cmm_result (RIPCALL *open_transform2)
                                      (sw_cmm_instance *instance, sw_cmm_profile profiles[],
                                      uint32 num_profiles,
                                      int32 intents[],
                                      HqBool black_point_compensations[],
                                      HqBool  compositing, sw_cmm_object_type object_type, sw_cmm_color_model color_model uint32 *num_input_channels, uint32 *num_output_channels, sw_cmm_transform *handle);


If the alternate CMM implements open_transform2(), it will be called in preference to open_transform().

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.