comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: device, true_color=24, decompose=0
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: device, true_color=24, decompose=0 [message #15781] Mon, 14 June 1999 00:00
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Gary Fu wrote:
> Based on the IDL documentation the "decomposed=0" for the "device"
> command allows users with TureColor displays to use IDL programs written
> for standard, PseudoColor displays without modification. But I don't
> understand why I got
> different results in the following two idl codes:
>
> device, pseudo=8
> window, xsize=100, ysize=100
> erase, 50
> print, min(tvrd()) ; print out 50
> tvlct, 100, 100, 100, 50
> erase, 50
> print, min(tvrd()) ; print out 50
>
> ****************************************************
>
> device, true_color=24, decompose=0
> window, xsize=100, ysize=100
> erase, 50
> print, min(tvrd()) ; print out 50
> tvlct, 100, 100, 100, 50
> erase, 50
> print, min(tvrd()) ; print out 100

The IDL 5.2 online book 'Using IDL', section 'Displaying Images',
subsection 'True Color Displays' explains how TVRD works differently in
True Color mode:

"Furthermore, if the same image is loaded into each channel, operation
of the display mimics that of a standard 8-bit deep pseudo-color
display. Most, but not all, IDL image processing procedures written for
a standard color display will run on a true-color display without
modification. The routines that transfer images to the display, TV and
TVSCL, write the same 8-bit data to each channel (channel 0) if no
channel parameter is present. The function TVRD, which reads data from
the display, returns the maximum value contained in the three-color
channels for each pixel if no channel parameter is present."

Thus in True Color mode, TVRD does not return the byte pixel values as
it does in 8 bit mode. To see this effect more clearly, try running the
example shown below, which prints both the color table values (from
TVLCT), and the pixel values (from TVRD):

;---cut here---
PRO TEST

;- Default color table

loadct,0
erase,50
tvlct,r,g,b,/get
print,'Red color table entry = ',r[50]
print,'Minimum pixel value = ',min(tvrd())

;- Modify color table entry 50

tvlct,100,100,100,50
erase,50
tvlct,r,g,b,/get
print,'Red color table entry = ',r[50]
print,'Minimum pixel value = ',min(tvrd())

END
;---cut here---

Here's what I get running on an SGI 24 bit console:

% idl
IDL Version 5.1 (IRIX mipseb). Research Systems, Inc.
Installation number: 13221-0.
Licensed for use by: Space Science and Engineering Center, Univ. of
WI-Madison

For basic information, enter "IDLInfo" at the IDL> prompt.

IDL> device,pseudo=8,decomp=0,retain=2
IDL> test
% Compiled module: TEST.
% Compiled module: LOADCT.
% Compiled module: FILEPATH.
% LOADCT: Loading table B-W LINEAR
Red color table entry = 89
Minimum pixel value = 50
Red color table entry = 100
Minimum pixel value = 50
IDL> help,/device
Available graphics_devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
Current graphics device: X
Server: X11.0, Silicon Graphics, Release 6001
Display Depth, Size: 8 bits, (1280,1024)
Visual Class: PseudoColor (3)
Bits Per RGB: 8
Physical Color Map Entries (Used / Total): 143 / 256
Colormap: Shared, 143 colors. Translation table: Enabled
Graphics pixels: Combined, Dither Method: Ordered
Write Mask: 255 (decimal) ff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Pixmap.
Window Status: ---------------------
id typ( x, y, backing store) id typ( x, y, backing
store)
0: Win( 640, 512, Pixmap)
IDL> exit

% idl
IDL Version 5.1 (IRIX mipseb). Research Systems, Inc.
Installation number: 13221-0.
Licensed for use by: Space Science and Engineering Center, Univ. of
WI-Madison

For basic information, enter "IDLInfo" at the IDL> prompt.

IDL> device,true=24,decomp=0,retain=2
IDL> test
% Compiled module: TEST.
% Compiled module: LOADCT.
% Compiled module: FILEPATH.
% LOADCT: Loading table B-W LINEAR
Red color table entry = 50
Minimum pixel value = 50
Red color table entry = 100
Minimum pixel value = 100
IDL> help,/device
Available graphics_devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
Current graphics device: X
Server: X11.0, Silicon Graphics, Release 6001
Display Depth, Size: 24 bits, (1280,1024)
Visual Class: TrueColor (4)
Bits Per RGB: 8
Physical Color Map Entries (Used / Total): 256 / 256
Colormap: Private, 16777216 colors. Translation table: Bypassed
Graphics pixels: Combined, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Pixmap.
Window Status: ---------------------
id typ( x, y, backing store) id typ( x, y, backing
store)
0: Win( 640, 512, Pixmap)
IDL> exit

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Previous Topic: idl on laptop linux
Next Topic: MPFIT improvements (speed)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 14:46:17 PDT 2025

Total time taken to generate the page: 0.20843 seconds