KCMS Application Developer's Guide

KcsLoadHints

typedef unsigned long KcsLoadHints;

KcsLoadHints is a data type of one argument in the following functions:

KcsLoadHints gives the KCMS framework a hint as to how a profile's allocated resources should be managed. It lets the caller supply information to the KCMS framework about what, how, when, and where to load and unload the profile. It consists of a set of bit definitions that allow the application to supply more than one option. KcsLoadHints also lets the application mix the operation hints and content hints for greater flexibility.

Table 3-2 shows the bits positions (31-0) of an unsigned long representing KcsLoadHints and KcsOperationType. See Table 3-3 for more information on the bit mask values.

Table 3-2 Bit Positions and Masks for Load Hints

Load Hint 

Bit Position 

Bit Mask 

OpForward 

KcsMaskOp 

OpReverse 

OpSimulate 

OpGamutTest 

 

Reserved 

 

 

 

 

 

HeapSys (1) / HeapApp (0) 

10 

KcsMaskLoadWhere 

KcsAttributes 

11 

KcsMaskAttr 

UnloadNow 

12 

KcsMaskUnloadWhen 

UnloadWhenFreed 

13 

UnloadWhenNeeded 

14 

UnloadAfterUse 

15 

ContColorimetric 

16 

KcsMaskCont 

ContImage 

17 

ContGraphics 

18 

 

19 

Reserved 

 

20 

 

21 

 

22 

 

23 

LoadNow(1) / LoadNever (0) 

24 

KcsMaskLoadWhen 

LoadWhenNeeded 

25 

LoadWhenIdle 

26 

 

27 

Reserved 

 

28 

 

29 

 

30 

StartOverWithThis 

31 

KcsMaskLogical 

Table 3-3 lists the values for the load hint bit masks.

Table 3-3 Bit Mask Values for Load Hints

Load Hint Bit Masks 

Values 

Description 

KcsMaskOp
#define KcsOpForward (0x00000001)
#define KcsOpReverse (0x00000002)
#define KcsOpSimulate (0x00000004)
#define KcsOpGamutTest (0x00000008)
#define KcsOpAll (0x000003FF)

See "Operation Hint Constants".

KcsMaskEffect
#define KcsEffect (0x00000200)

 

KcsMaskLoadWhere
#define KcsHeapApp (0)
#define KcsHeapSys (0x00000400)

Load it into application heap. 

Load it into system heap. 

KcsMaskAttr
#define KcsAttributes (0x00000800)

Load attributes. 

KcsMaskUnloadWhen
#define KcsUnloadNow (0x00001000)
#define KcsUnloadWhenFreed (0x00002000)
#define KcsUnloadWhenNeeded (0x00004000)
#define KcsUnloadAfterUse (0x00008000)

Unload it now. 

Unload it during a call to KcsFreeProfile().

Unload it when the CMM needs the memory for something else. 

Unload it just after the CMM needs to reference it. 

KcsMaskCont
#define KcsContUnknown (0x00000000)
#define KcsContGraphics (0x00010000)
#define KcsContImage (0x00020000)
#define KcsContColorimetric (0x00040000)
#define KcsContAll (0x00FF0000)

See "Content Hint Constants".


KcsMaskLoadWhen
#define KcsLoadNever (0x00000000)
#define KcsLoadNow (0x01000000)
#define KcsLoadWhenNeeded (0x02000000)

#define KcsLoadWhenIdle (0x04000000)

Never load it. 

Load it now. 

Load it just before CMM needs to reference it. 

Load it when the system has a free moment. 

KcsMaskLogical
#define KcsStartOverWithThis (0x10000000)
#define KcsAddToCurrentHints (0x00000000)

Get rid of the previous Hints and start with this one. 

Logically add this Hint with the others already set. 

Example 3-3 shows some combinations of the masks.


Example 3-3 Load Hint Bit Mask Combinations

