PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

SetGray (csCode = 6)

The optional SetGray routine is used with indexed devices to specify whether subsequent SetEntries calls fill a card's CLUT with actual colors or with the luminance-equivalent gray tones.

OSErr = Control(theDeviceRefNum, cscSetGray, &theVDGrayRecord );
--> csMode
Enable or disable luminance mapping

For actual colors (luminance mapping disabled), SetGray is passed a csMode value of 0; for gray tones (luminance mapping enabled), it is passed a csMode value of 1. Luminance equivalence should be determined by converting each RGB value into the hue-saturation-brightness system and then selecting a gray value of equal brightness. Mapping colors to luminance-equivalent gray tones lets a color monitor emulate a monochrome monitor exactly.

If a driver is told to disable luminance mapping and the connected display is known to be a monochrome device, the driver should set csMode to 1 and keep luminance mapping enabled.

A direct device should always save the csMode value. Luminance mapping, however, should never occur in control routines that modify the CLUT.


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)