GetGammaInfoList (csCode = 20)
The
GetGammaInfoList
routine is optional. Clients wishing to find a graphics card's available gamma tables formerly accessed the Slot Manager data structures. PCI graphics drivers must return this information directly.
In the future, gamma tables will be part of the display's domain, not the graphics driver's domain. In the meantime, graphics drivers must still provide support for them by responding to the
GetGammaInfoList
and
RetrieveGammaTable
calls. The
GetGammaInfoList
routine iterates over the gamma tables supported by the driver for the attached display.
OSErr = Status(theDeviceRefNum, cscGetGammaInfoList, &theVDGammaListRec);
-
--> csPreviousGammaTableID
-
ID of the previous gamma table
-
<-- csGammaTableID
-
ID of the gamma table following
csPreviousDisplayModeID
-
<-- csGammaTableSize
-
Size of the gamma table in bytes
-
<-- csGammaTableName
-
Gamma table name (C string)
The
csGammaTableName
parameter is a C string with a maximum of 31 characters. The driver needs to copy the name from its storage to the storage passed in by the caller. It can use
CStrCopy. The caller uses
csGammaTableSize
to allocate storage to read the entire structure, using the
RetrieveGammaTable
routine.
Observe these cautions:
-
A client will pass a
csPreviousGammaTableID
of
kGammaTableIDFindFirst
to get the first gamma table ID. The driver should return this value in the
csGammaTableID
field.
-
If the last gamma table ID is passed in the
csPreviousGammaTableID
field, the driver should put a
kGammaTableIDNoMoreTables
in the
csGammaTableID
field and return
noErr
.
-
If an invalid gamma table ID is passed in the
csPreviousGammaTableID
field, the driver should return
paramErr
and should not modify the data structure.
-
A client can pass
csPreviousGammaTableID
with a value of
kGammaTableIDSpecific
. This tells the driver that the
csGammaTableID
contains the ID of the table that the client wants information about. This is a way to bypass iteration through all the tables when the caller already knows the
GammaTableID
.
-
Although the
GetGammaInfoList
call appears to perform its iteration operations similarly to the
GetNextResolution
call, there is an important difference.
GetGammaInfoList
only returns information for gamma tables that are applicable to the attached display;
GetNextResolution
returns the information regardless of what display is connected.
© 1999 Apple Computer, Inc. (Last Updated 26 March 99)