KCMS Application Developer's Guide

Using Color Space Profiles

Another possible use of KcsConnectProfiles() is to connect a DCP and a CSP, creating a new CCP. Refer to Figure 2-1. If the scanner DCP in that figure is connected to the CSP (instead of the Monitor DCP shown that converts for the CIEXYZ color space), the resulting CCP will convert color data produced by the scanner into CIEXYZ format.

Example 2-2 shows the sequence of calls that creates and applies the CCP. Note that this example is very similar to Example 2-1. The difference is the second call to KcsLoadProfile(). In Code Example 2-2, KcsLoadProfile() loads the CIEXYZ profile description instead of the monitor description.


Example 2-2 Connecting a DCP and CSP

/*Load scanner's DCP. */
 KcsLoadProfile(&inProfile, &scannerDescription, KcsLoadAllNow);
 if(status != KCS_SUCCESS) {
 	status = KcsGetLastError(&errDesc);
 	KcsFreeProfile(profileid);
 	exit(1);
 }

 /*Load CSP for CIEXYZ color space. */
 KcsLoadProfile(&outProfile,&CIEXYZdescription, KcsLoadAllNow);
 if(status != KCS_SUCCESS) {
 	status = KcsGetLastError(&errDesc);
 	KcsFreeProfile(profileid);
 	exit(1);
 }

 /*Connect two profiles to form a CCP.*/
 profileSequence[0] = inProfile;
 profileSequence[1] = outProfile;
 KcsConnectProfiles(&completeProfile,2, profileSequence,
 		KcsLoadAllNow, &failedProfileIndex);
 if(status != KCS_SUCCESS) {
 	status = KcsGetLastError(&errDesc);
 	KcsFreeProfile(profileid);
 	exit(1);
 }

 /*Apply the CCP to input color data.*/
 KcsEvaluate(completeProfile, KcsOperationForward,
 		&inbufLayout, &outbufLayout);