public interface IRasterConverter
IRasterConverter is an interface which specifies the
methods to be used to convert a double [][] to a
BufferedImage. A class implementing this interface is
given to an IImageViewer through the setController
method in that interface. Each time the IImageViewer
setRaster is called, the convertRaster
method in IRasterConverter is called so that it can
convert the double[][] to a BufferdImage| Modifier and Type | Method and Description |
|---|---|
java.awt.image.BufferedImage |
convertRaster(double[][] raster)
convertRaster is called from the IImageViewer. |
void |
setImageViewer(IImageViewer viewer)
setImageViewer is called by the IImageViewer that
this IRasterConverter controls. |
java.awt.image.BufferedImage convertRaster(double[][] raster)
convertRaster is called from the IImageViewer. It
is responsible for changing a double[][] into a
BufferedImage
Oh, and by the way, the first dimension is the y-axis, and
the second is the x-axis:
double point;
for (int y = 0; y < raster.length; y++)
for (int x = 0; x < raster[y].length; x++)
point = raster[y][x];
raster - a double[][] valuevoid setImageViewer(IImageViewer viewer)
setImageViewer is called by the IImageViewer that
this IRasterConverter controls. It is called so that the class
implementing IRasterConverter can gain access to its
IImageViewer.viewer - an IImageViewer value