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

Home » Public Forums » archive » Re: LOADCT and TVSCL
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: LOADCT and TVSCL [message #38620] Fri, 19 March 2004 10:41 Go to next message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
No Nuno,

if you put 255-i that isn't a vector.
You can do:

v = reverse(indgen(256))

then v is a vector with 255,254,...0 and you can use like a RGB.

Bye :)


Nuno Oliveira wrote:
> Suppose I want to use B-W Linear color table inverted. From white do
> black. I thought this code could do it:
>
> LOADCT, 0
> for i = 0, 255 do TVLCT, 255-i, 255-i, 255-i, i
> TVSCL, img
>
> Doesn't work. I haven't understood well how TVLCT works? What's wrong?
> How can I make it?
>
> Thanks,
>
> Nuno.
>
Re: LOADCT and TVSCL [message #38622 is a reply to message #38620] Fri, 19 March 2004 09:28 Go to previous messageGo to next message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> Suppose I want to use B-W Linear color table inverted. From white do
> black. I thought this code could do it:
>
> LOADCT, 0
> for i = 0, 255 do TVLCT, 255-i, 255-i, 255-i, i
> TVSCL, img
>
> Doesn't work. I haven't understood well how TVLCT works? What's wrong?
> How can I make it?


Try sending arrays to tvlct instead...

i = 255 - indgen(256) ; create an array from 255 to 0
tvlct, i, i, i ; use this array for red, green and blue
Re: LOADCT and TVSCL [message #38718 is a reply to message #38622] Fri, 19 March 2004 11:20 Go to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Michael Wallace wrote:
>> Suppose I want to use B-W Linear color table inverted. From white do
>> black. I thought this code could do it:
>>
>> LOADCT, 0
>> for i = 0, 255 do TVLCT, 255-i, 255-i, 255-i, i
>> TVSCL, img
>>
>> Doesn't work. I haven't understood well how TVLCT works? What's wrong?
>> How can I make it?
>
>
>
> Try sending arrays to tvlct instead...
>
> i = 255 - indgen(256) ; create an array from 255 to 0
> tvlct, i, i, i ; use this array for red, green and blue

You could also leave the color table alone and manipulate the image instead.

IDL> img = BYTSCL(hanning(200,200), top = 150B) + 30B

IDL> loadCT, 0
IDL> tvscl, img
IDL> tvscl, 255B - img, 210, 0

Liam Gumley's IMDISP and David Fanning's TVIMAGE have this "inverting"
capability built-in via keywords.

ben
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: LOADCT and TVSCL
Next Topic: Color table editor

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

Current Time: Thu Oct 09 22:50:20 PDT 2025

Total time taken to generate the page: 0.48496 seconds