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 1 Palette Manager 1-1

Figure 1-1 The colors of the default color tables 1-19

Table 1-1 A courteous palette 1-10

Listing 1-1 Creating a red palette 1-22

Listing 1-2 A palette ('pltt') resource 1-23

Listing 1-3 Displaying different colors on different types of screens 1-25

Listing 1-4 Copying a color table to a palette 1-28

Listing 1-5 Animating with a palette 1-32

Listing 1-6 Changing the color environment of an offscreen graphics world 1-35

Chapter 2 Color Picker Manager 2-1

Figure 2-1 The standard dialog box for color pickers 2-4

Figure 2-2 Color picker choices in the standard dialog box for color pickers 2-5

Figure 2-3 A movable modal dialog box for color pickers 2-6

Figure 2-4 A movable modal application-owned dialog box 2-16

Figure 2-5 An application-created color picker 2-32

Listing 2-1 Using the PickColor function 2-8

Listing 2-2 An event filter function for the PickColor function 2-10

Listing 2-3 A color-changed function 2-11

Listing 2-4 Creating a movable modal system-owned dialog box 2-14

Listing 2-5 Creating an application-owned dialog box 2-15

Listing 2-6 Creating a color picker-owned dialog box 2-16

Listing 2-7 Setting the original and new colors 2-18

Listing 2-8 Determining the selected color 2-19

Listing 2-9 A sample event loop 2-21

Listing 2-10 Handling the Edit menu 2-23

Listing 2-11 Warning the color picker that it's about to be closed 2-27

Listing 2-12 Using the SetPickerProfile function to set the destination profile 2-27

Listing 2-13 Using the GetPickerProfile function to get the destination profile 2-28

Listing 2-14 Using the ExtractPickerHelpItem function 2-29

Listing 2-15 A component resource for a color picker 2-31

Listing 2-16 Handling Component Manager request codes 2-34

Listing 2-17 Initializing private data for a color picker 2-36

Listing 2-18 Testing whether an environment can support your color picker 2-37

Listing 2-19 Returning the dialog box items for a color picker 2-38

Listing 2-20 Redrawing a color picker 2-39

Listing 2-21 Responding to events before handing them to the Dialog Manager 2-39

Listing 2-22 Responding to events in color picker items 2-41

Listing 2-23 Handling events in the color picker's Edit menu 2-42

Listing 2-24 Returning the original or the new color 2-43

Listing 2-25 Setting colors 2-43

Listing 2-26 Returning icon data 2-45

Listing 2-27 Returning the color picker's prompt 2-46

Listing 2-28 Setting the color picker's prompt 2-46

Listing 2-29 Returning the destination profile 2-47

Listing 2-30 Setting the destination profile 2-47

Listing 2-31 Specifying how the Edit menu should be set 2-48

Chapter 3 Introduction to the ColorSync Manager 3-1

Figure 3-1 Gray space 3-7

Figure 3-2 RGB color space 3-8

Figure 3-3 HSV color space and HLS color space 3-9

Figure 3-4 Additive colors expressed in RGB and subtractive colors expressed in CMYK 3-11

Figure 3-5 Yxy chromaticities in the CIE color space 3-13

Figure 3-6 L*a*b* color space 3-14

Figure 3-7 Color gamuts for two devices expressed in Yxy space 3-17

Figure 3-8 The ColorSync System Profile control panel 3-26

Figure 3-9 The ColorSync Manager and the Component Manager 3-27

Chapter 4 Developing ColorSync-Supportive Applications 4-1

Figure 4-1 Color matching when the source and destination profiles specify the same CMM 4-7

Figure 4-2 Color matching using the destination profile's CMM 4-8

Figure 4-3 Color matching using the source profile's CMM 4-9

Figure 4-4 Color matching through an XYZ interchange space using both CMMs 4-10

Figure 4-5 Matching using both CMMs and two interchange color spaces 4-11

Figure 4-6 Color matching using the Apple-supplied default CMM 4-12

Figure 4-7 Embedding profile data in a PICT file picture 4-34

Listing 4-1 Determining if ColorSync 2.x is available 4-14

Listing 4-2 Opening a reference to a file-based profile 4-19

Listing 4-3 Obtaining the current system profile 4-21

Listing 4-4 Two methods of color matching to a display 4-24

Listing 4-5 Matching the colors of a pixel map or a bitmap using a color world 4-30

Listing 4-6 Embedding a profile by prepending it before its associated picture 4-36

Listing 4-7 Counting the number of profiles in a picture 4-39

Listing 4-8 Calling the unflatten profile function to extract an embedded profile 4-42

Listing 4-9 The unflatten procedure 4-43

Listing 4-10 The comment procedure 4-46

Listing 4-11 Searching for specific profiles in the ColorSync(TM) Profiles folder 4-49

Listing 4-12 Setting up a location structure for procedure access to a resource-based profile 4-60

Listing 4-13 Disposing of a resource-based profile access structure 4-61

Listing 4-14 Responding to a procedure-based profile command 4-62

Listing 4-15 Handling the begin access command 4-65

Listing 4-16 Handling the create new access command 4-66

Listing 4-17 Handling the open read access command 4-66

Listing 4-18 Handling the open write access command 4-68

Listing 4-19 Handling the read access command 4-70

Listing 4-20 Handling the write access command 4-72

Listing 4-21 Handling the close access command 4-72

Listing 4-22 Handling the abort write access command 4-73

Listing 4-23 Handling the end access command 4-74

Listing 4-24 Searching for a profile that matches a profile identifier 4-76

Chapter 5 Developing Color Management Modules 5-1

Figure 5-1 The ColorSync Manager and the Component Manager 5-5

Listing 5-1 CMM component Rez listing 5-7

Listing 5-2 A CMM component shell 5-14

Chapter 6 Developing ColorSync-Supportive Device Drivers 6-1

Listing 6-1 Modifying the system profile header's quality flag and setting the header 6-19

Chapter 7 Color Manager 7-1

Figure 7-1 Sample inverse table 7-7

Figure 7-2 An inverse table of resolution 4 7-9

Figure 7-3 Creating an inverse table index 7-11

Table 7-1 Sample inverse table indexes 7-10

Table 7-2 A sample CSpecArray data structure 7-17

Listing 7-1 Adding and using a custom search function 7-14

Appendix ColorSync Manager Backward Compatibility A-1

Table A-1 ColorSync 1.0 functions and their ColorSync Manager counterparts A-9


#
Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996