KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)BufferedImageOp.java 1.26 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 <CODE>BufferedImage</CODE> objects.
17  * It is implemented by <CODE>AffineTransformOp</CODE>,
18  * <CODE>ConvolveOp</CODE>, <CODE>ColorConvertOp</CODE>, <CODE>RescaleOp</CODE>,
19  * and <CODE>LookupOp</CODE>. These objects can be passed into
20  * a <CODE>BufferedImageFilter</CODE> to operate on a
21  * <CODE>BufferedImage</CODE> in the
22  * ImageProducer-ImageFilter-ImageConsumer paradigm.
23  * <p>
24  * Classes that implement this
25  * interface must specify whether or not they allow in-place filtering--
26  * filter operations where the source object is equal to the destination
27  * object.
28  * <p>
29  * This interface cannot be used to describe more sophisticated operations
30  * such as those that take multiple sources. Note that this restriction also
31  * means that the values of the destination pixels prior to the operation are
32  * not used as input to the filter operation.
33
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  * @version 10 Feb 1997
43  */

44 public interface BufferedImageOp {
45     /**
46      * Performs a single-input/single-output operation on a
47      * <CODE>BufferedImage</CODE>.
48      * If the color models for the two images do not match, a color
49      * conversion into the destination color model is performed.
50      * If the destination image is null,
51      * a <CODE>BufferedImage</CODE> with an appropriate <CODE>ColorModel</CODE>
52      * is created.
53      * <p>
54      * An <CODE>IllegalArgumentException</CODE> may be thrown if the source
55      * and/or destination image is incompatible with the types of images $
56      * allowed by the class implementing this filter.
57      *
58      * @param src The <CODE>BufferedImage</CODE> to be filtered
59      * @param dest The <CODE>BufferedImage</CODE> in which to store the results$
60      *
61      * @return The filtered <CODE>BufferedImage</CODE>.
62      *
63      * @throws IllegalArgumentException If the source and/or destination
64      * image is not compatible with the types of images allowed by the class
65      * implementing this filter.
66      */

67     public BufferedImage JavaDoc filter(BufferedImage JavaDoc src, BufferedImage JavaDoc dest);
68
69     /**
70      * Returns the bounding box of the filtered destination image.
71      * An <CODE>IllegalArgumentException</CODE> may be thrown if the source
72      * image is incompatible with the types of images allowed
73      * by the class implementing this filter.
74      *
75      * @param src The <CODE>BufferedImage</CODE> to be filtered
76      *
77      * @return The <CODE>Rectangle2D</CODE> representing the destination
78      * image's bounding box.
79      */

80     public Rectangle2D JavaDoc getBounds2D (BufferedImage JavaDoc src);
81
82     /**
83      * Creates a zeroed destination image with the correct size and number of
84      * bands.
85      * An <CODE>IllegalArgumentException</CODE> may be thrown if the source
86      * image is incompatible with the types of images allowed
87      * by the class implementing this filter.
88      *
89      * @param src The <CODE>BufferedImage</CODE> to be filtered
90      * @param destCM <CODE>ColorModel</CODE> of the destination. If null,
91      * the <CODE>ColorModel</CODE> of the source is used.
92      *
93      * @return The zeroed destination image.
94      */

95     public BufferedImage JavaDoc createCompatibleDestImage (BufferedImage JavaDoc src,
96                             ColorModel JavaDoc destCM);
97
98     /**
99      * Returns the location of the corresponding destination point given a
100      * point in the source image. If <CODE>dstPt</CODE> is specified, it
101      * is used to hold the return value.
102      * @param srcPt the <code>Point2D</code> that represents the point in
103      * the source image
104      * @param dstPt The <CODE>Point2D</CODE> in which to store the result
105      *
106      * @return The <CODE>Point2D</CODE> in the destination image that
107      * corresponds to the specified point in the source image.
108      */

109     public Point2D JavaDoc getPoint2D (Point2D JavaDoc srcPt, Point2D JavaDoc dstPt);
110
111     /**
112      * Returns the rendering hints for this operation.
113      *
114      * @return The <CODE>RenderingHints</CODE> object for this
115      * <CODE>BufferedImageOp</CODE. Returns
116      * null if no hints have been set.
117      */

118     public RenderingHints JavaDoc getRenderingHints();
119 }
120
Popular Tags