// 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 int array (where (0,0) is * the top-left corner of the image and (1,0) is the adjacent pixel * to the right of (0,0) and (0,1) is the adjacent pixel to the bottom of * (0,0). */ public class image2DInt extends image{ /** * The 2d integer array representing the pixel grey level values. */ private int [][] values; /** * No argument constructor, sets all variables to 0. */ public image2DInt(){ width = 0; height = 0; values = new int [0][0]; } /** * Constructor that takes all the individual data structures and * combines them to form an image representation. * @param width of the image * @param height of the image * @values the 2d int array of grey level values */ public image2DInt(int width, int height, int [][] values){ this.width = width; this.height = height; this.values = (int [][]) values.clone(); } /** * Constructor that takes a 1d int array and generates an image2DInt * from it. * @param width of the image * @param height of the image * @values the 1d int array of grey level values */ public image2DInt(int width, int height, int [] values){ this.width = width; this.height = height; this.values = new int [width][height]; for(int j=0;j