Figure 2-1 shows how color data is converted between a scanner device and a monitor device.
In the figure, the devices do not perform their own color correction. Rather, the color data is converted from the form provided by the scanner (Scanner DCP) to a form appropriate for display on the monitor (Monitor DCP). To convert the color data, your application would follow the steps below:
Load the scanner and monitor profiles.
Connect the scanner profile to the monitor profile to get a complete profile.
Evaluate color data through the complete profile.
Example 2-1 shows the sequence of calls that perform this conversion. For more information on the KcsConnectProfiles() function, see "Using Color Space Profiles" and the detailed function description on "KcsConnectProfiles() ".
/* Load the scanner's DCP.*/ KcsLoadProfile(&inProfile, &scannerDescription, KcsLoadAllNow); /* Load the monitor's DCP. */ KcsLoadProfile(&outProfile, &monitorDescription, KcsLoadAllNow); /* Connect two DCPs to form a CCP */ profileSequence = inProfile; profileSequence = outProfile; KcsConnectProfiles(&completeProfile, 2, profileSequence, KcsLoadAllNow, &failedProfileIndex); /* Apply the CCP to input color data. */ KcsEvaluate(completeProfile, KcsOperationForward, &inbufLayout, &outbufLayout);
As shown in Example 2-1, the first color-conversion step is to use the KcsLoadProfile()function. KcsLoadProfile() loads the profile associated with a specific device, effect, partial, or complete profile, and it allocates any system resources the profile requires. For a detailed description of KcsLoadProfile() , see "KcsConnectProfiles() ".
As shown in Example 2-1 and Figure 2-2, the next color-conversion step is to connect a pair of DCPs to form a CCP. KcsConnectProfiles() provides this functionality. Continuing with the example illustrated in Figure 2-1, a CCP is built by connecting the scanner's DCP to the monitor's DCP. The resulting CCP converts scanner data to monitor data.
The final color-conversion step is to use the KcsEvaluate() function. KcsEvaluate() applies a color transformation based on the supplied CCP. One of the following operations is associated with the evaluation. These operations are illustrated in Figure 2-3.
The reverse operation is used to transform color from the monitor form to the scanner form. This is useful if your application modifies some colors in monitor space, to keep the greatest number of colors that can be converted back and stored in the scanner's color space.
A more familiar use of the reverse operation is to transform the color from printer to monitor form to see what the data looks like from the printer.
The simulate operation is used to simulate the effect of running color data through a CCP, but retaining it in the form of the last device profile. For example, the simulate operation can produce monitor data that simulates the result of printed data.
The gamut-test operation is used to determine if each color in the source data is within the gamut of the destination device. Physical devices have a range of colors they can produce. This range of colors is known as the gamut of the device.
KcsEvaluate() can take a long time to execute, especially if the input image or graphic contains millions of pixels. Therefore, your application can provide a callback function using KcsSetCallback(), which KcsEvaluate() calls when necessary. The callback function can, for example, provide feedback to request that processing be cancelled. If the callback returns a non-KCS_SUCCESS status, the processing stops.