KCMS CMM Developer's Guide

Loading a Profile

This example explains what the KCMS framework does when an application makes a KCMS "C" API call to load a profile.

  1. Using the KcsIO derivative, the framework determines the CMM Id of the profile.

  2. The framework calls the KcsProfile::createProfile() static method and loading starts. It uses the CMM Id of the profile as a key to determine the particular KcsProfile derivative to load. The CMM Id is associated with the dynamically loadable module using entries in the OWconfig file.

    Once dynamically loaded, the module returns a pointer to a KcsProfile object. If the particular CMM Id has no match in the OWconfig file, the framework uses the default KcsProfile derivative, KcsProfileKCMS. There is a special CMM Id key dflt entry in the OWconfig file, so that your CMM can override the default KcsProfile class. (See "KcsProfile Example" for details.) If you want your CMM to override the default KcsProfile class, it must duplicate all of the functionality that the default class handles.

  3. The framework calls the load() method on the KcsProfile object pointer that was created in step 2. This causes a KcsProfileFormat object pointer to be created using an entry in the OWconfig file. Then the KcsProfileFormat object loads itself.

    The profile format Id (also called the profile signature or magic number, which starts at byte 36 of the ICC profile format) is used as the key to this entry in the OWconfig file. (For details on the ICC profile format, see "ICC Profile Header".)

  4. The KcsProfileFormat object contains pointers to a KcsAttributeSet object and an array of pointers to KcsXform objects. The framework also creates these objects and calls their load() methods so they load themselves from the static store.

    Your CMM can derive directly from the KcsAttributeSet object, since it is statically linked into the KCMS framework. The KcsXform array has an OWconfig entry that uses a 4-byte identifier as a key. For ICC-based profiles, use the 8- and 16-bit LUT tags, mft1 and mft2. (See "KcsXform Example" for details.)

  5. If all pieces of the profile load successfully, the framework returns a KCS_SUCCESS status to the calling application.