KCMS CMM Developer's Guide

Save Types

Since there is more than one way to save, derivatives can specify the order in which its pieces get saved. The save types consist of bit sets and are:

These choices are available with an extensible protocol in which:

Universal

The KcsXform base class supports saving in the universal format. The save() method converts the object to ICC 3.0 to icLutX form. You need to provide allocation of the *aLut argument. When complete, the converted date is copied to the *aLut variable. This method is used by other objects during save(). The ICC 3.2 profile format derivative calls KcsXform during its save to convert the KcsXform object into the appropriate ICC transformation attribute. If not overridden, the KcsXform base class converts the transformation into a KcsXform derivative that supports the save() method and returns its conversion. If a derivative needs more control over this type of save, then it must override this method.

Private

Private saving uses the chunk set and chunk Id associated with the instance to save. The derivative only needs to package all of its data into a contiguous piece of memory and pass the address and its chunk Id to the object's chunk set. If this is too limiting, you can split the derivative's pieces into different chunks, each with its own chunk Id. The only caveat is that the instance must then place all of those chunk Ids into one chunk, which is ultimately saved as the top of the object.

This approach is appropriate when the object has many data structures that it does not want to store into one contiguous memory block. It also helps with loading if all the pieces are not needed all the time. This is the overall approach taken by the KCMS framework where the KcsProfile class has a table of chunkIds, one of which is the attribute chunkId for this profile. When loading attributes only, it is faster to use getchunk() and load just the attribute object than it is to use getchunk() and load the entire set of objects that represent a profile.

Example

ICC has both universal and private places for transformation data. The InterColorProfileFormat asks for the load order and gives a list of universal plus private. The Universal Color Processor (UCP) derivative responds with universalAsPrivate. Since the derivative knows that UCPs can do this, it asks any KcsXform derivative that does not save in the universal format to convert itself into a UCP. This follows the second way to break an obligation, since the InterColorProfileFormat actually converts the transformation to another kind and saves the converted one. It never saves the original.

The typdefs are as follows:

typedef

long KcsLoadSaveSet; #define KcsNoParts           

((KcsLoadSaveSet)0x00000000) #define KcsPrivatePart       

((KcsLoadSaveSet)0x00000001) #define KcsUniversalPart     

((KcsLoadSaveSet)0x00000002)
 #define KcsUniversalisPrivate 

	((KcsLoadSaveSet)((0x80000000)|KcsUniversalPart|KcsPrivatePart))