KCMS CMM Developer's Guide

Connecting Two Loaded Profiles

Example 3-4 is a "C" API code excerpt that shows how to connect two profiles together once they have been loaded.


Example 3-4 Connecting Two Loaded Profiles

profileSequence[0] =

scannerProfile; profileSequence[1] = monitorProfile; status =

KcsConnectProfiles(&completeProfile, 2, profileSequence, op,

&failedProfileNum); if (status != KCS_SUCCESS) { 	fprintf(stderr,

"Connect Profiles failed in profile number  			%d\n",

failedProfileNum); 	KcsFreeProfile(monitorProfile);

	KcsFreeProfile(scannerProfile); 	return(-1); }

The KCMS framework implements the K()csConnectProfiles() API call as follows:

  1. It calls getNewValidProfileIndex()method to get a new valid index for the connected profile from the dynamically allocated global array of profiles.

  2. The new connected profile needs a KcsIO class to handle its I/O. Currently, this is stored in memory only, so it creates a KcsMemoryBlock object.

  3. It creates a KcsProfile object that can link together sequences of profiles.

  4. It attaches each profile in the sequence with attach() to the newly created KcsProfile object. The attach()method reference counts the objects. (Note that all classes are reference counted through inheritance from the KcsShareable class.)

  5. Once attached, the KcsAttributeSet object composes the attributes from the two KcsProfile members in the array into a single set of attributes for the newly created profile object.

  6. It links the KcsXform array so that the "into" and "out of" profile connection space (PCS) transforms of each KcsProfile object (profile) can be connected. When color data is processed through this sequence, it moves from input profile to PCS and from PCS to output profile.

  7. Once connected, it returns the new profile Id to the calling application for later reference, and generally cleans up the classes.