Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

Re: Specific alpha values

Hi Andrew,

>   I've got some radar data in my visad display, which I am overlaying
> over a filled in map and some other stuff.  The radar data is from
> a McIDAS ADDE image server.
> 
>   The bad bit is that a large black box surrounds the small amounts
> of rain (radar data).
>   So what I want to do is set 0 values in the radar data to be
> transparent.
>   This is something along the lines of mapping radarValue to ALPHA,
> but not quite, as I don't want a linear relationship.. I want to
> define my own function (in loose language).  This seems to be
> possible with mapping samples to colours, where you get your mouse
> and choose the R, G and B intensities for that sample, on a
> contiguous sample space thingy.
>   Can I do this for alpha?  How do I do it programatically?  I don't
> want the user having to drag his mouse around just to set 'no rain'
> to be transparent.

You can do it with a ScalarMap to Display.RGBA. The
getControl() method for this ScalarMap will return a
ColorAlphaControl, and you can call its setTable() method
to set the 4-component lookup table for red, green, blue
and alpha. See Sections 4.6 and 4.11 of the tutorial for
more details.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: