Harlequin RIP SDK

Simple example showing how to create and use custom color spaces using the core color management module interface. More...

#include "std.h"
#include "skinkit.h"
#include "skinmon.h"
#include "swccs.h"
#include "swdataapi.h"
#include "cmm_example.h"
#include "cmm_common.h"

Data Structures

struct  cmmParams
 Internal structure holding the optional params used by this CCS example. More...
 
struct  CCS_TRANSFORM
 Description of a transform specific to the Custom Color Space example module. More...
 
struct  CCS_INSTANCE
 Subclass the instance to hold params controlling how to apply some of the color spaces defined in this example. This follows the recommendation for sw_ccs_instance. More...
 

Typedefs

typedef struct cmmParams cmmParams
 Internal structure holding the optional params used by this CCS example.
 
typedef void(* ColorMappingFunc) (float colorIn[], float colorOut[], struct cmmParams *cmmParams)
 
typedef struct CCS_TRANSFORM CCS_TRANSFORM
 Description of a transform specific to the Custom Color Space example module.
 
typedef struct CCS_INSTANCE CCS_INSTANCE
 Subclass the instance to hold params controlling how to apply some of the color spaces defined in this example. This follows the recommendation for sw_ccs_instance.
 

Functions

static sw_ccs_result ccs_construct (sw_ccs_instance *instance)
 Construct an instance of the sw_cmm_api interface. More...
 
static sw_ccs_custom_colorspaceccs_declare_custom_colorspace (sw_ccs_instance *instance, uint32 index)
 Declare a custom color space to the RIP. More...
 
static sw_ccs_result ccs_open_transform (sw_ccs_instance *instance, uint32 index, sw_cmm_object_type object_type, sw_cmm_color_model color_model, uint32 *num_input_channels, uint32 *num_output_channels, sw_ccs_transform *handle)
 Create a transform structure. More...
 
static void ccs_close_transform (sw_ccs_instance *instance, sw_ccs_transform transform)
 Close a transform previously opened with ccs_open_transform(). More...
 
static sw_ccs_result ccs_invoke_transform (sw_ccs_instance *instance, sw_ccs_transform transform, float *input_data, float *output_data, uint32 num_pixels)
 Use the specified transform to adjust color data. More...
 
sw_ccs_apiexampleccs_getInstance (void)
 Return the singleton instance of a sw_cmm_api object containing details specific to the Custom Color Space example module. More...
 
static void initParams (CCS_INSTANCE *ccsInstance)
 Helper function for ccs_construct(). It initialises the params in ccsInstance->cmmParams.
 
static sw_ccs_result getParams (CCS_INSTANCE *ccsInstance, sw_datum *params)
 Helper function for ccs_construct(). It extracts the params from the params parameter, and stores them in ccsInstance->cmmParams. This translates from the sw_datum form, which is a representation of the original PostScript dictionary, to the more standard "C" structure. The keys processed match the elements of struct cmmParams. If the type of the value for each key doesn't match the expected type, or if unknown keys are present, a failure code is returned. Otherwise SW_CMM_SUCCESS is returned.
 
static void invertRGB (float rgbIn[], float rgbOut[], cmmParams *cmmParams)
 Function to invert an RGB color value. More...
 
static void brightenRGB (float rgbIn[], float rgbOut[], cmmParams *cmmParams)
 Function to brighten an RGB color value. More...
 
static void passthroughRGB (float rgbIn[], float rgbOut[], cmmParams *cmmParams)
 Function to pass through an RGB color value. More...
 
static void maxinkCMYK (float cmykIn[], float cmykOut[], cmmParams *cmmParams)
 Function to apply simple 100% maximum ink function to an CMYK color value. More...
 
static void MtoNSpots (float sixIn[], float sevenOut[], cmmParams *cmmParams)
 Function to convert from 6 to 7 colorants. Intended for transferring color values for set of input colorants in the non-standard order of: More...
 

Variables

static sw_ccs_custom_colorspace gCCSArray []
 Array of supported custom color spaces.
 
static sw_ccs_api gCCSExampleImplementation
 Singleton instance describing this alternate CMM.
 

Detailed Description

Simple example showing how to create and use custom color spaces using the core color management module interface.

Typedef Documentation

◆ ColorMappingFunc

typedef void(* ColorMappingFunc) (float colorIn[], float colorOut[], struct cmmParams *cmmParams)

Color modifying callback function.

Function Documentation

◆ brightenRGB()

static void brightenRGB ( float  rgbIn[],
float  rgbOut[],
cmmParams cmmParams 
)
static

Function to brighten an RGB color value.

Parameters
[in]rgbInAn array containing a single RGB input value.
[out]rgbOutAn array containing a single RGB output value.
[in]cmmParamsStructure containing optional params for the module.

◆ invertRGB()

static void invertRGB ( float  rgbIn[],
float  rgbOut[],
cmmParams cmmParams 
)
static

Function to invert an RGB color value.

Parameters
[in]rgbInAn array containing a single RGB input value.
[out]rgbOutAn array containing a single RGB output value.
[in]cmmParamsStructure containing optional params for the module.

◆ maxinkCMYK()

static void maxinkCMYK ( float  cmykIn[],
float  cmykOut[],
cmmParams cmmParams 
)
static

Function to apply simple 100% maximum ink function to an CMYK color value.

Parameters
[in]cmykInAn array containing a single CMYK input value.
[out]cmykOutAn array containing a single CMYK output value.
[in]cmmParamsStructure containing optional params for the module.

◆ MtoNSpots()

static void MtoNSpots ( float  sixIn[],
float  sevenOut[],
cmmParams cmmParams 
)
static

Function to convert from 6 to 7 colorants. Intended for transferring color values for set of input colorants in the non-standard order of:

[/S1 /S2 /Black /Cyan /Magenta /Yellow]

to

[/Cyan /Magenta /Yellow /Black /S1 /S2 /S3]

along with a scaling of the values to 70% of their value to make it obvious that the transform is being applied. The example is deliberately very simple.

Parameters
[in]sixInAn array containing a single 6-component input value.
[out]sevenOutAn array containing a single 7-component output value.
[in]cmmParamsStructure containing optional params for the module.

◆ passthroughRGB()

static void passthroughRGB ( float  rgbIn[],
float  rgbOut[],
cmmParams cmmParams 
)
static

Function to pass through an RGB color value.

Parameters
[in]rgbInAn array containing a single RGB input value.
[out]rgbOutAn array containing a single RGB output value.
[in]cmmParamsStructure containing optional params for the module.