Previous Book Contents Book Index Next

Inside Macintosh: What's New in Advanced Color Imaging on the Mac OS /
ColorSync 2.1


ColorSync 2.1 Changes

The following sections describe changes and new features for version 2.1 of the ColorSync Manager and provide hypertext links to new and revised ColorSync material in the advanced color imaging books.

Procedure-Based Profile Access

With version 2.0 of the ColorSync Manager, profiles could be stored in one of three ways: as a disk file, as memory accessed by a handle, or as memory accessed by a pointer.

For maximum flexibility in working with profiles, ColorSync Manager version 2.1 defines an interface that lets you specify your own procedure for accessing a profile. The ColorSync Manager calls your profile access routine when the profile is created, initialized, opened, read, updated, or closed. You provide functions to perform the low-level read and write operations to the profile's physical location.

For an overview of procedure-based profile access, including sample code, see the following section in Chapter 4, "Developing ColorSync-Supportive Applications," in Advanced Color Imaging on the Mac OS:

"Accessing a Resource-Based Profile With a Procedure" (page 4-57)

For additional information, see the following in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

Named Color Space Support

The ColorSync Manager now provides data structures, profile formats, and routines for working with named color spaces, such as Pantone.

For an overview of named color spaces, see the following in Chapter 3, "Introduction to the ColorSync Manager," in Advanced Color Imaging for the Mac OS:

For information on working with named colors in your application, see the following in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

For information on supporting named colors in your color management module (CMM), see the following section in Chapter 5, "Developing Color Management Modules," in Advanced Color Imaging on the Mac OS:

Developers of color management modules should see also the following in Chapter 4, "ColorSync Manager Reference for Color Management Modules," in Advanced Color Imaging Reference:

Profile Identifiers

The ColorSync Manager now provides data structures that allow you to identify a profile based on a relatively small number of fields. You can use this capability to embed a profile reference, rather than an entire profile, in a color image or document. A profile identifier may specify a rendering intent for the profile, allowing you to change the rendering intent without having to embed an entire profile.

The ColorSync Manager also provides routines to search a list of profile references or search the ColorSync(TM) Profiles folder for profiles that match a specified profile identifier.

For an introduction to the use of profile identifiers, including sample code, see the following section in Chapter 4, "Developing ColorSync-Supportive Applications," in Advanced Color Imaging on the Mac OS:

For additional information on working with profile identifiers, see the following in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

Additional Postscript Support

Starting with PostScript version 2016, to provide better support for ColorSync and ICC profiles, Postscript Level 2 supports up to four-component color spaces through the addition of CIEBasedDEF and CIEBasedDEFG color spaces.

To use these new color spaces, the CMGetPS2ColorSpace function now supports profiles with four components, as well as scanner and monitor profiles that contain multidimensional table information. In previous versions of ColorSync, routines such as CMGetPS2ColorSpace returned an error if asked to generate PostScript code for a profile with more than three components.

The CIEBasedDEF and CIEBasedDEFG color spaces are extensions to the CIEBasedABC color space. To work with these color spaces, PostScript defines the RangeDEF, RangeHIJK, DecodeDEFG, and Table arrays. You can read more about how these arrays are used to convert CIEBasedDEF and CIEBasedDEFG color space values in the PostScript Language Reference Manual Supplement, version 2016.

IMPORTANT
If you use ColorSync to generate PostScript output for CIEBasedDEF and CIEBasedDEFG color spaces, be sure the printer has PostScript version 2016 or later.
For information on working with PostScript data, see the following in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

Color Conversion Routines Without Components

Color conversion routines are now an integral part of the ColorSync Manager, and are no longer implemented as a separate component. Prior to version 2.1, an application had to use the Component Manager to open a connection to the color conversion component, then pass the component instance as a parameter to the color conversion functions. Now you can call a color conversion routine directly, without supplying a component instance.

Note
For backward compatibility, component-based color conversion functions are still supported. However, old-style functions, such as CMXYZToLab, just call their newer, noncomponent counterparts, such as CMConvertXYZToLab. Use of the older functions is discouraged, and they are not guaranteed to work in future versions.
For information on working with color conversion routines, see the following section in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

New Bitmap Formats Supported

The ColorSync Manager now supports bitmap formats for additional color spaces: 24-bit RGB, 32-bit RGB with an alpha-last channel, and 24-bit Lab. Applications that only support 24-bit color can save space by using the 24-bit RGB or Lab spaces instead of their 32-bit counterparts.

For more information, see the following in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

Profile Reference Counts

The ColorSync Manager now keeps an internal reference count for each profile reference so that it can efficiently free the private memory and resources associated with that profile reference once the reference is no longer in use. A new routine, CMGetProfileRefCount, allows your application to check the current reference count value for a profile reference. Calling the CMCloneProfileRef function increments the count; calling CMCloseProfile decrements it.

To ensure the proper functioning of the ColorSync Manager's reference count mechanism, your application must take the following steps:

  1. When your application makes a cloned copy of a profile reference for use by an independent task, it must call the CMCloneProfileRef function to increment the count for that reference.

Note
When you make a duplicate copy of an entire profile with the CMCopyProfile routine, you do not call CMCloneProfileRef.
  1. When your application is finished with a profile reference, it must call the CMCloseProfile function to decrement the reference count. A task that uses a cloned copy of the profile reference must also call CMCloseProfile.

When a reference count for a profile reference reaches 0, the ColorSync Manager releases all private memory, files, and resources allocated in association with the reference.

For an overview of the new reference count mechanism, see the following section in Chapter 4, "Developing ColorSync-Supportive Applications," in Advanced Color Imaging on the Mac OS:

For information on working with the ColorSync Manager's reference count mechanism, see the following in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

Profile Changed Flag

The ColorSync Manager now maintains a flag that indicates whether the content of a profile has changed. The flag is set to false when a profile is opened. Calls that modify the profile (by adding to, setting, or deleting the profile header or tags) cause the flag to be set to true. Calling CMUpdateProfile causes the flag to be set to false. Calling CMCopyProfile causes the flag to be set to false for the resulting profile. The CMProfileModified routine returns the state of the flag.

For more information, see the following in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

Speed and Accuracy Enhancements

You can use a "lookup only" flag to skip interpolation and speed up runtime color conversion. You can also set a flag to disable gamut checking--this speeds up initialization because there is no need to build a gamut table, and also reduces profile size because no gamut information is stored. Other flags allow you to specify media attributes such as transparent versus reflective and glossy versus matte.

For more information, see the following in Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference:

Additional Illustrations

The following figure has been added to Chapter 4, "Developing ColorSync-Supportive Applications," in Advanced Color Imaging on the Mac OS.

The following figures have been added to Chapter 3, "ColorSync Manager Reference for Applications and Device Drivers," in Advanced Color Imaging Reference. These figures illustrate bit fields in the CM2Header structure that specify profile information.

Revised Sample Application

A revised version of the CSDemo application provides sample code that demonstrates how to use many of the new features of ColorSync 2.1. You can find the complete sample application at the following Web site:

ftp://ftpdev.info.apple.com/Developer_Services/Development_Kits/ColorSync/

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 NOV 1996