Chapter 6. Color Manipulation Module Management

The heart of a color management computation is the color manipulation module (CMM), which executes the transformation algorithm.When you create a transformation, you may use one of several CMMs, which are implemented as dynamic shared objects. The Coloratura CMS serves as a dispatcher between your application and the CMMs.

This chapter discusses the tools the Coloratura CMS provides to examine available CMMs. These tools allow you to determine which CMM to specify when you call cmsCreateTfm() (see “Creating a Transform: cmsCreateTfm()”). You may want to examine available CMMs, for example, if you do not want to use the default CMM to perform a transformation, or if you do not want to, or are unable to, use a CMM determined by the profiles in a transformation via CMM_USE_PROFILE_CMM (see “Creating a Transform: cmsCreateTfm()”).

These are the topics covered in this chapter:

Finding CMMs

The Coloratura CMS provides functions to identify the default CMM and to list all available CMMs. The data structure used to identify CMMs is an icSignature, which is declared in ic.h and described in the ICC Profile Format Specification.

Finding the Default CMM: cmsGetDefaultCmm()

A default CMM ships with the Coloratura CMS. To identify the current default CMM, call cmsGetDefaultCmm(), which returns an icSignature for the CMM. To obtain information about the CMM, you can call cmsGetCmmInfo(), discussed in “Getting Information About a CMM”.

  • This is the prototype for cmsGetDefaultCmm():

    int32  cmsGetDefaultCmm(CMSContext ctxt, icSignature *cmm);

  • These are the arguments of cmsGetDefaultCmm():


    The context initialized by cmsOpen().


    The identifier of the CMM.

Listing the Available CMMs: cmsGetCmmList()

The function cmsGetCmmList() supplies a list of available CMMs and the number of CMMs on the list. You may select from the list a preferred CMM to use when creating a transform. Recall that your application cannot use any CMM that you add after you call cmsOpen().

To obtain information about a particular CMM, you call cmsGetCmmInfo(), discussed in “Getting CMM Information: cmsGetCmmInfo()”. Free the list of CMMs by calling cmsFreeCmmList().

  • This is the prototype for cmsGetCmmList():

    int32  cmsGetCmmList(CMSContext ctxt, uint32 *count,
                         icSignature **cmms);

  • These are the arguments of cmsGetCmmList():


    The context initialized by cmsOpen().


    The number of CMMs available.


    The list of identifiers for the CMMs.

Freeing the List: cmsFreeCmmList()

The function cmsFreeCmmList() frees the list of available CMMs returned by cmsGetCmmList().

  • This is the prototype for cmsFreeCmmList():

    int32  cmsFreeCmmList(CMSContext ctxt, icSignature *cmms);

  • These are the arguments of cmsFreeCmmList():


    The context initialized by cmsOpen().


    The list of identifiers for the CMMs.

Getting Information About a CMM

The Coloratura CMS provides a function, cmsGetCmmInfo() to return information about a CMM. The information is held in an enumerated data type, CMSInfoName.

CMM Information Data Structure: CMSInfoName

Information about a CMM is held in the enumerated data type CMSInfoName.

  • This is the data type declaration for CMSInfoName:

    typedef enum {
    } CMSInfoName;

  • The following lists the meanings of the information fields:


    The registered 32-bit CMM name. The name uniquely identifies the CMM and is often interpreted as a 4-character mnemonic.


    A uint32 uniquely identifying the version of the CMM.


    The version of the Coloratura CMS for which the CMM was programmed. The returned value is a 4-byte string containing the major version and the minor version. Use CMS_VERSION_MAJOR_MASK and CMS_VERSION_MINOR_MASK to extract these numbers from CMS_FW_VERSION.


    If TRUE, the CMM supports ICC profiles.


    If TRUE, the CMM supports transformations made from more than two profiles.

Getting CMM Information: cmsGetCmmInfo()

The function cmsGetCmmInfo() queries a CMM and returns identifying information.

  • This is the prototype for cmsGetCmmInfo():

    int32  cmsGetCmmInfo(CMSContext ctxt, icSignature cmm,
                         CMSInfoName name, uint32 *value);

  • These are the arguments of cmsGetCmmInfo():


    The context initialized by cmsOpen().


    The CMM identifier obtained from cmsGetDefaultCmm() or cmsGetCmmList().


    The name of the information field for the CMM.


    The value of the specified field.

  • These are the error codes returned by cmsGetCmmInfo():


    The ctxt argument is not a valid CMS context.


    The cmm argument was not a valid name for a CMM.


    The color management system is missing.