![]() |
PATH![]() |
![]() ![]() |
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
identifies a video card gamma profile tag;
new in ColorSync 2.5
.CMVideoCardGammaTable
stores video card gamma data in table format;
new in ColorSync 2.5
.CMVideoCardGammaFormula
stores video card gamma data in formula format;
new in ColorSync 2.5
.CMVideoCardGamma
specifies the video gamma data, in either table or formula format, to store with a video gamma profile tag;
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;
CMVideoCardGamma
.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;
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;
};
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;
CMVideoCardGammaTable
.CMVideoCardGammaFormula
.