KCMS Application Developer's Guide


 KcsConnectProfiles(KcsProfileId *resultProfileId,
 		unsigned long profileCount,
 		KcsProfileId *profileSequence,
 		KcsOperationType operationLoadSet,
 		unsigned long *failedProfileIndex)


Use KcsConnectProfiles() to combine several existing profiles into a new complete profile, or to restrict the functionality of a single existing profile to make it more efficient.

If KcsConnectProfiles() returns successfully, it generates a new profile from the sequence of existing profiles. The reference (profile Id) to this new profile is stored in the resultProfileId argument. With this reference, you can free the resources of the existing profiles in profileSequence if they are no longer required. Use KcsFreeProfile() to release the resources.

Note -

If you have minimized a profile's load operation or state with operationLoadSet or with KcsOptimizeProfile() ("KcsOptimizeProfile()"), only that load operation or state is saved with KcsSaveProfile(). Therefore, operations not included in the profile are not available the next time the profile is loaded.

If the last profile in a sequence to be connected includes a gamut transform, the operation hint KcsOpGamutTest (see "Operation Hint Constants") may be requested for that profile. The result of KcsEvaluate() with this gamut hint is a bit map image that contains 1 bit for each pixel in the original image. In the bit map, 0 means the color is in the gamut of the device requested by the final profile, and FF means the color is out of gamut (that is, the color cannot be represented by the device).


Table 4-3 KcsConnectProfiles() Arguments




The identifier of the profile returned if this function executes successfully.  


The number of profiles to be connected. 


An array of the Ids of the profiles to be connected. 


One or more flags symbolizing the kind of information in the resultant profile. It also describes what, how, when, and where to load and unload the resulting resultProfileId. See "KcsLoadHints " for more information.


KcsConnectProfiles() returns an integer in failedProfileIndex. This value has meaning only when KcsConnectProfiles() returns a value other than KCS_SUCCESS. If the function fails, this index helps you identify which input profile caused the failure. If the index = 0, the first profile in profileSequence failed; if index = 1, the second profile in profileSequence failed, and so on. A common problem when making the resultant profile is that the profiles specified in profileSequence could not be connected. In this case, the index returns an integer symbolizing the latter profile in a failed connection pair. For example, if the first profile and second profile in the sequence were mismatched, the index contains 1 (for the second profile).


Table 4-4 KcsConnectProfiles() Return Strings








Example 4-1 KcsConnectProfiles()

KcsProfileDesc				scannerDesc, monitorDesc, completeDesc;
 KcsProfileId				scannerProfile, monitorProfile;
 KcsProfileId				profileSequence[2], completeProfile;
 KcsStatusId				status;
 KcsErrDesc 				errDesc;
 u_long				failedProfileNum;
 /*file names input a program arguments */

 scannerDesc.type = KcsSolarisProfile;
 scannerDesc.desc.solarisFile.fileName = argv[1];
 scannerDesc.desc.solarisFile.hostName = NULL;
 scannerDesc.desc.solarisFile.oflag = O_RDONLY;
 scannerDesc.desc.solarisFile.mode = 0;
 monitorDesc.type = KcsSolarisProfile;
 monitorDesc.desc.solarisFile.fileName = argv[2];
 monitorDesc.desc.solarisFile.hostName = NULL;
 monitorDesc.desc.solarisFile.oflag = O_RDONLY;
 monitorDesc.desc.solarisFile.mode = 0;

 status = KcsLoadProfile(&scannerProfile, &scannerDesc, KcsLoadAllNow);

 if(status != KCS_SUCCESS) {
 	printf("Scanner LoadProfile error: %s\n", errDesc.desc);

 status = KcsLoadProfile(&monitorProfile, &monitorDesc, KcsLoadAllNow);

 if(status != KCS_SUCCESS) {
 	printf("Monitor LoadProfile error: %s\n", errDesc.desc);

 /* See if we can combine them */
 profileSequence[0] = scannerProfile;
 profileSequence[1] = monitorProfile;

 status = KcsConnectProfiles(&completeProfile, 2, profileSequence, op,

 if(status != KCS_SUCCESS) {
 	printf("ConnectProfile error: %s\n", errDesc.desc);
 	fprintf(stderr, "Failed in profile number %d\n", failedProfileNum);