Harlequin RIP SDK
Common code for all CMM examples

The CMM examples share functions to call the sw_memory_api callback API provided by the RIP for allocation and deallocation. More...

Files

file  cmm_common.c
 Code common to all CMM examples.
 
file  cmm_common.h
 Header for code common to all CMM examples.
 

Functions

void * cmmegMemAlloc (sw_memory_instance *instance, size_t size)
 Allocate CMM memory. More...
 
void cmmegMemFree (sw_memory_instance *instance, void *memory)
 Release CMM memory. More...
 
HqBool cmmegCheckExtraKeys (sw_datum *params, sw_data_match paramsMatch[], int paramsMatchLen, sw_data_api *dataapi)
 Helper function for construct callbacks for both alternate CMMs and custom color space CMMs. It checks whether there are any unrecognised keys in the params dictionary that is optionally passed to CMMs. More...
 

Detailed Description

The CMM examples share functions to call the sw_memory_api callback API provided by the RIP for allocation and deallocation.

Note
This code should be used for reference purposes only.

Function Documentation

◆ cmmegCheckExtraKeys()

HqBool cmmegCheckExtraKeys ( sw_datum params,
sw_data_match  paramsMatch[],
int  paramsMatchLen,
sw_data_api dataapi 
)

Helper function for construct callbacks for both alternate CMMs and custom color space CMMs. It checks whether there are any unrecognised keys in the params dictionary that is optionally passed to CMMs.

Parameters
[in]paramsThe dictionary that was originally passed to either setcustomcolorspacecmm or setalternatecmm. It is a sw_datum representation of the original PostScript dictionary.
[in]paramsMatchAn array containing a list of the allowed keys for params.
[in]paramsMatchLenThe number of keys in paramsMatch.
[in]dataapiAn implementation pointer for access to the sw_datum values in this structure.
Returns
TRUE if there are no unrecognised keys, otherwise FALSE.

◆ cmmegMemAlloc()

void* cmmegMemAlloc ( sw_memory_instance instance,
size_t  size 
)

Allocate CMM memory.

A trampoline to sw_memory_api::alloc(). This function calls the sw_memory_api passed to the CMM API functions to allocate memory from the RIP.

Parameters
[in]instanceA sw_memory_instance pointer provided to by the RIP.
[in]sizeThe size, in bytes, of the memory allocation request.
Returns
A valid pointer to memory if the allocation succeeded, NULL if the allocation failed.

◆ cmmegMemFree()

void cmmegMemFree ( sw_memory_instance instance,
void *  memory 
)

Release CMM memory.

A trampoline to sw_memory_api::free(). This function calls the sw_memory_api passed to the CMM API functions to free memory to the RIP.

Parameters
[in]instanceA sw_memory_instance pointer provided by the RIP.
[in]memoryA pointer previously allocated by the alloc() method, which has not yet been freed. It is acceptable to pass NULL as the memory parameter, it will be ignored.