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


  

Display Device Standard Methods

This section defines additional methods that display devices should implement to be compliant with the Macintosh terminal emulator extensions. These methods assume that the device supports at least 16 colors using the RGB color model and that a color lookup table (CLUT) exists that can be read and written to. The model assumes 8-bit values for each of the RGB components of the colors, where 0x00 implies no color and 0xFF indicates full saturation of the component. If fewer bits are available, the corresponding entries should be scaled appropriately.

Individual color entries are specified by their RGB values, using 8 bits for each. Each color is represented by an index. The index values for the 16-color extension are in the range 0 through 15; however, most display hardware will support at least 256 colors.

The following methods allow access to the CLUT from client programs, as well as the user interface described in the next section.

set-colors ( adr index #indices -- )
Allows setting a number of consecutive colors, starting at index, for #indices colors. The adr parameter is the address of a table of packed RGB components.
get-colors ( adr index #indices -- )
Allows reading a number of consecutive colors, starting at index, for #indices colors. The adr parameter is the address of a table that will be filled in with packed RGB components.
color! ( r g b index -- )
Allows setting a single color value, specified by index. The r, g, and b parameters are values to be placed into the red, green, and blue components, respectively.
color@ ( index -- r g b )
Allows reading the color components of a single color value, specified by index. The r, g, and b parameters are the values of the red, green, and blue components, respectively.

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