PATHDocumentation > Mac OS 8 and 9 > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


The Profile Cache and Optimized Searching

Starting with version 2.5, ColorSync creates a cache file (containing private data) in the Preferences folder to keep track of all currently-installed profiles. The cache stores key information about each profile, using a smart algorithm that avoids rebuilding the cache unless the profile folder has changed.

ColorSync takes advantage of the profile cache to speed up profile searching. This optimized searching can help your application speed up some operations, such as displaying a pop-up menu of available profiles.

ColorSync's intelligent cache scheme provides the following advantages in profile management:

ColorSync 2.5 provides a flexible new routine, CMIterateColorSyncFolder , that takes full advantage of the profile cache to provide truly optimized searching and quick access to profile information. For an example of how to use this routine in your application, see Performing Optimized Profile Searching .

IMPORTANT

Your application should use the CMIterateColorSyncFolder function, or one of the other ColorSync search functions described in Profile Searching , to search for a profile, even if you are only looking for one file. Do not search for a profile by obtaining the location of the profiles folder and searching for the file directly.

Note that calls to the ColorSync search routines available before version 2.5 cannot take full advantage of the profile cache. For example, with the CMNewProfileSearch routine, the caller passes in a search criteria and gets back a list of profiles that match that criteria. Before version 2.5, ColorSync had to open each profile to build the list, and the caller was likely to open each profile again after getting the list back. With version 2.5, ColorSync can at least use the profile cache to narrow down the list (unless the search criteria asks for all profiles!), but it cannot fully optimize the search process.


© 1988-1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)