[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: device, get_decomposed question



Daniel Peduzzi wrote:

> The use of the "get_decomposed" query seems to be affecting the
> way my images are displayed.  If I comment out the second device
> command, I see the expected behavior:  the second image contains
> shades of red.  If I leave the command in, I get another grayscale image.
>
> Why would a query command affect any kind of display operation?
> I'm sure I'm missing something here.
>
> device, true_color=24, decomposed=0
>
> ; The appearance of the last image depends upon whether the next line is commented out
> device, get_decomposed=isDecomposed
>
> ; Load grayscale color tables
> r = indgen(256)
> g = indgen(256)
> b = indgen(256)
> tvlct, r, g, b
>
> ; Make a simple image and display it
> image = indgen(128,128)
> image = bytscl(image)
> window, 30, xsize=128, ysize=128
> tv, image
>
> stop ; and look at the pretty grayscale image
>
> ; Now reload the color tables so that only a red component is present.
> g(*)=0
> b(*)=0
> tvlct, r, g, b
>
> tv, image  ; Hopefully, I'm seeing red
>
> end

Apparently there's something odd happening in IDL for UNIX (at least on my SGI box).
Here's an example I just ran in a new IDL 5.2 session without a startup file:

device, true=24, decomposed=0
device, get_decomposed=decomp
print, decomp
      1
loadct, 1
tvscl, dist(256)
device, get_decomposed=decomp
print, decomp
      1

Although I loaded the blue/white color table, the image displayed as greyscale because
the color table is bypassed in decomposed color mode. So the second statement must be
corrupting the decomposed setting.

The following session however gives the desired blue/white image:

device, true=24, decomposed=0
window, /free    ;- Lock in truecolor un-decomposed mode
device, get_decomposed=decomp
print, decomp
      0
loadct, 1
tvscl, dist(256)
device, get_decomposed=decomp
print, decomp
      0

IDL 5.2 under Windows does not have this problem: both of the examples above produce a
blue/white image.

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley