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

Home » Public Forums » archive » Re: fsc_color problem on IDL7.1
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: fsc_color problem on IDL7.1 [message #66606 is a reply to message #66605] Sun, 24 May 2009 15:05 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Dick French writes:

> Welcome rfrench@titan.home to IDL Version: 7.1 !
> Current time: Sun May 24 11:11:32 2009
> IDL>
> ps_start,file='hohoho.ps'
> PostScript output will be created here: /Users/rfrench/hohoho.ps
> IDL> Plot, Findgen(11), COLOR=FSC_Color('navy'), /NODATA,
> XTITLE='Time', YTITLE='Signal'
> %FSC_COLOR: Keyword TRUE_COLOR not allowed in call to: DEVICE
>
> Traceback Report from FSC_COLOR:
>
> % Keyword TRUE_COLOR not allowed in call to: DEVICE
>
>
> I assume that fsc_color needs to know about the PS TRUECOLOR
> capabilities of IDL7.1.

OK, the 24-bit PostScript driver is going to be a *tremendous*
help to us...someday. Probably in some far off version of
IDL, unfortunately. For the moment, and in IDL 7.1 surely,
we are going to have to deal with chaos and confusion for
a while. This is because it is now possible to set the
PostScript device to work in 24-bit color, but it is NOT
possible to tell if the PostScript device is set to work
in 24-bit color, at least not programmatically. (I do wish
someone would read the comments of beta testers. It might
really help with these kinds of issues.)

Specifically, you can use the DECOMPOSED keyword to select
indexed color (DECOMPOSED=0) or true-color (DECOMPOSED=1),
but you can't use the GET_DECOMPOSED keyword to tell what the
PostScript device is currently set to. GET_DECOMPOSED is
not a valid keyword for the PostScript device. Sigh...

"Smart" programs like FSC_COLOR, TVIMAGE, and the like handle
colors correctly in a device-independent way because they
can figure out what you want from the state the graphics
device is in. If need be, they can change the state, do their
thing, and switch the state back to what it was when they
started, leaving you unbothered by the details.

So, to get FSC_COLOR to work correctly with the PostScript
device set in 24-bit color mode I had to create a device-
independent program that could tell me if color deposition
is turned ON or OFF for any IDL graphics device. I named
the program DecomposedColor. It can also tell you the
depth of the graphics device by using a DEPTH output keyword.
For PostScript, I process the results of the HELP, /DEVICE
command and look for the line that starts "Input Color Model".
You can find the program here:

http://www.dfanning.com/programs/decomposedcolor.pro

This program works identically for the WIN, X, MAC, Z, and
PS devices, and probably all the others that I haven't
really bothered to check.

It is a function that returns a 1 if the device is currently
set to use decomposed color and a 0 if the device is
currently set to use indexed color.

Once I know what I am dealing with, FSC_COLOR will work
correctly. You can find a new IDL 7.1 version here:

http://www.dfanning.com/programs/fsc_color.pro

It requires DECOMPOSEDCOLOR to work correctly.

Cheers,

David

P.S. Who wants to prepare the article for my web page that
answers the question: "How come all my PostScript output comes
out colored in shades of red?" I figure we should be proactive.
We are going to be answering this question a LOT!

Or, the alternative question: "How come every time I make
a PostScript file all I see is a blank sheet of paper?"
(Hint, think "white on white".)

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coyote Library Updated for 24-bit PS Color Support
Next Topic: TEXT FIELD in a CONTEXT MENU ?

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

Current Time: Sat Oct 11 07:51:12 PDT 2025

Total time taken to generate the page: 0.39922 seconds