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

Managing Color With ColorSync


Video Card Gamma

Starting with version 2.5, ColorSync supports an optional profile tag for video card gamma. The tag specifies gamma information, stored either as a formula or in table format, to be loaded into the video card when the profile containing the tag is put into use.

The ColorSync Manager defines the following data types for working with the video card gamma profile tag


CMVideoCardGammaType

New in ColorSync 2.5

The ColorSync Manager defines the CMVideoCardGammaType data structure to specify a video card gamma profile tag.

struct CMVideoCardGammaType
{
    OSType              typeDescriptor;
    unsigned long       reserved;
    CMVideoCardGamma    gamma;
};
typedef struct CMVideoCardGammaType CMVideoCardGammaType;

Field descriptions

typeDescriptor
The signature type for a video card gamma tag. There is currently only one type possible, cmSigVideoCardGammaType .
reserved
This field is reserved and must contain the value 0.
gamma
A structure that specifies the video card gamma data for the profile tag, as described in CMVideoCardGamma .

CMVideoCardGammaTable

New in ColorSync 2.5

The ColorSync Manager defines the CMVideoCardGammaTable data structure to specify video card gamma data in table format. You specify the number of channels, the number of entries per channel, and the size of each entry. The last field in the structure is an array of size one that serves as the start of the table data. The actual size of the array is equal to the number of channels times the number of entries times the size of each entry.

struct CMVideoCardGammaTable
{
    unsigned short      channels;
    unsigned short      entryCount;
    unsigned short      entrySize;
    char                data[1];
};
typedef struct CMVideoCardGammaTable CMVideoCardGammaTable;

Field descriptions

channels
Number of gamma channels (1 or 3). If channels is set to 1 then the red, green, and blue lookup tables (LUTs) of the video card will be loaded with the same data. If channels is set to 3, then if the video card supports separate red, green, and blue LUTs, then the video card LUTs will be loaded with the data for the three channels from the data array.
entryCount
Number of entries per channel (1-based). The number of entries must be greater than or equal to 2.
entrySize
Size in bytes of each entry.
data
Variable-sized array of data. The size of the data is equal to channels * entryCount * entrySize .

CMVideoCardGammaFormula

New in ColorSync 2.5

The ColorSync Manager defines the CMVideoCardGammaFormula data structure to specify video card gamma data by providing three values each for red, blue and green gamma. The values represent the actual gamma, the minimum gamma, and the maximum gamma for each color. Specifying video gamma information by formula takes less space than specifying it with a table, but the results may be less precise.

struct CMVideoCardGammaFormula {
    Fixed           redGamma;
    Fixed           redMin;
    Fixed           redMax;
    Fixed           greenGamma;
    Fixed           greenMin;
    Fixed           greenMax;
    Fixed           blueGamma;
    Fixed           blueMin;
    Fixed           blueMax;
};

Field descriptions

redGamma
The gamma value for red. It must be greater than 0.0.
redMin
The minimum gamma value for red. It must be greater than 0.0 and less than 1.0.
redMax
The maximum gamma value for red. It must be greater than 0.0 and less than 1.0.
greenGamma
The gamma value for green. It must be greater than 0.0.
greenMin
The minimum gamma value for green. It must be greater than 0.0 and less than 1.0.
greenMax
The maximum gamma value for green. It must be greater than 0.0 and less than 1.0.
blueGamma
The gamma value for blue. It must be greater than 0.0.
blueMin
The minimum gamma value for blue. It must be greater than 0.0 and less than 1.0.
blueMax
The maximum gamma value for blue. It must be greater than 0.0 and less than 1.0.

CMVideoCardGamma

New in ColorSync 2.5

The ColorSync Manager defines the CMVideoCardGamma data structure to specify the video gamma data to store with a video gamma profile tag. The structure is a union that can store data in either table or formula format.

struct CMVideoCardGamma
{
    unsigned long                   tagType;
    union
    {
        CMVideoCardGammaTable       table;
        CMVideoCardGammaFormula     formula;
    }                               u;
};
typedef struct CMVideoCardGamma CMVideoCardGamma;

Field descriptions

tagType
A Video Card Gamma Storage Type constant that specifies the format of the data currently stored in the union. To determine the type of structure present in a specific instance of the CMVideoCardGamma structure, you test this union tag. If you are setting up a CMVideoCardGamma structure to store video card gamma data, you set tagType to a constant value that identifies the structure type you are using. The possible constant values are described in Video Card Gamma Storage Type .
table
A structure of type CMVideoCardGammaTable . If the tagType field has the value cmVideoCardGammaTableType , the CMVideoCardGamma structure's union field should be treated as a table, as described in CMVideoCardGammaTable .
formula
A structure of type CMVideoCardGammaFormula . If the tagType field has the value cmVideoCardGammaFormulaType , the CMVideoCardGamma structure's union field represents a formula, as described in CMVideoCardGammaFormula .

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