package imageprocessing; /** In addition to the methods listed here, concrete classes * are encouraged to have a constructor which takes one String parameter, the * name of a file to be opened as an image. * * In addition, the toString() method should return a string representation * of the image which can be copied and pased into a text editor to be * saved as a ppm/pgm (this means the string must conform to the * standard file format for those files). * @author Lincoln Ritter */ public interface IImage { /** * * @return The width (number of columns) of the image */ public int getWidth(); /** * * @return The height (number of rows) of the image */ public int getHeight(); /** * * @param r The row of the pixel being set * @param c The column of the pixel being set * @param values an array of values to be set at location (r,c) * For color images, for example, * this would be a size three array ([R G B] ordering). * @throws IndexOutOfBoundsException thrown if the given row or column is out of bounds * @throws IllegalArgumentException thrown if the length of the values parameter is inappropriate for the image. */ public void setPixel(int r, int c, int[] values) throws IndexOutOfBoundsException, IllegalArgumentException; /** * * @param r The row of the pixel being set * @param c The column of the pixel being set * @return an array of values at the given row and column. * For color images, for example, * this would be a size three array ([R G B] ordering). * @throws IndexOutOfBoundsException thrown if the given row or column is out of bounds */ public int[] getPixel(int r, int c) throws IndexOutOfBoundsException; }