Contents

NCWNewColorWorld

Creates a color world for color matching based on the specified source and destination profiles.

Declaration

CMError NCWNewColorWorld (
   CMWorldRef *cw,
   CMProfileRef src,
   CMProfileRef dst
);

Parameters

  • cw:

    A pointer to a color world. On return, a reference to a matching session color world of type Cmworldref. You pass this reference to other functions that use the color world.

  • src:

    A profile reference of type Cmprofileref that specifies the source profile for the color-matching world. This profile’s dataColorSpace element corresponds to the source data type for subsequent calls to functions that use this color world.

    Starting with ColorSync version 2.5, you can call 1804940 Cmgetdefaultprofilebyspace to get the default profile for a specific color space or 1804955 Cmgetprofilebyavid to get a profile for a specific display.

    With any version of ColorSync, you can specify a NULL value to indicate the ColorSync system profile. Note, however, that starting with version 2.5, use of the system profile has changed.

  • dst:

    A profile reference of type Cmprofileref that specifies the destination profile for the color-matching world. This profile’s dataColorSpace element corresponds to the destination data type for subsequent calls to functions using this color world.

    Starting with ColorSync version 2.5, you can call 1804940 Cmgetdefaultprofilebyspace to get the default profile for a specific color space or 1804955 Cmgetprofilebyavid to get a profile for a specific display.

    With any version of ColorSync, you can specify a NULL value to indicate the ColorSync system profile. Note, however, that starting with version 2.5, use of the system profile has changed.

Return Value

A CMError value. See Result Codes.

Overview

You must set up a color world before your application can perform general purpose color-matching or color-checking operations. To set up a color world for these operations, your application can call NCWNewColorWorld after obtaining references to the profiles to use as the source and destination profiles for the color world. The following rules govern the types of profiles allowed:

  • You can specify a device profile or a color space conversion profile for the source and destination profiles.

  • You can not specify a device link profile or an abstract profile for either the source profile or the destination profile.

  • Only one profile can be a named color profile.

  • You can specify the system profile explicitly by reference or by giving NULL for either the source profile or the destination profile.

You should call the function CMCloseProfile for both the source and destination profiles to dispose of their references after execution of the NCWNewColorWorld function.

The quality flag setting (indicating normal mode, draft mode, or best mode) specified by the source profile prevails for the entire session. The quality flag setting is stored in the flags field of the profile header. See CM2Header and Flag Mask Definitions for Version 2.x Profiles for more information on the use of flags. The rendering intent specified by the source profile also prevails for the entire session.

The function CWConcatColorWorld also allocates a color world reference of type CMWorldRef.

Version-Notes

The parameter descriptions for src and dst describe changes in how this functions is used starting with ColorSync version 2.5.

See Also

Working With ColorWorlds