Re: Color conversions [message #61241] |
Thu, 10 July 2008 09:36 |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> MichaelT writes:
>
>> here is something I'd like to do and I do not know how, despite some
>> lengthy searches and trials:
>>
>> Say, I have displayed an image in a window and plotted some other
>> things on top. All that with a certain color table. Later, I want to
>> switch to a different color table and display the very content with
>> the new color table. I do not want to do all the displaying and
>> plotting, again. Just read the content of the window an display it
>> with another color table. So I tried something with TVRD - without any
>> success.
>> How would you do it? Is there a simple way?
>
> Not only is there no simple way, I think there is basically
> no way, unless you maybe are still using an 8-bit display.
>
> But, typically, people solve this problem by loading a new
> color table and re-displaying the graphic. :-)
And it should be easy, right? I mean you've encapsulated all your display code into a
routine, say "display_data" (right?), so all you have to do is
; default color table index
cidx = 0
repeat begin
; Load color table
loadct, cidx
; display data
display_data, mydata
; Get new colour table index
read, "New color table index [0-40] : ", cidx
endrep until (cidx lt 0 or cidx gt 40)
?
cheers,
paulv
|
|
|
Re: Color conversions [message #61242 is a reply to message #61241] |
Thu, 10 July 2008 09:33  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
MichaelT writes:
> But, I have a widget window where some stuff is displayed and I'd like
> to have some button "original color/false color" to quickly switch
> between two color tables at any time - without having to know what was
> actually displayed...
>
> But, it seems I will have to do it the usual way.
If you change you color tables with XCOLORS (instead of XLOADCT),
then you will be able to keep track of which color table index
was loaded.
http://www.dfanning.com/programs/xcolors.pro
This feature was designed for just exactly this problem.
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: Color conversions [message #61244 is a reply to message #61242] |
Thu, 10 July 2008 09:27  |
MichaelT
Messages: 52 Registered: May 2006
|
Member |
|
|
> Not only is there no simple way, I think there is basically
> no way, unless you maybe are still using an 8-bit display.
Ok, I suspected that...
>
> But, typically, people solve this problem by loading a new
> color table and re-displaying the graphic. :-)
Yes, usually I'd do it that way, too.
But, I have a widget window where some stuff is displayed and I'd like
to have some button "original color/false color" to quickly switch
between two color tables at any time - without having to know what was
actually displayed...
But, it seems I will have to do it the usual way.
Cheers,
Michael
|
|
|
Re: Color conversions [message #61245 is a reply to message #61244] |
Thu, 10 July 2008 09:17  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
MichaelT writes:
> here is something I'd like to do and I do not know how, despite some
> lengthy searches and trials:
>
> Say, I have displayed an image in a window and plotted some other
> things on top. All that with a certain color table. Later, I want to
> switch to a different color table and display the very content with
> the new color table. I do not want to do all the displaying and
> plotting, again. Just read the content of the window an display it
> with another color table. So I tried something with TVRD - without any
> success.
> How would you do it? Is there a simple way?
Not only is there no simple way, I think there is basically
no way, unless you maybe are still using an 8-bit display.
But, typically, people solve this problem by loading a new
color table and re-displaying the graphic. :-)
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.")
|
|
|