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():

    ctxt 

    The context initialized by cmsOpen().

    cmm 

    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():

    ctxt 

    The context initialized by cmsOpen().

    count 

    The number of CMMs available.

    cmms 

    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():

    ctxt 

    The context initialized by cmsOpen().

    cmms 

    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 {
            CMS_CMM_NAME,
            CMS_CMM_VERSION,
            CMS_FW_VERSION,
            CMS_CAN_DO_IC,
            CMS_MULTIPLE_OK
    } CMSInfoName;

  • The following lists the meanings of the information fields:

    CMS_CMM_NAME 


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

    CMS_CMM_VERSION 


    A uint32 uniquely identifying the version of the CMM.

    CMS_FW_VERSION 


    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.

    CMS_CAN_DO_IC 


    If TRUE, the CMM supports ICC profiles.

    CMS_MULTIPLE_OK 


    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():

    ctxt 

    The context initialized by cmsOpen().

    cmm 

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

    name 

    The name of the information field for the CMM.

    value 

    The value of the specified field.

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

    CMS_BAD_CONTEXT 


    The ctxt argument is not a valid CMS context.

    CMS_CMM_NOT_AVAILABLE 


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

    CMS_MISSING 


    The color management system is missing.