#define KcsLoadAllNow
 (KcsAll|KcsLoadNow|KcsUnloadWhenFreed|KcsStartOverWithThis)
 #define KcsLoadAllWhenNeeded
 (KcsAll|KcsLoadWhenNeeded|KcsUnloadWhenFreed|KcsStartOverWithThis)
 #define KcsLoadAttributesNow
 (KcsAttributes|KcsLoadNow|KcsUnloadWhenFreed|KcsStartOverWithThis)
 #define KcsLoadMinimalMemory
 (KcsAll|KcsLoadWhenNeeded|KcsUnloadAfterUse|KcsStartOverWithThis)
 #define KcsPurgeMemoryNow
 (KcsAll|KcsLoadWhenNeeded|KcsUnloadNow|KcsStartOverWithThis)

Typically you might use two of these bit mask combinations: KcsLoadAttributesNow and KcsLoadAllNow. KcsLoadAttributesNow loads the profile attributes only. KcsLoadAllNow loads the entire profile (header, attributes, and operations that can be performed on CCPs to transform color data).

Operation Hint Constants

Four operation hint constants describe the operations in Table 3-2 that can be performed on CCPs to transform color data (are also referred to as transforms). These are

Operations Performed

Ordinarily, an application transforms data in the forward direction, for example, from a scanner to a printer. Your application can specify KcsOpForward to achieve this.

Your application also may be able to convert the data in the reverse direction, for example, from a monitor to a scanner. To do this, it specifies KcsOpReverse. The reverse direction can be useful if, for instance, you are given colors in the monitor device color space and you want to transform the data back to the original scanner color space.

KcsOpSimulate lets your application simulate the effect of running data through a complete profile, but leaves it in the color space of the last device profile in the connected sequence of profiles. For instance, suppose you have a CCP consisting of scanner => printer => monitor profiles. Your application can use the CCP with the simulate operation on monitor data to produce monitor data that simulates the result of printing the data. For this to work, it must have connected a destination device to a source => destination combination. In this situation, the scanner is the source device, the printer is the first destination device, and the monitor is the connected destination device.


Note -

A typical color monitor can display colors that a printer cannot print. Similarly, many printers are capable of printing colors that cannot be displayed on a color monitor. KcsOpSimulate lets users preview what a graphic or image will look like (approximately) when printed.


KcsOpGamutTest lets your application determine if each source color is in the gamut of the destination device. The resulting image contains 0 for a pixel with in-gamut color and FF for a pixel with out-of-gamut color.

Constraints When Using Operation Hints

Because of constraints in the CMM or in the specific profile, not all of the above operations may be supported. Also, some CMMs may offer additional custom operations. Your application can use KcsGetAttribute() and supply the KcsAttrSupportedOperations attribute to determine which operations are supported by a given profile.

Specifying any single or combination of operation load hints to the KcsLoadProfile() function has no effect. KCMS equates this to KcsOpAll. When the application calls KcsConnectProfiles(), KCMS automatically loads all the transforms to support the full range of operations.

Your application cannot specify KcsOpAll as an argument to KcsEvaluate().

Content Hint Constants

The content hint constants let your application specify hints about what kind of data is being processed. A CMM can use these hints to better convert the data as your application requests. For instance, these hints may be used to adjust the gamut-mapping technique (the approach used to map the colors falling outside a device's capability to colors that the device can produce).

The "C" API defines the following constants:


Note -

ICC content hints are called rendering hints. Currently, the following rendering hints defined are:

icPerceptual = KcsContImage  
icRelativeColorimetric = KcsContColormetric  
icSaturation = KcsContGraphics  
icAbsoluteColorimetric = <no equivalent>

If your application has input color data that matches more than one of these content hints (for example, a complicated page layout), it can specify KcsContUnknown to produce adequate results. For best results, your application may have to divide color data into different parts (for example, separate graphics and images parts). After dividing, your application can process each part separately, applying the appropriate content hint to each part.

If your application specifies KcsContAll as an argument to KcsConnectProfiles(), the resultant profile has the full range of content hints available to it. If it does not, the resultant profile is restricted to the content hints supplied by the function.

CMMs can define additional custom content hints, for example: