Harlequin RIP SDK
cmm_littlecms.c File Reference

CMM Implementation of the interface to the LittleCMS library. More...

#include "lcms2.h"
#include "cmm_littlecms.h"
#include "cmm_littlecmspriv.h"
#include "cmm_common.h"
#include "hqspin.h"

Data Structures

struct  LCMS_TRANSFORM
 Description of a transform specific to the LittleCMS example module. More...
 

Typedefs

typedef struct LCMS_TRANSFORM LCMS_TRANSFORM
 Description of a transform specific to the LittleCMS example module.
 

Functions

static sw_cmm_result lcms_construct (sw_cmm_instance *instance)
 Construct an instance of the sw_cmm_api interface. More...
 
sw_cmm_apilcms_getInstance ()
 Return the singleton instance of a sw_cmm_api object containing details specific to the LittleCMS CMM example module. More...
 
sw_cmm_result lcms_open_profile (sw_cmm_instance *instance, sw_blob_instance *ICC_profile, sw_cmm_profile *handle)
 Create an internal profile structure for ICC profile data stored in memory. Required for use by lcms_open_transform(). More...
 
void lcms_close_profile (sw_cmm_instance *instance, sw_cmm_profile profile)
 Close a profile with a handle previously created with lcms_open_profile(). More...
 
static HqBool isSupportedColorSpace (cmsHPROFILE hProfile, HqBool usePCS)
 Determine whether the specified color space is supported in this implementation. More...
 
static cmsUInt32Number getFormatFromProfile (cmsHPROFILE hProfile, HqBool usePCS)
 Generate a LCMS color space format value. More...
 
static uint32 getChannelCountFromProfile (cmsHPROFILE hProfile, HqBool usePCS)
 Find the number of color channels used in the specified profile. More...
 
static int getLCMSRenderingIntent (int32 nRIPIntent)
 Convert a rendering intent from the CMM API into its LCMS equivalent. More...
 
sw_cmm_result lcms_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)
 Create a transform structure. More...
 
void lcms_close_transform (sw_cmm_instance *instance, sw_cmm_transform transform)
 Close a transform previously opened with lcms_open_transform(). More...
 
sw_cmm_result lcms_invoke_transform (sw_cmm_instance *instance, sw_cmm_transform transform, float *input_data, float *output_data, uint32 num_pixels)
 Use the specified transform to adjust color data. More...
 

Variables

static sw_cmm_api gImplementation
 Singleton implementation describing this alternate CMM.
 

Detailed Description

CMM Implementation of the interface to the LittleCMS library.

Function Documentation

◆ getChannelCountFromProfile()

static uint32 getChannelCountFromProfile ( cmsHPROFILE  hProfile,
HqBool  usePCS 
)
static

Find the number of color channels used in the specified profile.

For example: RGB => 3 channels, CMYK => 4 channels.

Parameters
hProfileAn ICC profile handle.
usePCSTRUE iff looking at the output space of a devicelink profile.
Returns
The number of channels used in the profile's device space.

◆ getFormatFromProfile()

static cmsUInt32Number getFormatFromProfile ( cmsHPROFILE  hProfile,
HqBool  usePCS 
)
static

Generate a LCMS color space format value.

This function is used to help determine the format of the pixel data used in the transform.

Parameters
hProfileAn ICC profile handle.
usePCSTRUE iff looking at the output space of a devicelink profile.
Returns
A value representing a LCMS color space.

◆ getLCMSRenderingIntent()

static int getLCMSRenderingIntent ( int32  nRIPIntent)
static

Convert a rendering intent from the CMM API into its LCMS equivalent.

As the CMM API supports more rendering intents than LittleCMS, this is not always a one-to-one mapping.

Parameters
nRIPIntentThe rendering intent as specified through the CMM API.
Returns
A LCMS rendering intent value.

◆ isSupportedColorSpace()

static HqBool isSupportedColorSpace ( cmsHPROFILE  hProfile,
HqBool  usePCS 
)
static

Determine whether the specified color space is supported in this implementation.

Parameters
hProfileAn ICC profile handle.
usePCSTRUE iff looking at the output space of a devicelink profile.
Returns
TRUE if the color space is supported, FALSEotherwise.