Appendix A. Summary of Functions and Data Structures

This appendix provides a quick reference to the Coloratura CMS. It lists all the Coloratura functions, and important data structures and parameters.

The lists of functions are grouped in sections as follows, according to the elements they affect:

  1. "Coloratura Access Functions"

  2. "Profile Functions"

  3. "Tag Functions"

  4. "Transform Functions"

  5. "CMM Functions" has a subsection "CMM Information Field Parameters."

The section "Data Structures" contains brief descriptions of all of the data structures that are used as arguments of Coloratura functions.


Note: Function names start with "cms", data type names start with "CMS", and parameters start with "CMS_".


Coloratura Access Functions

Function

Description

int32 cmsClose(CMSContext ctxt)

Frees all allocated memory.

int32 cmsOpen(CMSContext *pctxt)

Establishes a context for all subsequent calls to the Coloratura CMS.


Profile Functions

Function

Description

int32 cmsCloseProfile(
CMSContext ctxt,
CMSProfile prof)

Closes a profile in memory without saving to permanent storage.

int32 cmsCreateProfile(
CMSContext ctxt,
CMSProfile *prof)

Creates a new, empty profile, with an uninitialized header and no tag data.

int32 cmsDeleteProfile(
CMSContext ctxt,
char *name)

Deletes a profile from permanent storage.

int32 cmsEndProfileIteration(
CMSContext ctxt,
CMSProfileIterator profIterator)

Terminates a profile iteration and disposes of the iterator. Do not use the iterator after disposal.

int32 cmsExportProfile(
CMSContext ctxt,
CMSProfile prof,
uint32 *length,
void **outputData)

Generates an external format representation from an open profile.

int32 cmsFreeProfileExport(
CMSContext ctxt,
void *outputData)

Frees storage allocated by cmsExportProfile().

int32 cmsGetProfileHeader(
CMSContext ctxt,
cmsProfile prof,
icHeader *pHeader)

Gets the header from an open profile.

int32 cmsGetProfileSpecHeader(
CMSContext ctxt,
char *spec,
icHeader *pHeader)

Gets the header from a profile, which need not be open.

int32 cmsImportProfile(
CMSContext ctxt,
uint32 length,
void *inputData,
CMSProfile prof)

Generates a new profile from an external format.

int32 cmsNextProfileIteration(
CMSContext ctxt,
CMSProfileIterator profIterator,
char **spec)

Gets the next profile in an iteration.

int32 cmsOpenProfile(
CMSContext ctxt,
char *spec,
CMSProfile *prof)

Opens an existing profile for read/write.

int32 cmsSaveProfile(
CMSContext ctxt,
CMSProfile prof)

Saves to permanent storage all the modifications since the cmsOpenProfile() call. prof stays open in memory after a save.

int32 cmsSaveProfileAs(
CMSContext ctxt,
CMSProfile prof,
char *spec)

Saves a profile to permanent storage under a new name.

int32 cmsSetProfileHeader(
CMSContext ctxt,
CMSProfile prof,
icHeader *pHeader)

Places a new header in an open profile.

int32 cmsStartProfileIteration(
CMSContext ctxt,
CMSProfileIterator *profIterator)

Creates an iterator to start a profile iteration.


Tag Functions

Function

Description

int32 cmsDeleteTag(
CMSContext ctxt,
CMSProfile prof,
icTagSignature tagName)

Deletes a tag from a profile.

int32 cmsEndTagIteration(
CMSContext ctxt,
CMSTagIterator iterator)

Terminates an iteration and disposes of the iterator.

int32 cmsFreeTagValue(
CMSContext ctxt,
icTagSignature name,
void *data)

Frees tag data returned by cmsGetTag(), cmsGetTagProfileSpec(), or cmsNextTagIteration().

int32 cmsGetTag(
CMSContext ctxt,
CMSProfile prof,
icTagSignature name,
icTagTypeSignature *type,
uint32 *size,
void **data)

Gets data from a profile tag.

int32 cmsNextTagIteration(
CMSContext ctxt,
CMSTagIterator iterator,
icTagSignature *name,
icTagTypeSignature *type,
uint32 *size,
void **data)

Gets the next tag in an iteration.

int32 cmsSetTag(
CMSContext ctxt,
CMSProfile prof,
icTagSignature name,
uint32 size,
void *data)

Sets the tag name for the profile prof. If name doesn't exist in prof, creates the tag.

int32 cmsStartTagIteration(
CMSContext ctxt,
CMSProfile prof,
CMSTagIterator *iterator)

