NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: Alpha Blending?


Hi Bill,


Bill Hibbard wrote:



Oops, That should be (index -> (r, g, b, SetType(x, y))).


Also, how do I get the colors involved?  Do I make r, g, and b RealTypes
and give them values as a RealTuple and map them to ScalarMaps?


Yes, except that r, g, b and a Set with type SetType(x, y)
will be 4 members of a Tuple, not a RealTuple.


I think I'm almost there.  Working on a generic example, I have:



latLon_RTT = new RealTupleType(lat, lon);
RealType index = RealType.getRealType("index", null, null);
Integer1DSet indexSet = new Integer1DSet(index, 4);

float[][] vals1 = { {0.0f, 10.0f, 10.0f}, {0.0f, 2.0f, 5.0f} };
float[][] vals2 = { {0.0f, 8.0f, 10.0f, 10.0f}, {0.0f, 10.0f, 10.0f, 8.0f} };
float[][] vals3 = { {0.0f, 4.0f, 6.0f}, {0.0f, 10.0f, 10.0f} };
float[][] vals4 = { {0.0f, 2.0f, 2.0f, 0.0f}, {8.0f, 8.0f, 10.0f, 10.0f} };

Irregular2DSet g2s1 = new Irregular2DSet(latLon_RTT, vals1);
Irregular2DSet g2s2 = new Irregular2DSet(latLon_RTT, vals2);
Irregular2DSet g2s3 = new Irregular2DSet(latLon_RTT, vals3);
Irregular2DSet g2s4 = new Irregular2DSet(latLon_RTT, vals4);

RealType red = RealType.getRealType("RED", null, null);
RealType green = RealType.getRealType("GREEN", null, null);
RealType blue = RealType.getRealType("BLUE", null, null);
MathType[] rgb = new MathType[]{ red, green, blue, g2s1.getType()};

TupleType setTupleType = new TupleType(rgb);

FunctionType funcType = new FunctionType(index, setTupleType);
FieldImpl ff = new FieldImpl(funcType, indexSet);



How do I set the samples for the FieldImpl?

For the first set I tried:

Data[] dat = { new Real(red, 1.0f),
               new Real(green, 0.5f),
               new Real(blue, 1.0f),
               g2s1};

Tuple t = new Tuple(setTupleType, dat);

ff.setSamples(0, t);

which doesn't compile.

I'm sorry to keep bugging everyone with this, but it looks like I'm almost there.

Thanks!

-kevin.


--
+------------------------------------------------------------+
Kevin L. Manross        [KD5MYD] <><          (405)-366-0557
CIMMS Research Associate               kevin.manross@xxxxxxxx
[NSSL-WRDD/SWATN]           http://www.cimms.ou.edu/~kmanross

"My opinions are my own and not representative of CIMMS, NSSL,
 NOAA or any affiliates"
+------------------------------------------------------------+


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