Table 9-4 New and revised code listings for ColorSync 2.5
Listing
|
Version 2.5 Notes
|
Listing 3-1
,
Determining if ColorSync 2.5 is available
|
Revised.
Checks for version 2.5.
|
Listing 3-2
,
Opening a reference to a file-based profile
|
Revised.
Replaced profLoc.u.file.spec with profLoc.u.fileLoc.spec.
|
Listing 3-3
,
Poor man's exception handling macro
|
New.
Provides the
require
macro for simple error handling.
|
Listing 3-4
,
Identifying the current system profile
|
Revised.
Returns
CMError
instead of
void
. Uses
require
error-handling macro.
|
Listing 3-5
,
Getting the profile for the main display
|
New.
Uses the new
CMGetProfileByAVID
function to get the profile for the main display.
|
Listing 3-6
,
Matching a picture to a display
|
Revised.
Formerly called both
NCMBeginMatching and
NCMDrawMatchedPicture . Now calls only the latter. Uses
require
error-handling macro.
|
Listing 3-7
,
Matching the colors of a bitmap using a color world
|
Revised.
Formerly called both
CWMatchPixMap
and
CWMatchBitmap
. Now calls only the latter (fixes bug 1669727). Uses
require
error-handling macro.
|
Listing 3-8
,
Embedding a profile by prepending it before its associated picture
|
Revised.
Uses
require
error-handling macro. Disposes of graphics world if necessary on error condition.
|
Listing 3-9
,
Counting the number of profiles in a picture
|
Revised.
Renamed bottleneck procedures for clarity.
|
Listing 3-10
,
Calling the CMUnflattenProfile function to extract an embedded profile
|
Revised.
Uses
require
error-handling macro. Performs cleanup if necessary on error condition.
|
Listing 3-13
,
An iteration function for profile searching with ColorSync 2.5
|
New.
Provides an iteration function for optimized profile searching with the new
MyProfileIterateProc
function.
|
Listing 3-14
,
A filter function for profile searching prior to ColorSync 2.5
|
New.
Provides a filter function to perform profile searching with the
CMNewProfileSearch
function that mimics the optimized searching supported by the
MyProfileIterateProc
function.
|
Listing 3-15
,
Optimized profile searching compatible with previous versions of ColorSync
|
New.
Provides sample code that performs an optimized profile search if ColorSync 2.5 is available, but provides a compatible (though not optimized) search if it is not.
|
Listing 4-1
,
Modifying a profile header's quality flag and setting the rendering intent
|
Revised.
Additional comments.
|