There have been a number of queries about 24-bit color lately, including
the use of writable color maps on systems that support it (24-bit
DirectColor visual). I attach for the interested reader a sample program
that plots a 24-bit color graph and manipulates the color tables.
The SGI O2 device looks like this:
Current graphics device: X
Server: X11.0, Silicon Graphics, Release 6001
Display Depth, Size: 24 bits, (1280,1024)
Visual Class: DirectColor (5)
Bits Per RGB: 8
Physical Color Map Entries (Used / Total): 256 / 256
Colormap: Private, 16777216 colors. Translation table: Enabled
Graphics pixels: Decomposed, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Req from Server.
When you hit the carriage return at the first prompt, the intensities of
all colors are reduced by a factor of two, making the plot darker. The
second <cr> restores the color tables.
On the O2, only the IDL window is affected by the color table changes.
Other open windows are unaffected. I don't know whether IDL is
responsible for this or the SGI hardware, but it is certainly the way that
you would want this feature to work.
Remember, you cannot print 24-bit graphics (other than bitmaps) to
PostScript with the current IDL PostScript device driver.
Ken Bowman
PRO TEST24_SGI
HELP, /DEVICE ;Show device
characteristics
cr = ' '
n = 1000L ;Number of points
x = RANDOMU(seed, n) ;X-coordinates
y = RANDOMU(seed, n) ;Y-coordinates
point_r = LONG(255*x) ;Red intensity of
each point
point_g = LONG(255*y) ;Green intensity of
each point
point_b = REPLICATE(0B, n) ;Blue intensity of
each point
point_color = point_r + 256L*(point_g + 256L*point_b) ;24-bit color of
each point
r = BINDGEN(256)
g = BINDGEN(256)
b = BINDGEN(256)
TVLCT, r, g, b ;Initialize color tables
TVLCT, r, g, b, /GET ;Get current color tables
PRINT, r, g, b ;Print current color
tables
PLOT, [0,0], [1,1], /NODATA
PLOTS, x, y, PSYM=1, COLOR = point_color ;Plot 24-bit scatterplot
PRINT, 'Enter <cr> to continue...'
READ, cr
TVLCT, r/2, g/2, b/2 ;Load new color tables
TVLCT, r, g, b, /GET ;Get current color tables
PRINT, r, g, b ;Print current color
tables
PRINT, 'Enter <cr> to continue...'
READ, cr
TVLCT, r, g, b ;Load new color tables
TVLCT, r, g, b, /GET ;Get current color tables
PRINT, r, g, b ;Print current color
tables
END
--
Dr. Kenneth P. Bowman, Professor 409-862-4060
Department of Meteorology 409-862-4466 fax
Texas A&M University bowmanATcsrp.tamu.edu
College Station, TX 77843-3150 Replace AT with @
|