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 / BufferedImageOp.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  3.3 KB  |  86 lines

  1. /*
  2.  * @(#)BufferedImageOp.java    1.17 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 BufferedImage objects.
  23.  * This is implemented by such classes as AffineTransformOp, ConvolveOp,
  24.  * BandCombineOp, and LookupOp.  These objects can be passed into
  25.  * a BufferedImageFilter to operate on a BufferedImage in the
  26.  * ImageProducer-ImageFilter-ImageConsumer paradigm.
  27.  * This interface cannot be used to describe more sophisticated Ops
  28.  * such as ones that take multiple sources.  Each class implementing this
  29.  * interface will specify whether or not it will allow an in-place filtering
  30.  * operation (i.e. source object equal to the destination object).  Note
  31.  * that the restriction to single-input operations means that the
  32.  * values of destination pixels prior to the operation are not used
  33.  * as input to the filter operation.
  34.  * @see BufferedImage
  35.  * @see BufferedImageFilter
  36.  * @see AffineTransformOp
  37.  * @see BandCombineOp
  38.  * @see ColorConvertOp
  39.  * @see ConvolveOp
  40.  * @see LookupOp
  41.  * @see RescaleOp
  42.  * @see ThresholdOp
  43.  * @version 10 Feb 1997
  44.  */
  45. public interface BufferedImageOp {
  46.     /**
  47.      * Perform a single-input/single-output operation on a BufferedImage.
  48.      * If the color models for the two images do not match, a color
  49.      * conversion into the destination color model will be performed.
  50.      * If the destination image is null,
  51.      * a BufferedImage with an appropriate ColorModel will be created.
  52.      * The IllegalArgumentException may be thrown if the source and/or
  53.      * destination image is incompatible with the types of images allowed
  54.      * by the subclass implementing this filter.
  55.      */
  56.     public BufferedImage filter(BufferedImage src, BufferedImage dest);
  57.  
  58.     /**
  59.      * Returns the bounding box of the filtered destination image.
  60.      * The IllegalArgumentException may be thrown if the source 
  61.      * image is incompatible with the types of images allowed
  62.      * by the subclass implementing this filter.
  63.      */
  64.     public Rectangle2D getDestBounds (BufferedImage src);
  65.  
  66.     /**
  67.      * Creates an empty destination image with the correct size and number of
  68.      * components.
  69.      * The IllegalArgumentException may be thrown if the source 
  70.      * image is incompatible with the types of images allowed
  71.      * by the subclass implementing this filter.
  72.      * @param src       Source image for the filter operation
  73.      * @param destCM    ColorModel of the destination.  If null, the
  74.      *                  ColorModel of the source will be used.
  75.      */
  76.     public BufferedImage createCompatibleDestImage (BufferedImage src,
  77.                             ColorModel destCM);
  78.     
  79.     /**
  80.      * Returns the location of the destination point given a
  81.      * point in the source image.  If dstPt is non-null, it
  82.      * will be used to hold the return value.
  83.      */
  84.     public Point2D getDestPoint (Point2D srcPt, Point2D dstPt);
  85. }
  86.