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

Home » Public Forums » archive » Re: device,decomposed=1 question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: device,decomposed=1 question [message #14585] Fri, 12 March 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
William (vapuser@catspaw.jpl.nasa.gov) writes:

> Okay. I thought I understood this stuff, but now I'm not sure.
>
> This is how I thought it worked. In decomposed color, IDL takes the
> number and decomposes it into three single byte quantities, the least
> significant is the red number, the next most significant is the green
> number and the most significant is the blue number. It then uses these
> three numbers and looks up the color in the current color table.

No, it doesn't look the value up in the color table. The three
numbers *are* the color. There is no color table involved.
In a 24-bit image, it would be the pixel value in each of the
red, green, and blue planes that create the value that is actually
expressed. Again, no color table involved at all.

Now, if you are on a 24-bit device and you have an 8-bit number
(say 235) and you have color decomposition turned OFF. Then IDL
takes that number and uses that as an index into the color table
and it looks up the red, green, and blue values registered at
that index and it used *those* three values to express the color.

The same thing happens if you have an 8-bit image. IDL uses each
pixel value as an index into the color table, looking up the red,
green, and blue values to express the color.

> So, if you do the following
>
> IDL> loadct,3 ; red temperature
> IDL> tvlct,transpose( [0,255,0] ),1
> IDL> plot,indgen(10),color='000100'x
>
> You should see a y=x line in pure green. Right?
>
> But I don't. I see nothing! What is wrong with my understanding?

The color '000100'xL has no red, no blue, and only one
unit of green in it. That is, it is essentially black.

To prove this is true, try this:

plot,indgen(10),color='000100'xL, background='ffffff'xL

To get a green line, you must do this:

plot, indgen(10), color='00ff00'xL

Notice that with color decomposition turned ON, it doesn't
matter what color table you have loaded.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155

[Note: This follow-up was e-mailed to the cited author.]
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Building sharable object libraries for CALL_EXTERNAL
Next Topic: Re: Insert row in structure

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

Current Time: Wed Oct 08 15:11:11 PDT 2025

Total time taken to generate the page: 0.00426 seconds