PATHDocumentation > Mac OS 8 and 9 > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


Creating and Using Device Link Profiles

To accommodate users who use a specific configuration requiring a combination of device profiles and possibly non-device profiles repeatedly over time, your application can create device link profiles. A device link profile offers a means of saving and storing a series of profiles corresponding to a specific configuration in a concatenated format. This feature provides an economy of effort for both your application and its user.

There are many uses for device link profiles. For example, a user might want to store multiple profiles, such as various device profiles and color space profiles associated with the creation and editing of an image.

Most users use the same device configuration to scan, view, and print graphics over a period of time, often soft proofing images before they print them. To enhance your application's soft-proofing feature, you can allow users to store the contents of the profiles involved in the soft-proofing process in a device link profile. Your application can use the appropriate device link profile each time a user enacts the soft-proofing feature, instead of opening a profile reference to each of the profiles to create a color world to pass to the color-matching functions. For additional information about soft proofing, see Providing Soft Proofs .

A device link profile is especially useful when a scanner application does not embed the source profile in the document containing the image it creates. By storing the scanner's profile, your application eliminates the need to query the user for the appropriate source profile each time the user wants to soft proof using the configuration involving that scanner.

A user may want to see how a scanned image will look when printed using a specific printer. The user may want to look at many images captured on the same scanner at different times before printing the image. Because the same devices are involved in the process, if your application has offered the user the opportunity to create device link profiles, your application could display a list of device link profiles that the user had previously created for various configurations and allow the user to select the appropriate one for the current soft proofing.

Here are the steps your application should take in creating a device link profile:

  1. Open the profiles corresponding to the devices and transformations involved in the configuration and obtain references to them.

    To create a device link profile, your application must first obtain references to the profiles involved in the configuration. If the profile for an input device, such as a scanner, is embedded in the document containing the image, you must first extract the profile. For a description of how to obtain a profile reference, see Obtaining Profile References . For information describing how to extract a profile from a document, see Extracting Profiles Embedded in Pictures .

  2. Create an array containing references to the profiles, specifying the profile references in processing order.

    You supply the profile references as an array of type CMProfileRef within a data structure of type CMConcatProfileSet . The order of the profiles must correspond to the order in which you want the colors of the image to be processed. For example, for soft proofing an image, you should specify the scanner profile reference first, followed by the printer profile reference, and then the display profile reference because the goal is to match the colors of the scanned image to the color gamut of the printer for which the image is destined and then display the results to the user.

    In the count field, specify a one-based number identifying how many profiles the array holds. A device link profile represents a one-way link between devices.

    Here is the CMConcatProfileSet data type:

    struct CMConcatProfileSet {
        unsigned short      keyIndex;           /* zero-based */
        unsigned short      count;              /* one-based */
        CMProfileRef        profileSet[1];
    };

    You must adhere to the rules that govern the type of profiles you can specify in the array. For example, the first and last profiles must be device profiles. For a list of these rules, see CMConcatProfileSet .

  3. Specify the index corresponding to the profile whose specified CMM is used to perform the processing.

    The header of each profile specifies a CMM for that profile. Only one CMM is used for all transformations across the profiles of a device link profile. You identify the profile whose CMM is used by supplying the zero-based index of that profile in the keyIndex field of the CMConcatProfileSet data type.

    IMPORTANT

    See How the ColorSync Manager Selects a CMM for a complete description of the ColorSync algorithm for selecting a CMM.

  4. Using the CMProfileLocation data type, provide a file specification for the new device link profile.

    If the function CWNewLinkProfile is successful, the ColorSync Manager creates a device link profile in the location that you specify, opens a reference to the profile, and returns the profile reference to your application. To tell the ColorSync Manager where to create the new profile, your application must provide a file specification. The ColorSync Manager defines a data structure of type CMProfileLocation containing a CMProfLoc union that you use to give a file specification.See Listing 2 , which assigns values to a CMProfileLocation data structure.

  5. Call the CWNewLinkProfile function to create the device link profile.

    After you set up CMConcatProfileSet and CMProfileLocation , your application can call the function CWNewLinkProfile , passing these values to it. If the function completes successfully, it returns a reference to the newly created device link profile.

    Note that you should not embed a device link profile into a document along with an image that uses it, as embedded profiles specify source device characteristics only.

  6. Using the CWConcatColorWorld function, create a color world based on the device link profile.

    You can use a device link profile with the general purpose ColorSync Manager functions only. To use a device link profile for a color-matching or color gamut-checking function, you must first create a color world using the CWConcatColorWorld function, passing to it a data structure of type CMConcatProfileSet . The CMConcatProfileSet data structure is the same data type that you used to specify the array of profiles when you created the new device link profile. To create the color world, however, you specify the device link profile as the only member of the CMConcatProfileSet array. If the CWConcatColorWorld function is successful, it returns a reference to a color world that your application can pass to other general purpose functions for color-matching and color gamut-checking sessions. A device link profile remains intact and available for use again after your application calls the CWDisposeColorWorld function to dispose of the concatenated color world.

Considerations

Here are some points to consider about how the ColorSync Manager uses information contained in the profiles comprising a device link profile:

When your application is finished with the device link profile, it must close the profile with the CMCloseProfile func tion .


© 1988-1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)