The CMM examples share functions to call the sw_memory_api callback API provided by the RIP for allocation and deallocation.
More...
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.
◆ cmmegCheckExtraKeys()
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] | params | The dictionary that was originally passed to either setcustomcolorspacecmm or setalternatecmm. It is a sw_datum representation of the original PostScript dictionary. |
| [in] | paramsMatch | An array containing a list of the allowed keys for params. |
| [in] | paramsMatchLen | The number of keys in paramsMatch. |
| [in] | dataapi | An implementation pointer for access to the sw_datum values in this structure. |
- Returns
- TRUE if there are no unrecognised keys, otherwise FALSE.
◆ cmmegMemAlloc()
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] | instance | A sw_memory_instance pointer provided to by the RIP. |
| [in] | size | The size, in bytes, of the memory allocation request. |
- Returns
- A valid pointer to memory if the allocation succeeded,
NULL if the allocation failed.
◆ cmmegMemFree()
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] | instance | A sw_memory_instance pointer provided by the RIP. |
| [in] | memory | A 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. |