Important: The information in this document is obsolete and should not be used for new development.
Chapter 4 - Developing ColorSync-Supportive Applications
This chapter describes how you can use the ColorSync Manager to provide your users with color-matching and color gamut-checking services. Your ColorSync-supportive application can match the colors of an image created using one device to the color gamut of another device on which the image is to be rendered. Your application can allow your users to preview the results and adjust the colors of the matched image if desirable. To match or check the colors of an image across devices with different gamuts and characteristics, the ColorSync Manager uses profiles that contain information depicting a device. Using the ColorSync Manager, your application can search for and display a list or menu containing the names of available profiles for a particular device type, such as a printer, and allow your users to select the profile to define the destination device. You can modify the content of profiles to change how an image is rendered. These and other features that your application can provide using the ColorSync Manager are described in this chapter.
You need to read this chapter if your application will support the ColorSync Manager and provide your users with various color-matching and color-checking features. You should read this chapter even if you will provide only minimal support allowing your users to modify documents containing color images created using other applications that fully support the ColorSync Manager. This chapter tells you how to preserve profiles embedded in documents along with the images with which they are associated.
- Note
- See the preface for information on ColorSync Manager version numbers.
The features described in this chapter can also be used in developing ColorSync-supportive device drivers. Therefore, if you are developing a device driver that supports the ColorSync Manager, you should read this chapter in addition to "Developing ColorSync-Supportive Device Drivers" (page 6-3).
Before you read this chapter, you should read "Introduction to the ColorSync Manager" (page 3-3), which explains color theory and color management systems (CMSs). It provides an overview of the ColorSync Manager CMS, including the use of profiles, and also explains key terms.
While reading this chapter, you might want to refer to "ColorSync Manager Reference for Applications and Device Drivers" in Advanced Color Imaging Reference for details related to functions this chapter discusses.
Most high-level applications that support the ColorSync Manager automatically use either the color management module (CMM) specified by the source profile or the Apple-supplied default CMM, as determined internally by the CMM selection algorithm described later in this chapter. For this reason, you do not need to read the two ColorSync Manager chapters addressed to developers who provide CMMs--"Developing Color Management Modules" (page 5-3) in this book and "ColorSync Manager Reference for Color Management Modules" (page 4-3) in Advanced Color Imaging Reference. Nor do you need to read "Developing ColorSync-Supportive Device Drivers" (page 6-3) in this book. However, you should read the appendix, "ColorSync Manager Backward Compatibility."
Chapter Contents
- About ColorSync Application Development
- About the ColorSync Manager Programming Interface
- What Should a ColorSync-Supportive Application Do?
- At a Minimum
- Storing and Handling Profiles
- How the ColorSync Manager Selects a CMM
- Developing Your ColorSync-Supportive Application
- Determining if the ColorSync Manager Is Available
- Providing Minimal ColorSync Support
- Obtaining Profile References
- Opening a Profile and Obtaining a Reference to It
- Identifying the Current Default System Profile
- Matching Colors to Displays Using ColorSync With QuickDraw Operations
- Matching Colors in a Picture Containing an Embedded Profile or Profile Identifier
- Considerations
- Matching Colors as Your User Draws a Picture
- Creating a Color World for Color Matching and Checking Using the Low-Level Functions
- Matching Colors Using the Low-Level Functions
- Matching the Colors of a Pixel Map to the Display's Color Gamut
- Matching the Colors of a Bitmap Image to the Display's Color Gamut
- Embedding Profiles and Profile Identifiers
- Embedded Profile Format
- Embedding Different Profile Versions
- The NCMUseProfileComment Function
- Extracting Profiles Embedded in Pictures
- Step 1: Count the Profiles in the PICT File
- Step 2: Extract the Profile
- Part A: Calling the Unflatten Function
- Part B: Calling the Unflatten Function
- Part C: Calling the Comment Procedure
- Searching for Profiles in the ColorSync(TM) Profiles Folder
- Checking Colors Against a Destination Device's Gamut
- Creating and Using Device-Linked Profiles
- Considerations
- Providing Soft Proofs
- Calibrating a Device
- Accessing a Resource-Based Profile With a Procedure
- Defining a Data Structure for a Resource-Based Profile
- Setting Up a Location Structure for Procedure Access to a Resource-Based Profile
- Disposing of a Resource-Based Profile Access Structure
- Responding to a Procedure-Based Profile Command
- Handling the Begin Access Command
- Handling the Create New Access Command
- Handling the Open Read Access Command
- Handling the Open Write Access Command
- Handling the Read Access Command
- Handling the Write Access Command
- Handling the Close Access Command
- Handling the Abort Write Access Command
- Handling the End Access Command
- Searching for a Profile That Matches a Profile Identifier
- Summary of the ColorSync Manager
- Constants
- Data Structures
- Functions
- Accessing Profile Files
- Accessing Profile Elements
- Accessing Named Color Profile Values
- Matching Colors Using High-Level Functions With QuickDraw
- Matching Colors Using Low-Level Functions Without QuickDraw
- Using Embedded Profiles With QuickDraw
- Assigning and Accessing the System Profile File
- Searching External Profiles
- Searching For a Profile by Profile Identifier
- Converting Between Color Spaces
- PostScript Color-Matching Support Functions
- Locating the ColorSync(TM) Profiles Folder
- Converting 2.x Profiles to 1.0 Format
- Obtaining Information About a Color World
- Application-Supplied Functions for the ColorSync Manager