Colors Common Block? [message #12540] |
Thu, 20 August 1998 00:00  |
dirk
Messages: 15 Registered: March 1998
|
Junior Member |
|
|
A question about color tables:
I want a simple inverted black and white color table, and i define it
with red, green, and blue arrays that all run from 255 to 0. Then i load
them in with
tvlct,red,green,blue
No problem. BUT, now I want to play with the stretch and gamma correction
for this new color table just like with xloadct.
The functions gamma_ct and stretch seem to be designed for this, but they
always remove my color table and re-establish the old black and white.
Adding the /Current keyword doesn't help.
The /current keyword is described as:
Set this keyword to apply correction from the "current" color table (i.e.,
the values R_CURR, G_CURR, and B_CURR in the COLORS common block).
Otherwise, correction is applied from the "original" color table (i.e.,
the values R_ORIG, G_ORIG, and B_ORIG in the COLORS common block). The
gamma corrected color table is always saved in the "current" table
(R_CURR, G_CURR, B_CURR) and the new table is loaded.
So I have a feeling that i need to somehow edit this Colors common block
so it has my tvlct values in R_Curr, G_CURR, and B_CURR.
Can anyone help before i resort to (shudder) IRAF?
Thanks!
- Dirk
|
|
|
Re: Colors Common Block? [message #12608 is a reply to message #12540] |
Mon, 24 August 1998 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Dirk Fabian wrote:
>
> A question about color tables:
>
> I want a simple inverted black and white color table, and i define it
> with red, green, and blue arrays that all run from 255 to 0. Then i load
> them in with
>
> tvlct,red,green,blue
>
> No problem. BUT, now I want to play with the stretch and gamma correction
> for this new color table just like with xloadct.
>
> The functions gamma_ct and stretch seem to be designed for this, but they
> always remove my color table and re-establish the old black and white.
> Adding the /Current keyword doesn't help.
Dirk -
Welcome to the weird and wacky world of the COLORS common block!
Seems like a strange implementation to me, IMHO.
Try defining this common block in your code (at the level of your
stretch() call) and define the first 3 variables in this block:
common colors cr, cg, cb, curr, curg, curb
.
.
.
r=reverse(indgen(255))
g=r
b=r
tvlct, r,g,b
cr = r
cg = g
cb = b
; Now stretch() should use your "current" color-table!
Hope this helps.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|