// Author Simon Horne // Last modified 16/9/99 //package code.connections; import java.awt.color.*; import java.awt.*; import java.util.*; /** * Image representation consisting of a 2d double array, double values are * generated from some convolutions, pixel multiplication (x0.5 etc). */ public class image2DDouble extends image{ /** * The 2d double array representing pixel grey levels, a value of * 100.75 may be used to represent a pixel internally for operators that * use double values but when passed to an operator that only uses * integer values, the values will be rounded to the nearest integer * (101 in this case). */ private double [][] values; /** * No argument constructor, initialises all variables to 0. */ public image2DDouble(){ width = 0; height = 0; values = new double [0][0]; } /** * Constructor that takes a 2d double array and combines this with * the width and height to make a new image2DDouble. * @param width the width of the image * @param height the height of the image * @param values the 2d double array of pixel grey level values */ public image2DDouble(int width, int height, double [][] values){ this.width = width; this.height = height; this.values = (double [][]) values.clone(); } /** * Constructs a new image2DDouble from a 1d double array. * @param width the width of the image * @param height the height of the image * @param values the 1d double array of pixel grey level values */ public image2DDouble(int width, int height, double [] values){ this.width = width; this.height = height; this.values = new double [width][height]; for(int j=0;j