39 * describe more sophisticated Ops such as ones that take multiple sources. 40 * Each class implementing this interface will specify whether or not it 41 * will allow an in-place filtering operation (i.e. source object equal 42 * to the destination object). Note that the restriction to single-input 43 * operations means that the values of destination pixels prior to the 44 * operation are not used as input to the filter operation. 45 * @see AffineTransformOp 46 * @see BandCombineOp 47 * @see ColorConvertOp 48 * @see ConvolveOp 49 * @see LookupOp 50 * @see RescaleOp 51 */ 52 public interface RasterOp { 53 /** 54 * Performs a single-input/single-output operation from a source Raster 55 * to a destination Raster. If the destination Raster is null, a 56 * new Raster will be created. The IllegalArgumentException may be thrown 57 * if the source and/or destination Raster is incompatible with the types 58 * of Rasters allowed by the class implementing this filter. 59 * @param src the source <code>Raster</code> 60 * @param dest the destination <code>WritableRaster</code> 61 * @return a <code>WritableRaster</code> that represents the result of 62 * the filtering operation. 63 */ 64 public WritableRaster filter(Raster src, WritableRaster dest); 65 66 /** 67 * Returns the bounding box of the filtered destination Raster. 68 * The IllegalArgumentException may be thrown if the source Raster 69 * is incompatible with the types of Rasters allowed 70 * by the class implementing this filter. 71 * @param src the source <code>Raster</code> 72 * @return a <code>Rectangle2D</code> that is the bounding box of 73 * the <code>Raster</code> resulting from the filtering 74 * operation. 75 */ 76 public Rectangle2D getBounds2D(Raster src); 77 78 /** 79 * Creates a zeroed destination Raster with the correct size and number of 80 * bands. 81 * The IllegalArgumentException may be thrown if the source Raster 82 * is incompatible with the types of Rasters allowed 83 * by the class implementing this filter. 84 * @param src the source <code>Raster</code> 85 * @return a <code>WritableRaster</code> that is compatible with 86 * <code>src</code> 87 */ 88 public WritableRaster createCompatibleDestRaster(Raster src); 89 90 /** 91 * Returns the location of the destination point given a 92 * point in the source Raster. If dstPt is non-null, it 93 * will be used to hold the return value. 94 * @param srcPt the source <code>Point2D</code> 95 * @param dstPt the destination <code>Point2D</code> 96 * @return the location of the destination point. 97 */ 98 public Point2D getPoint2D(Point2D srcPt, Point2D dstPt); 99 100 /** 101 * Returns the rendering hints for this RasterOp. Returns 102 * null if no hints have been set. 103 * @return the <code>RenderingHints</code> object of this 104 * <code>RasterOp</code>. 105 */ 106 public RenderingHints getRenderingHints(); 107 } | 39 * describe more sophisticated Ops such as ones that take multiple sources. 40 * Each class implementing this interface will specify whether or not it 41 * will allow an in-place filtering operation (i.e. source object equal 42 * to the destination object). Note that the restriction to single-input 43 * operations means that the values of destination pixels prior to the 44 * operation are not used as input to the filter operation. 45 * @see AffineTransformOp 46 * @see BandCombineOp 47 * @see ColorConvertOp 48 * @see ConvolveOp 49 * @see LookupOp 50 * @see RescaleOp 51 */ 52 public interface RasterOp { 53 /** 54 * Performs a single-input/single-output operation from a source Raster 55 * to a destination Raster. If the destination Raster is null, a 56 * new Raster will be created. The IllegalArgumentException may be thrown 57 * if the source and/or destination Raster is incompatible with the types 58 * of Rasters allowed by the class implementing this filter. 59 * @param src the source {@code Raster} 60 * @param dest the destination {@code WritableRaster} 61 * @return a {@code WritableRaster} that represents the result of 62 * the filtering operation. 63 */ 64 public WritableRaster filter(Raster src, WritableRaster dest); 65 66 /** 67 * Returns the bounding box of the filtered destination Raster. 68 * The IllegalArgumentException may be thrown if the source Raster 69 * is incompatible with the types of Rasters allowed 70 * by the class implementing this filter. 71 * @param src the source {@code Raster} 72 * @return a {@code Rectangle2D} that is the bounding box of 73 * the {@code Raster} resulting from the filtering 74 * operation. 75 */ 76 public Rectangle2D getBounds2D(Raster src); 77 78 /** 79 * Creates a zeroed destination Raster with the correct size and number of 80 * bands. 81 * The IllegalArgumentException may be thrown if the source Raster 82 * is incompatible with the types of Rasters allowed 83 * by the class implementing this filter. 84 * @param src the source {@code Raster} 85 * @return a {@code WritableRaster} that is compatible with 86 * {@code src} 87 */ 88 public WritableRaster createCompatibleDestRaster(Raster src); 89 90 /** 91 * Returns the location of the destination point given a 92 * point in the source Raster. If dstPt is non-null, it 93 * will be used to hold the return value. 94 * @param srcPt the source {@code Point2D} 95 * @param dstPt the destination {@code Point2D} 96 * @return the location of the destination point. 97 */ 98 public Point2D getPoint2D(Point2D srcPt, Point2D dstPt); 99 100 /** 101 * Returns the rendering hints for this RasterOp. Returns 102 * null if no hints have been set. 103 * @return the {@code RenderingHints} object of this 104 * {@code RasterOp}. 105 */ 106 public RenderingHints getRenderingHints(); 107 } |