This section discusses advanced profile topics.
KcsEvaluate() takes an additional argument that describes the operation to be performed on the profile. This argument is an operation hint. For example, your application can tell KcsEvaluate() to convert data in the forward direction (KcsOpForward), such as from the scanner to the printer. Data also can be converted in the reverse direction, such as from the monitor to the scanner. The reverse operation (KcsOpReverse), when it is available in a profile, inverts the function performed by KcsOpForward. However, KcsEvaluate()rarely performs an exact inverse, because information is lost when color data is transformed. In other words, if your application performs a KcsOpForward and then a KcsOpReverse of a profile on the same buffer, the result is almost equivalent to what it started with before KcsOpForward. Some quality may be lost.
Only one of these operation hint bits can be set at a time for KcsEvaluate(), unlike general load hints for which any combination can be set at the same time. As part of the
KcsLoadHints data type, the operation hints signify the required set of operations available to use with the profile. By contrast, KcsEvaluate() uses only the single operation that the application wants to perform.
See "Operation Hint Constants" for more information on operation hints.
Your application can also specify hints about the content of the data being processed. Consider, for example, a photographic image data or computer-generated graphic image data. A CMM can use these hints to do a better job of converting the data such as adjusting the gamut-mapping technique.
See "Content Hint Constants" for more information on content hints.
After creating a complete color profile (CCP), your application can use it more than once. For example, it can use the CCP to convert images page-by-page during printing and to process individual rasters or tiles in a large image. When your application no longer needs the profile, it can call K()csFreeProfile() to free the profile's resources. The profiles in the profile sequence used to create a CCP can be freed without affecting the CCP.
The KCMS API expects the application to allocate memory required for the data returned by the KCMS framework. In general, the application allocates a C structure and passes a pointer to that structure into the KCMS framework.
The one exception to this is the profile. The KCMS framework returns and accepts a profile Id only. Your application must manage the memory allocated for the Id. To inform the KCMS framework that it should release the memory associated with the profile Id, your application must call the KcsFreeProfile()function.
First, your application can optimize a profile to make it more accurate (by eliminating intermediate round-off errors, for instance), smaller (by merging sequences of look-up tables, for instance), or faster (by precomputing some results). The application specifies whether size, speed, accuracy, or some combination is more important.
Second, by using load hints to limit a profile's operations, your application also may affect its optimization. This is valuable, for instance, if you want to write color data with a DCP that will be used later to read the data. The size of the DCP can be significantly reduced (depending on the CMM in use) by restricting the profile to the forward operation only.
After your application optimizes a profile, it must call KcsSaveProfile() to save the profile for future use. Then it can use this profile with KcsLoadProfile() to avoid the slow performance of KcsOptimizeProfile().
Saving an optimized profile has some potential implications. The optimization may indirectly affect future operations on the profile. For example, if the profile is optimized for size, portions of the profile needed only for highest accuracy may be discarded, resulting in compromised accuracy.
Characterization establishes a norm for a particular device across a range of samples of the device. This form of profile is typically supplied by a profile vendor. To obtain an optimally accurate DCP for a particular device, calibration is required.
The first step your application should take in building a new profile is to create an empty profile using KcsCreateProfile(). Then it can fill the empty profile with KcsSetAttribute() to describe the device being characterized. For example, it can supply monitor chromaticities and white-point values. Measurement data is required for KcsUpdateProfile() to complete the creation of the new profile. Once updated, your application should save the profile with KcsSaveProfile() to the desired KcsProfileDesc location.
Updating profiles typically is a CMM-dependent operation. Using measurement data at the KCMS framework interface level frees you from details of the profile format and the process by which the CMM turns the measurement data into its methodology for color manipulation.