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

Managing Color With ColorSync


Non-Cached Profile Searching

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

Not Recommended in ColorSync 2.5

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 */
};

Field descriptions

CMMType
The signature of a CMM. The signature of the default CMM is specified by the kDefaultCMMSignature constant.
profileClass
The class signature identifying the type of profile to search for. For a list of profile class signatures, see Profile Class .
dataColorSpace
A data color space. For a list of the color space signatures, see Color Space Signatures .
profileConnectionSpace
A profile connection color space. The signatures for the two profile connection spaces supported by ColorSync, cmXYZData and cmLabData , are described in Color Space Signatures .
deviceManufacturer
The signature of the manufacturer.
deviceModel
The model of a device.
deviceAttributes
Attributes for a particular device setup, such as media, paper, and ink types.
profileFlags
Flags that indicate hints for the preferred CMM, such as quality, speed, and memory options. In most cases, you will not want to search for profiles based on the flags settings.
searchMask
A bitmask that specifies the search record fields to use in the profile search. Here are the defined bitmask values:

cmMatchAnyProfile0x00000000
cmMatchProfileCMMType 0x00000001
cmMatchProfileClass 0x00000002
cmMatchDataColorSpace 0x00000004
cmMatchProfileConnectionSpace 0x00000008
cmMatchManufacturer 0x00000010
cmMatchModel 0x00000020
cmMatchAttributes 0x00000040
cmMatchProfileFlags
0x00000080

filter
A pointer to an application-supplied function that determines whether to exclude a profile from the profile search result list. For more information, see the function MyCMProfileFilterProc.

VERSION NOTES

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.


CMProfileSearchRef

Not Recommended in ColorSync 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:

The ColorSync Manager uses an abstract private data structure of type OpaqueCMProfileSearchRef in defining the search result reference.

struct OpaqueCMProfileSearchRef *CMProfileSearchRef;

VERSION NOTES

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.


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