KCMS CMM Developer's Guide

Using connect()

The connect() method is one of the most demanding methods of the KcsProfile class. It uses all of the profiles that are in the list sequence, as well as the opAndHints operation, to determine which transformations to generate and how to generate them. It also checks a number of internal rules to ensure those connections are possible. For example, it checks to see that color spaces are compatible. The KCMS profile model does not include a specific reference. Some color management solutions do, but the KCMS framework checks the consistency of the connections. As illustrated in Figure 5-2, the connected sequence shares the Xforms (through the class) of those in the list.

Figure 5-2 Sequences Sharing Xforms

Graphic

The KCMS framework also does automatic insertion of profiles if those color spaces do not match properly. For example, if you want to connect a KCMS profile that uses KCMS RGB as its connection space with an XYZ profile that uses CIE Lab as its connection space, connect() looks for a KCMS RGB-to-CIE Lab profile and automatically inserts it into the list. The rest of the connection proceeds as if that profile was in the list when called.

The connect() method searches through all KCMS profiles so more can be installed to add to the flexibility of this mechanism. opAndHints allows you to trim result to contain only the operations wanted for future use. For example, if you only want to perform a forward operation, then supply only KcsForward--even if there is enough information to connect and create a reverse operation. The default behavior in the base class is to not create the KcsReverseOp transformation. The method only creates what you tell it to create. The only exception is attributes. All profiles need attributes; otherwise, result is useless. It is recommended that derivatives keep consistent with this policy.

When the base KcsProfile connects profiles and creates a new one, it does not create a connection of profiles. One profile is generated with the KcsProfile elements: attributes, transformations, and a format object. The connect() method uses sequences of transformations to fill in the results transformation array. The sequences are generated based on the content of the profile in the list sequence.

As shown in Figure 5-2, if you give a list consisting of an input device with an output device as the only profiles listed, the connect() method takes the into-RCS transformation of the input device, connects it with the outof-RCS transformation of the output device, and creates a sequence. The method then assigns that sequence to the complete-Forward index of a result. If KcsForwardOp is the only operation specified in opAndHints, that is the only sequence generated. Figure 5-2 also illustrates KcsReverseOp.

The connect() method also goes through a composition of all the attributes in all the profiles in the sequence list. A set of attribute rules, a composition method in the KcsAttributeSet class, and the base class connect() method feed the list of attributes from profile objects in the list to the KcsAttributeSet composition method.

By default, when connecting the simulation transformations for the resulting profile, the connect() method looks for the simulation-RCS transformation to accomplish the simulation part of the chain. If connect() doesn't find one and the outof-RCS and into-RCS transformations of the simulated device are available, it makes a simulation sequence that contains these transformations in place of the simulation-RCS transformation. This results in a clipping close to the simulation normally seen on devices.