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

Home » Public Forums » archive » Re: device,decomposed=0
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=0 [message #14230] Mon, 08 February 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
R.Bauer (R.Bauer@fz-juelich.de) writes:

> David Fanning wrote:
>
>> R.Bauer (R.Bauer@fz-juelich.de) writes:
>>
>>> Solution is:
>>>
>>> FUNCTION def_n_colors
>>> IF !d.n_colors GT 256 THEN RETURN,256 ELSE RETURN,!d.n_colors
>>> END
>>
>> Well, not exactly. But probably close enough for government work. :-)
>
> True, but how else could I handle 8Bit color displays accessing only 236
> colors and true color displays with decomposed,0 having 256 colors?

No, you are absolutely right. I'm sure this works for you.
I'm just saying that you cannot depend upon !D.N_Colors
reflecting the *correct* number of colors for all versions of
IDL all the time. And depending upon what you are doing,
you don't really want to know the number of colors anyway.
What you more often want to know is how many color table
elements are available. The system variable !D.Table_Size
is a more accurate value for this purpose.

But, of course, what you *really* want to know is the
type of color visual, the depth of the display, and
whether color decomposition is turned on or off at this
particular moment. All of this information is now available
in IDL 5.2 via keywords to the DEVICE command. If everyone
would just upgrade to IDL 5.2, we would have the color
situation licked. :-)

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
Re: device,decomposed=0 [message #14233 is a reply to message #14230] Mon, 08 February 1999 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:

> R.Bauer (R.Bauer@fz-juelich.de) writes:
>
>> Solution is:
>>
>> FUNCTION def_n_colors
>> IF !d.n_colors GT 256 THEN RETURN,256 ELSE RETURN,!d.n_colors
>> END
>
> Well, not exactly. But probably close enough for government work. :-)

True, but how else could I handle 8Bit color displays accessing only 236
colors and true color displays with decomposed,0 having 256 colors?

regards
R.Bauer
Re: device,decomposed=0 [message #14234 is a reply to message #14230] Mon, 08 February 1999 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Solution is:

FUNCTION def_n_colors
IF !d.n_colors GT 256 THEN RETURN,256 ELSE RETURN,!d.n_colors
END
Re: device,decomposed=0 [message #14235 is a reply to message #14230] Mon, 08 February 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
R.Bauer (R.Bauer@fz-juelich.de) writes:

> Solution is:
>
> FUNCTION def_n_colors
> IF !d.n_colors GT 256 THEN RETURN,256 ELSE RETURN,!d.n_colors
> END

Well, not exactly. But probably close enough for government work. :-)

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
Re: device,decomposed=0 [message #14264 is a reply to message #14230] Thu, 04 February 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
R.Bauer (R.Bauer@fz-juelich.de) writes:

> Problem: true color display using pseudo color by device,decomposed=0
>
> Result: pseudo color is enabled but !D.N_COLORS is 16777216
> in previous Version idl 5.1 it was 256

Is the moon full? There sure are a lot of bug reports today. :-(

But this, thankfully, is a bug *fix*. This is how it is
suppose to work. :-)

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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: New user & FEM
Next Topic: Re: oplot - error in plotting to Z buffer only

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

Current Time: Wed Oct 08 19:37:50 PDT 2025

Total time taken to generate the page: 0.00560 seconds