KCMS CMM Developer's Guide

Why You Might Derive From or Extend a KCMS Class

The following sections give helpful information on why you might derive from or extend a particular KCMS class.

KcsIO

If you have special I/O considerations, you might want to create a KcsIO class derivative. It is a simple I/O protocol that most devices support. For example, this version of KCMS includes an X11 Window System derivative (kcsSUNWIOxwin.so.1) and a Solaris file derivative (kcsSUNWIOsolf.so.1). The code for the latter is included in the /opt/SUNWddk/kcms/src directory.

The framework supports file-, memory-, and network-based derivatives. Objects use a static store to read from or write to data; a common type of static store is a file on disk. A static store is a hardware- or platform-independent mechanism for generation and regeneration. Generation is the first time data is read from a static store and an object is instantiated from that data; the data is constructed from the saved state. Regeneration, or loading occurs when a derivative brings back all of its state and functionality, after it has been minimized, from its static store. With minimization and regeneration the object is already instantiated. A minimized object contains sufficient information to generate itself from a static store [typically just its unique identifier(UID)].

See Chapter 4, KcsIO Derivative ," for information on creating a KcsIO class derivative.

KcsProfile

Derive a new KcsProfile class for characterization and calibration, additional functionality, or new transformation derivatives. Usually, this involves overriding one of the update methods to actually produce a new KcsXform derivative. Once the transformation is saved to the static store, the runtime load mechanism automatically handles it from then on, as long as the CMM is installed on the loading system. Since you can supply profiles directly that contain new KcsXform derivatives, the only derivative necessary to supply is the one derived from the KcsXform class. However, if the profile used to contain these new KcsXform derivatives is the KcsProfile derivative, it overwrites the new KcsXform type with one of its own when calibrated.

See Chapter 5, KcsProfile Derivative ," for information on creating a KcsProfile class derivative.

KcsProfileFormat

You can create a KcsProfileFormat class derivative to support an existing non-ICC profile format, a new profile format, or possibly a set of data that is not an ICC profile (for example, a tag encoded TIFF file). To build a KcsAttributeSet instance within a KcsProfileFormat instance and a set of KcsXform derivatives, enough information in a properly tagged TIFF image might exist.

The CMM Id and version must be in a known location in the profile header. This is always the case with the ICC profile format. See "ICC Profile Header " ," for details. Other profile formats must be formatted to conform to this requirement so that the KCMS framework can form the keys to locate the format's runtime loadable module.

See Chapter 6, KcsProfileFormat Derivative ," for information on creating a KcsProfileFormat class derivative.

KcsXform

Typically you create a KcsXform class derivative when you create a CMM. The KcsXform is the most common derivative, since most color management suppliers have their own type of transformation technology. Most color technology involves manipulating matrixes and transforms. This class allows you to define a transform and its methods.

See Chapter 7, KcsXform Derivative ," for information on creating a KcsXform class derivative.

KcsStatus

The KcsStatus class represents a consistent object-oriented way of returning results from all the KCMS methods. It enables each of the following to be represented:

You do not actually derive from the KcsStatus class: you extend it. You override an error and warning message function to provide your own error and warning messages. It is recommended that you override KcsStatus functions with message extraction for language localization. You are not required to provide your own messages. The KCMS-framework error and warning messages may be sufficient.

See Chapter 8, KcsStatus Extension ," for information on extending the KcsStatus class.