![]() |
PATH![]() |
![]() ![]() |
The ColorSync Manager defines the following types your application to use in searching for profiles.
IMPORTANT
These types do not take advantage of the profile cache added in ColorSync version 2.5. They are used with the searching described in Searching for Profiles Prior to ColorSync 2.5 .
CMSearchRecord
provides the ColorSync Manager with search criteria to use in determining which version 2.x profiles to include in a search result list and which to filter out.CMProfileSearchRef
stores a search result consisting of a list of profiles matching certain search criteria.
Your application supplies a search record of type
CMSearchRecord
as the
searchSpec
parameter to the function
CMNewProfileSearch
. The search record structure provides the ColorSync Manager with search criteria to use in determining which version 2.x profiles to include in the result list and which to filter out.
Most of the fields in the CMSearchRecord structure are identical to corresponding fields in the CM2Header structure for version 2.x profiles. When you set a bit in the searchMask field of the CMSearchRecord structure, you cause the search criteria to include the data specified by that bit. For example, if you set the cmMatchProfileCMMType bit, the search result will not include a profile unless the data in the profile header's CMMType field matches the data you specify in the CMSearchRecord structure's CMMType field.
IMPORTANT
If you specify a bit in the searchMask field, you must supply information in the CMSearchRecord field that corresponds to that bit.
The ColorSync Manager preserves the search criteria internally along with the search result list until your application calls the CMDisposeProfileSearch function to release the memory. This allows your application to call the CMUpdateProfileSearch function to update the search result if the ColorSync Profiles folder contents change without needing to provide the search specification again.
IMPORTANT
You cannot use the ColorSync Manager search functions to search for ColorSync 1.0 profiles.
A search record is defined by the CMSearchRecord type definition.
struct CMSearchRecord {
OSType CMMType; /* CMM signature */
OSType profileClass; /* profile signature */
OSType dataColorSpace; /* data color space */
OSType profileConnectionSpace; /* profile connection
color space */
unsigned long deviceManufacturer; /* device manufacturer */
unsigned long deviceModel; /* device model */
unsigned long deviceAttributes[2]; /* specifies attributes such as
paper or ink type */
unsigned long profileFlags; /* hints to CMM */
unsigned long searchMask; /* bitmap specifying search
mask fields to use */
CMProfileFilterUPP filter; /* pointer to function that
determines whether to
exclude profile */
};
cmMatchAnyProfile0x00000000
cmMatchProfileCMMType 0x00000001
cmMatchProfileClass 0x00000002
cmMatchDataColorSpace 0x00000004
cmMatchProfileConnectionSpace 0x00000008
cmMatchManufacturer 0x00000010
cmMatchModel 0x00000020
cmMatchAttributes 0x00000040
cmMatchProfileFlags 0x00000080
MyCMProfileFilterProc
.This type does not take advantage of the profile cache added in ColorSync version 2.5. It is used with the searching described in Searching for Profiles Prior to ColorSync 2.5 . See Cached Profile Searching for information on data structures used with searching in version 2.5.
A search result consists of a list of profiles matching certain search criteria. When your application calls the function
CMNewProfileSearch
to search in the ColorSync Profiles folder for profiles that meet certain criteria, the ColorSync Manager returns a reference to an internal private data structure containing the search result. Your application passes the search result reference to these ColorSync functions:
CMUpdateProfileSearch
updates a search result list.CMDisposeProfileSearch
disposes of a search result list.CMSearchGetIndProfile
opens a reference to a profile at a specific position in a search result list.CMSearchGetIndProfileFileSpec
obtains the file specification for a profile in a search result list.The ColorSync Manager uses an abstract private data structure of type OpaqueCMProfileSearchRef in defining the search result reference.
struct OpaqueCMProfileSearchRef *CMProfileSearchRef;
This type does not take advantage of the profile cache added in ColorSync version 2.5. It is used with the searching described in Searching for Profiles Prior to ColorSync 2.5 . See Cached Profile Searching for information on data structures used with searching in version 2.5.