1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
/*
* GrayImage
*
* Copyright (c) 2001, 2002, 2003, 2004, 2005 Marco Schmidt
* All rights reserved.
*/
package net.sourceforge.jiu.data;
/**
* An interface for grayscale images.
* Grayscale images have only one channel.
* Each sample is a shade of gray, an intensity value between black (zero) and white (maximum value).
* Black and white photos are really grayscale photos.
* For images that only use black and white, see {@link BilevelImage}.
*
* @author Marco Schmidt
* @since 0.8.0
*/
public interface GrayImage
{
/**
* Returns if the pixel specified by the location in the arguments is black.
* @param x the horizontal location of the pixel
* @param y the vertical location of the pixel
* @throws IllegalArgumentException if any of the parameters are invalid
*/
boolean isBlack(int x, int y);
/**
* Returns if the pixel specified by the location in the arguments is white.
* @param x the horizontal location of the pixel
* @param y the vertical location of the pixel
* @throws IllegalArgumentException if any of the parameters are invalid
*/
boolean isWhite(int x, int y);
/**
* Sets a pixel to black (minimum intensity value).
* @param x horizontal position of the pixel's location
* @param y vertical position of the pixel's location
*/
void putBlack(int x, int y);
/**
* Sets a pixel to white (maximum intensity value).
* @param x horizontal position of the pixel's location
* @param y vertical position of the pixel's location
*/
void putWhite(int x, int y);
}
|