Re: Rendering an image

Hi Don,

> > VisAD does make a geometry for an image, but also an array
> > of pixels for texture mapping. Shapes can include the
> > geometry but not the texture map array. You can reduce an
> > iamge to pure geometry, but it requires two triangles per
> > pixel which will be slow for large images. You can
> > experiment with speed and memory use by disabling texture
> > mapping off when you display an image.
> Where is the geometry made (class/method)?  Most of the
> images I'm dealing with are small (legends, icons), so I
> don't think speed will be an issue.

VisAD turns images into geometry in the make2DGeometry()
method of, which returns the geometry
as a VisADGeometryArray (usually a VisADTriangleStripArray).
However, the Shadow*Type classes do some related computation
like deriving a Gridded3DSet in Cartesian display
coordinates from the Gridded2DSet domain Set of the image
FlatField, and making the 'byte[][] color_values' argument
to make2DGeometry() from the range values of the image.

I don't *think* it would be too hard for you to construct a
Gridded3DSet from your image (maybe just set all ZAxis
values to 0.0, and scale the XAxis and YAxis values
appropriately), and construct a 'byte[][] color_values'
array to pass to the make2DGeometry() method of the
Gridded3DSet you construct. I suggest passing false to the
'boolean indexed' argument - otherwise it will return a
VisADIndexedTriangleStripArray which is needless complexity.

Good luck,

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