Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging on the Mac OS /
Chapter 4 - Developing ColorSync-Supportive Applications / Developing Your ColorSync-Supportive Application


Creating a Color World for Color Matching and Checking Using the Low-Level Functions

A color world is a reference to a private ColorSync structure that represents a unique color-matching session. Although profiles can be large, a color world is a compact representation of the mapping needed to match between profiles. Conceptually, you can think of a color world as a sort of "matrix multiplication" of two or more profiles that distills all the information contained in the profiles into a fast multidimensional lookup table.

For the ColorSync Manager low-level functions, a color world defines the aspects that characterize how the color-matching session will occur based on information contained in the profiles that you supply when your application sets up the color world. Your application can define a color world for color transformations between a source profile and a destination profile, or it can define a color world for color transformations among a series of concatenated profiles.

For the low-level ColorSync Manager functions, a color world is the equivalent of the ColorSync Manager QuickDraw-based functions' source and destination profiles. From your application's perspective, the difference in specifying profiles for the low-level functions is that instead of calling a function and passing it references to the profiles for the session, first you must create a color world using those profile references and pass the color world to the function.

Your application calls the NCWNewColorWorld function to set up a simple color world for color transformations involving two profiles--a source profile and a destination profile--and the function returns a reference to the color world it creates. Setting up a color world for color processing involving a series of concatenated profiles or a single device-linked profile, which contains a series of profiles, is slightly more complex. Here are the steps you take:

  1. Obtain references to the profiles to use for the concatenated color world.

    For information describing how to obtain references to the profiles for the color world, see "Obtaining Profile References" (page 4-16).

  2. Set up an array containing references to the profiles comprising the set.

    Before your application calls the CWConcatColorWorld function to create the color world, you must establish the profile set. The ColorSync Manager defines the following data structure of type CMConcatProfileSet that you use to specify the profile set:

    struct CMConcatProfileSet {
    unsigned short keyIndex;
    unsigned short count;
    CMProfileRef profileSet[1];
    };

    Your application also uses the CMConcatProfileSet data structure to define a profile set for a device-linked profile. See "Creating and Using Device-Linked Profiles" (page 4-52) for more information.

    Your application must create an array that contains references to the profiles for the color world, specifying these references in processing order. You must specify the number of profile references in the array as the value of the CMConcatProfileSet.count field, using a one-based number. You assign the profile array to the CMConcatProfileSet.profileSet field.

    The ColorSync Manager defines rules governing the types of profiles you can specify in a profile array. These rules differ depending on whether you are creating a profile set to create a device-linked profile or to create a concatenated color world. For a list of the rules defining the types of profiles you can use for these purposes, see CWNewLinkProfile (page 3-112) and CWConcatColorWorld (page 3-110) in Advanced Color Imaging Reference.

  3. Identify the CMM for color processing.

    Each of the profiles whose references you give identifies the preferred CMM for color processing involving that profile. To perform color transformation using a series of profiles, the ColorSync Manager uses only one CMM. You use the CMConcatProfileSet.keyIndex field to identify the index into the array corresponding to the profile whose preferred CMM is to be used. The array is zero based, so you must specify the CMConcatProfileSet.keyIndex value as a number in the range of 0 to count - 1, where count is the number of elements in the array.

  4. Call the CWConcatColorWorld function to set up the color world.

    You pass the CWConcatColorWorld function a parameter of type CMConcatProfileSet to specify the profile array, and the function returns a color world reference. To perform color matching or gamut checking using the profiles comprising a color world, you call the low-level function passing it the reference to the color world.

Using a device-linked profile for the low-level functions entails additional steps, described in "Creating and Using Device-Linked Profiles" (page 4-52).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996