The
IlvRasterProperties class collects information about the raster image
to be tiled and the image to be displayed. This information comprises:
The raster bounds (coherent with the
coordinate system chosen).
The pixel density (in most cases, this
is the ratio between image size and pixel count in each direction).
The number of blocks in the raster and
the number of pixels in a line and in a column of a block. (usually
1).
The ordering of the pixels in the lines
and columns of a block.
The size that the destination tiles
of the raster should adopt.
The number of pixels the raster has
in both directions.
The transparent pixel value (if any).
The ColorModel
to
use with the image.
To create and set up raster properties, you can write,
for example:
IlvAdjustableDelegateColorModel csm=new
IlvAdjustableDelegateColorModel(myColorModel);
IlvRasterProperties p=new IlvRasterProperties(csm);
p.setX(xmin);
p.setY(ymax);
p.setWidth(xmax-xmin);
p.setHeight(ymin-ymax);
p.setColumnPixelCount(nbCols);
p.setLinePixelCount(nbRows);
p.setTransparentColorIndex(noDataValue);
p.setHorizontalPixelDensity(p.getWidth() / p.getColumnPixelCount());
p.setVerticalPixelDensity(p.getHeight() / p.getLinePixelCount());
If the variables
xmin
/
xmax
and
ymin
/
ymax
are
in longitudes, latitudes in radians, and the attached coordinate system
is
IlvGeographicCoordinateSystem, the reader uses the WGS84 transformation to be
coherent with these raster properties.
IlvCoordinateTransformation.CreateTransformation(
IlvGeographicCoordinateSystem.KERNEL,
IlvGeographicCoordinateSystem.WGS84).getTransform();