Creates an iterator and starts an iteration through all tags in a profile.


Transform Functions

Function

Description

int32 cmsApplyTfm(
CMSContext ctxt,
CMSTfm tfm,
CMSPixelBuffer *psrc,
CMSPixelBuffer *pdst)

Applies a transform to convert colors in the pixel buffer psrc and place the results in pdst.

int32 cmsCheckGamut(
CMSContext ctxt,
CMSTfm tfm,
CMSPixelBuffer *psrc,
unsigned char *pgamutmap)

Checks whether transformed pixel colors are in or out of gamut.

int32 cmsCreateGamutCheck(
CMSContextctxt,
int32 profileCount,
CMSProfile *profs,
icSignature cmm,
CMSTfm *ptfm)

Creates a transform to be used for a gamut check.

int32 cmsCreateTfm(
CMSContext ctxt,
int32 profileCount,
CMSProfile *profs,
icSignature cmm,
CMSTfm *ptfm)

Creates a transform from a set of profiles and a CMM.

int32 cmsDeleteTfm(
CMSContext ctxt,
CMSTfm tfm)

Deletes a transform.


CMM Functions

Function

Description

int32 cmsFreeCmmList(
CMSContext ctxt,
icSignature *cmms)

Frees memory allocated for a CMM list.

int32 cmsGetCmmInfo(
CMSContext ctxt,
icSignature cmm,
CMSInfoName name,
uint32 *value)

Gets information about a given CMM.

int32 cmsGetCmmList(
CMSContext ctxt,
uint32 *count,
icSignature **cmms)

Lists the available CMMs.

int32 cmsGetDefaultCmm(
CMSContext ctxt,
icSignature *cmm)

Identifies the current default CMM.


CMM Information Field Parameters

cmsGetCmmInfo() uses the CMM information-field names and values in the enumerated type CMSInfoName. The values are summarized in the following table.

Field name

Description and Values

CMS_CMM_NAME

Registered name uniquely identifying the CMM.

The value can be any ICC-registered 32-bit CMM name.

CMS_CMM_VERSION

Version of the CMM.

The value is a uint32 uniquely distinguishing the version of the CMM from all others

CMS_FW_VERSION

Version of the Coloratura framework for which the CMM has been programmed.

The value is 4 bytes: major version, minor version, revision, 0.

CMS_CAN_DO_IC

If TRUE, the CMM supports ICC profiles.

CMS_MULTIPLE_OK

If TRUE, the CMM supports transformations made from more than two profiles.


Data Structures

Name

Declaration

Description

CMSContext

typedef struct _CMSContext*CMSContext;

Points to an opaque data structure that stores internal working state of the CMS.

CMSInfoName

typedef enum {
CMS_CMM_NAME,
CMS_CMM_VERSION,
CMS_FW_VERSION,
CMS_CAN_DO_IC,
CMS_MULTIPLE_OK
} CMSInfoName;

Holds CMM information.

CMSPixelBuffer

typedef struct CMSPixelBuffer_s {
uint32 width;
uint32 height;
uint32 bitsPerChannel;
uint32 bytesPerPixel;
uint32 channels;
uint32 encode;
unsigned void *data;
} CMSPixelBuffer;

Describes raster pixel data:

width in pixels
height in pixels
bitsPerChannel 1 to 12
bytesPerPixel 32-bit boundaries
channels 1, 3, 4, 5, or 6
encode color encoding (see cms.h)
data pointer to data

CMSProfile

typedef struct _CMSProfile
*CMSProfile;

Points to an opaque data structure that identifies profiles in memory.

CMSProfileIterator

typedef struct _CMSProfileIterator
*CMSProfileIterator;

Points to an opaque data structure that keeps track of position during profile iterations.

CMSTagIterator

typedef struct _CMSTagIterator *CMSTagIterator;

Points to an opaque data structure that keeps track of position during tag iterations.

CMSTfm

typedef struct _CMSTfm *CMSTfm;

Points to an opaque data structure that holds transform data.

icHeader

This data structure is an enumerated type declared in the file ic.h

Lists header entries determined by the ICC Profile Format Specification

icSignature

This data type is declared in the file ic.h

An identifier determined by the ICC Profile Format Specification that is typically used to identify CMMs.

icTagSignature

This data structure is an enumerated type declared in the file ic.h

Lists names of tag descriptions determined by the ICC Profile Format Specification

icTagTypeSignature

This data structure is an enumerated type declared in the file ic.h

An identifier determined by the ICC Profile Format Specification.