Re: invert_ct? [message #4569] |
Thu, 08 June 1995 00:00 |
Greening C M
Messages: 5 Registered: April 1995
|
Junior Member |
|
|
dean@phobos.cira.colostate.edu wrote:
>
> There is h_eq_ct and gamma_ct, but is there a invert_ct to invert the
> color table of a raster image. If not, what would be the simplist way
> to invert the color table of an image with IDL?
>
> Bonus question - what would be the simplist way of inverting the values
> of an image itself?
>
> Kelly Dean
> CSU/CIRA
How about this?
image=255-image
|
|
|
Re: invert_ct? [message #4576 is a reply to message #4569] |
Wed, 07 June 1995 00:00  |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <3r3979$25me@yuma.ACNS.ColoState.EDU>, dean@phobos.cira.colostate.edu writes:
>
> There is h_eq_ct and gamma_ct, but is there a invert_ct to invert the
> color table of a raster image. If not, what would be the simplist way
> to invert the color table of an image with IDL?
>
xloadct() has an "invert_ct" option. Here is the code which does it.
"REVERSE" : BEGIN ;Reverse the table
l = lindgen(ncolors) + cbot
r_orig(cbot) = reverse(r_orig(l))
g_orig(cbot) = reverse(g_orig(l))
b_orig(cbot) = reverse(b_orig(l))
goto, set_gamma ;And redraw
ENDCASE
____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
|
|
|