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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: LOADCT and TVSCL
Next Topic: Color table editor

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

Current Time: Sat Oct 11 08:26:50 PDT 2025

Total time taken to generate the page: 1.03513 seconds