001 /* 002 * GrayImage 003 * 004 * Copyright (c) 2001, 2002 Marco Schmidt <marcoschmidt@users.sourceforge.net> 005 * All rights reserved. 006 */ 007 008 package net.sourceforge.jiu.data; 009 010 /** 011 * An interface for grayscale images. 012 * Grayscale images have only one channel. 013 * Each sample is a shade of gray, an intensity value between black (zero) and white (maximum value). 014 * Black and white photos are really grayscale photos. 015 * For images that only use black and white, see {@link BilevelImage}. 016 * 017 * @author Marco Schmidt 018 * @since 0.8.0 019 */ 020 public interface GrayImage 021 { 022 /** 023 * Returns if the pixel specified by the location in the arguments is black. 024 * @param x the horizontal location of the pixel 025 * @param y the vertical location of the pixel 026 * @throws IllegalArgumentException if any of the parameters are invalid 027 */ 028 boolean isBlack(int x, int y); 029 030 /** 031 * Returns if the pixel specified by the location in the arguments is white. 032 * @param x the horizontal location of the pixel 033 * @param y the vertical location of the pixel 034 * @throws IllegalArgumentException if any of the parameters are invalid 035 */ 036 boolean isWhite(int x, int y); 037 038 /** 039 * Sets a pixel to black (minimum intensity value). 040 * @param x horizontal position of the pixel's location 041 * @param y vertical position of the pixel's location 042 */ 043 void putBlack(int x, int y); 044 045 /** 046 * Sets a pixel to white (maximum intensity value). 047 * @param x horizontal position of the pixel's location 048 * @param y vertical position of the pixel's location 049 */ 050 void putWhite(int x, int y); 051 }