User Guide > Using Color in Graphics Windows > Device-specific Methods for Using Color
  

Device-specific Methods for Using Color
Use the SET_PLOT procedure to direct the graphics output to different devices. A scalar string you provide with the command identifies the device to which you wish to send graphics output.
Color Tables—Switching Between Devices
Because devices have differing capabilities, and not all are capable of representing the same number of colors, the treatment of color tables when switching devices is somewhat tricky. See the PV‑WAVE Reference for details on each supported device.
After selecting a new graphics output device, SET_PLOT will perform one of the following color table actions depending upon which keyword parameters are specified:
*Do nothing—This is the default action. The problem with this treatment is that PV‑WAVE’s internal color table incorrectly reflects the state of the device’s color table until TVLCT is called.
*Copy the device color table—If the Copy keyword parameter is set, the internal color table is copied into the device. This is the preferred method if you are displaying graphics and each color index is explicitly loaded.
*The color table copying is straightforward if both devices have the same number of color indices. If the new device has more colors than the old device, some color indices will be invalid. If the new device has less colors than the old, not all the colors are saved.
 
note
When the Interpolate keyword is set, the new device color table is loaded by interpolating the old color table to span the new number of color indices. This method works best when displaying images with continuous color ranges.
Combining Colors to Create Special Effects
You can use the write mask to specify one or more color planes whose bits you wish to manipulate or the plane you want to use to create the special effects. The way the special effects are rendered also depends on the value you provide for the graphics function. For more details, refer to the PV‑WAVE Reference.
The write mask is used to control how one graphics pattern interacts with another graphics pattern when plotting to a graphics window. The write mask allows you to create special effects when overlaying or superimposing images and patterns.
 
note
For example, some 24-bit displays allow the screen to be treated as two separate 12-bit images. This allows for “double-buffering”, a technique useful for animation, or for storing distance data to simplify hidden line and plane calculations in 3D applications.
Another possible application for the write mask is to simultaneously manage two 4-bit-deep images in a single graphics window instead of a single 8-bit-deep image. You could use the write mask to control whether the current graphics operation operates on the “top” image or the “bottom” image.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.