home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / image / RasterOp.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  2.9 KB  |  76 lines

  1. /*
  2.  * @(#)RasterOp.java    1.4 98/03/18
  3.  *
  4.  * Copyright 1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt.image;
  16.  
  17. import java.awt.geom.Rectangle2D;
  18. import java.awt.geom.Point2D;
  19.  
  20. /**
  21.  * This is an interface that describes single-input/single-output
  22.  * operations performed on Raster objects.  This is implemented by such
  23.  * classes as AffineTransformOp, ConvolveOp, and LookupOp.  The Source
  24.  * and Destination objects must contain the appropriate number
  25.  * of channels for the particular classes implementing this interface.
  26.  * Otherwise, an exception is thrown.  This interface cannot be used to
  27.  * describe more sophisticated Ops such as ones that take multiple sources.
  28.  * Each class implementing this interface will specify whether or not it
  29.  * will allow an in-place filtering operation (i.e. source object equal
  30.  * to the destination object).  Note that the restriction to single-input
  31.  * operations means that the values of destination pixels prior to the
  32.  * operation are not used as input to the filter operation.
  33.  * @see AffineTransformOp
  34.  * @see BandCombineOp
  35.  * @see ColorConvertOp
  36.  * @see ConvolveOp
  37.  * @see LookupOp
  38.  * @see RescaleOp
  39.  * @see ThresholdOp
  40.  * @version 10 Feb 1997
  41.  */
  42. public interface RasterOp {
  43.     /**
  44.      * Performs a single-input/single-output operation from a source Raster
  45.      * to a destination Raster.  If the destination Raster does not exist, a
  46.      * new Raster will be created.  The IllegalArgumentException may be thrown
  47.      * if the source and/or destination Raster is incompatible with the types
  48.      * of Rasters allowed by the subclass implementing this filter.
  49.      */
  50.     public WritableRaster filter(Raster src, WritableRaster dest);
  51.  
  52.     /**
  53.      * Returns the bounding box of the filtered destination Raster.
  54.      * The IllegalArgumentException may be thrown if the source Raster
  55.      * is incompatible with the types of Rasters allowed
  56.      * by the subclass implementing this filter.
  57.      */
  58.     public Rectangle2D getDestBounds(Raster src);
  59.  
  60.     /**
  61.      * Creates an empty destination Raster with the correct size and number of
  62.      * channels.
  63.      * The IllegalArgumentException may be thrown if the source Raster
  64.      * is incompatible with the types of Rasters allowed
  65.      * by the subclass implementing this filter.
  66.      */
  67.     public WritableRaster createCompatibleDestRaster(Raster src);
  68.     
  69.     /**
  70.      * Returns the location of the destination point given a
  71.      * point in the source Raster.  If dstPt is non-null, it
  72.      * will be used to hold the return value.
  73.      */
  74.     public Point2D getDestPoint(Point2D srcPt, Point2D dstPt);
  75. }
  76.