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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: fsc_color problem on IDL7.1 [message #66602] Mon, 25 May 2009 04:51
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On May 25, 12:01 am, David Fanning <n...@dfanning.com> wrote:
> Dick French writes:
>> David - thanks for the quick work! I noticed that decomposedcolor.pro
>> was written next November - we must have gotten a special prerelease
>> version!
>> Dick
>
>> ; MODIFICATION HISTORY:
>> ;
>> ; Written by: David W. Fanning, November 24, 2009.
>
> Geez, no wonder I feel like the summer is almost over. :-(
>

As usual, you are ahead of your time!
Re: fsc_color problem on IDL7.1 [message #66604 is a reply to message #66602] Sun, 24 May 2009 21:01 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Dick French writes:

> David - thanks for the quick work! I noticed that decomposedcolor.pro
> was written next November - we must have gotten a special prerelease
> version!
> Dick
>
>
> ; MODIFICATION HISTORY:
> ;
> ; Written by: David W. Fanning, November 24, 2009.

Geez, no wonder I feel like the summer is almost over. :-(

Cheers,

David

--
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.")
Re: fsc_color problem on IDL7.1 [message #66605 is a reply to message #66604] Sun, 24 May 2009 20:25 Go to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
David - thanks for the quick work! I noticed that decomposedcolor.pro
was written next November - we must have gotten a special prerelease
version!
Dick


; MODIFICATION HISTORY:
;
; Written by: David W. Fanning, November 24, 2009.
Re: fsc_color problem on IDL7.1 [message #66606 is a reply to message #66605] Sun, 24 May 2009 15:05 Go 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.")
Re: fsc_color problem on IDL7.1 [message #66607 is a reply to message #66606] Sun, 24 May 2009 10:23 Go 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.

I had this program open for another reason the other day, and
I was playing around with the IDL 7.1 beta, so I thought
I would just set it up to work properly with 24-bit color
in PostScript. But in the final IDL 7.1, they abandoned
the TRUE_COLOR keyword for something else (DECOMPOSED=1,
I think, which would make a LOT more sense to me).

Unfortunately, I don't have the official 7.1 version, so
I don't know how to fix this. If someone figures it out,
please let me know.

Cheers,

David
--
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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 13:52:05 PDT 2025

Total time taken to generate the page: 0.00452 seconds