![]() |
PATH![]() |
![]() ![]() |
In most cases, a ColorSync version 2.x profile is stored in a disk file. (For information on profile version numbers see ColorSync and ICC Profile Format Version Numbers ) However, to support special requirements, a profile can also be located in memory or in an arbitrary location that is accessed by a procedure you specify. The ColorSync Manager provides the following data types for working with profile locations:
CMProfLoc
is a union that can describe a file-, handle-, pointer-, or procedure-based profile location.CMProfileLocation
is a structure that combines a union of type
CMProfLoc
with a tag to identify the location type in the union.CMFileLocation
is a structure that specifies the location of a file-based profile.CMHandleLocation
is a structure that specifies the location of a handle-based profile.CMPtrLocation
is a structure that specifies the location of a pointer-based profile.CMProcedureLocation
is a structure that specifies the location of a procedure-based profile.IMPORTANT
Starting with ColorSync version 2.5, you should use the
NCMGetProfileLocation
function to obtain a profile location, rather than theCMGetProfileLocation
function.
You use a union of type
CMProfLoc
to identify the location of a profile. You specify the union in the
u
field of the data type
CMProfileLocation
. Your application passes a pointer to a
CMProfileLocation
structure when it calls the
CMOpenProfile
function to identify the location of a profile or the
CMNewProfile
,
CMCopyProfile
, or
CWNewLinkProfile
functions to specify the location for a newly created profile.
You also pass a pointer to a
CMProfileLocation
structure to the
NCMGetProfileLocation
and
CMGetProfileLocation
functions to get the location of an existing profile. The
NCMGetProfileLocation
function is available starting with ColorSync version 2.5. It differs from its predecessor,
CMGetProfileLocation
, in that the newer version has a parameter for the size of the location structure for the specified profile.
union CMProfLoc {
CMFileLocation fileLoc; /* specifies location on disk*/
CMHandleLocation handleLoc; /* specifies location in relocatable memory */
CMPtrLocation ptrLoc; /* specifies location in nonrelocatable
memory */
CMProcedureLocation procLoc; /* specifies access procedure */
};
Your application passes a profile location structure of type CMProfileLocation when it calls:
CMOpenProfile
, specifying the location of a profile to openCMNewProfile
,
CWNewLinkProfile
, or
CMCopyProfile
functions, specifying the location of a profile to create or duplicate
struct CMProfileLocation {
short locType; /* location type for profile */
CMProfLoc u; /* location information for profile */
};
CMProfLoc
identifying the profile location.Your application uses the CMFileLocation structure to provide a file specification for a profile stored in a disk file. You provide a file specification structure in the CMProfileLocation structure's u field to specify the location of an existing profile or a profile to be created.
struct CMFileLocation {
FSSpec spec; /* specifies profile file location on disk */
};
Your application uses the CMHandleLocation structure to provide a handle specification for a profile stored in relocatable memory. You provide the handle specification structure in the CMProfileLocation structure's u field to specify an existing profile or a profile to be created.
struct CMHandleLocation {
Handle h; /* handle that specifies profile's location in memory */
};
Your application uses the CMPtrLocation structure to provide a pointer specification for a profile stored in nonrelocatable memory. You provide the pointer specification structure in the CMProfileLocation structure's u field to point to an existing profile.
struct CMPtrLocation {
Ptr p; /* pointer that specifies profile's location in memory */
};
Your application uses the CMProcedureLocation structure to provide a universal procedure pointer to a profile access procedure. You provide this structure in the CMProfileLocation structure's u field. The CMProcedureLocation structure also contains a pointer field to specify data associated with the profile access procedure.
The ColorSync Manager calls your profile access procedure when the profile is created, initialized, opened, read, updated, or closed.
struct CMProcedureLocation {
CMProfileAccessUPP proc; /* profile access function universal
procedure pointer */
void * refCon; /* pointer to access procedure's
private data, if any */
};
MyCMProfileAccessProc
.The ColorSync Manager defines the CMProfileAccessUPP type as follows:
typedef UniversalProcPtr CMProfileAccessUPP;