KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > image > RasterOp


1 /*
2  * @(#)RasterOp.java 1.13 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt.image;
9
10 import java.awt.geom.Rectangle2D JavaDoc;
11 import java.awt.geom.Point2D JavaDoc;
12 import java.awt.RenderingHints JavaDoc;
13
14 /**
15  * This interface describes single-input/single-output
16  * operations performed on Raster objects. It is implemented by such
17  * classes as AffineTransformOp, ConvolveOp, and LookupOp. The Source
18  * and Destination objects must contain the appropriate number
19  * of bands for the particular classes implementing this interface.
20  * Otherwise, an exception is thrown. This interface cannot be used to
21  * describe more sophisticated Ops such as ones that take multiple sources.
22  * Each class implementing this interface will specify whether or not it
23  * will allow an in-place filtering operation (i.e. source object equal
24  * to the destination object). Note that the restriction to single-input
25  * operations means that the values of destination pixels prior to the
26  * operation are not used as input to the filter operation.
27  * @see AffineTransformOp
28  * @see BandCombineOp
29  * @see ColorConvertOp
30  * @see ConvolveOp
31  * @see LookupOp
32  * @see RescaleOp
33  * @version 10 Feb 1997
34  */

35 public interface RasterOp {
36     /**
37      * Performs a single-input/single-output operation from a source Raster
38      * to a destination Raster. If the destination Raster is null, a
39      * new Raster will be created. The IllegalArgumentException may be thrown
40      * if the source and/or destination Raster is incompatible with the types
41      * of Rasters allowed by the class implementing this filter.
42      * @param src the source <code>Raster</code>
43      * @param dest the destination <code>WritableRaster</code>
44      * @return a <code>WritableRaster</code> that represents the result of
45      * the filtering operation.
46      */

47     public WritableRaster JavaDoc filter(Raster JavaDoc src, WritableRaster JavaDoc dest);
48
49     /**
50      * Returns the bounding box of the filtered destination Raster.
51      * The IllegalArgumentException may be thrown if the source Raster
52      * is incompatible with the types of Rasters allowed
53      * by the class implementing this filter.
54      * @param src the source <code>Raster</code>
55      * @return a <code>Rectangle2D</code> that is the bounding box of
56      * the <code>Raster</code> resulting from the filtering
57      * operation.
58      */

59     public Rectangle2D JavaDoc getBounds2D(Raster JavaDoc src);
60
61     /**
62      * Creates a zeroed destination Raster with the correct size and number of
63      * bands.
64      * The IllegalArgumentException may be thrown if the source Raster
65      * is incompatible with the types of Rasters allowed
66      * by the class implementing this filter.
67      * @param src the source <code>Raster</code>
68      * @return a <code>WritableRaster</code> that is compatible with
69      * <code>src</code>
70      */

71     public WritableRaster JavaDoc createCompatibleDestRaster(Raster JavaDoc src);
72
73     /**
74      * Returns the location of the destination point given a
75      * point in the source Raster. If dstPt is non-null, it
76      * will be used to hold the return value.
77      * @param srcPt the source <code>Point2D</code>
78      * @param dstPt the destination <code>Point2D</code>
79      * @return the location of the destination point.
80      */

81     public Point2D JavaDoc getPoint2D(Point2D JavaDoc srcPt, Point2D JavaDoc dstPt);
82
83     /**
84      * Returns the rendering hints for this RasterOp. Returns
85      * null if no hints have been set.
86      * @return the <code>RenderingHints</code> object of this
87      * <code>RasterOp</code>.
88      */

89     public RenderingHints JavaDoc getRenderingHints();
90 }
91
Popular Tags