Package com.twelvemonkeys.image
Class ConvolveWithEdgeOp
- java.lang.Object
-
- com.twelvemonkeys.image.ConvolveWithEdgeOp
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp,java.awt.image.RasterOp
public class ConvolveWithEdgeOp extends java.lang.Object implements java.awt.image.BufferedImageOp, java.awt.image.RasterOpThis class implements a convolution from the source to the destination.- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/ConvolveWithEdgeOp.java#1 $
- See Also:
ConvolveOp
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.image.ConvolveOpconvolvestatic intEDGE_NO_OPAlias forConvolveOp.EDGE_NO_OP.static intEDGE_REFLECTAdds a border to the image while convolving.static intEDGE_WRAPAdds a border to the image while convolving.static intEDGE_ZERO_FILLAlias forConvolveOp.EDGE_ZERO_FILL.private intedgeConditionprivate java.awt.image.Kernelkernel
-
Constructor Summary
Constructors Constructor Description ConvolveWithEdgeOp(java.awt.image.Kernel pKernel)ConvolveWithEdgeOp(java.awt.image.Kernel pKernel, int pEdgeCondition, java.awt.RenderingHints pHints)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.awt.image.BufferedImageaddBorder(java.awt.image.BufferedImage pOriginal, int pBorderX, int pBorderY)java.awt.image.BufferedImagecreateCompatibleDestImage(java.awt.image.BufferedImage pSource, java.awt.image.ColorModel pDesinationColorModel)java.awt.image.WritableRastercreateCompatibleDestRaster(java.awt.image.Raster pSource)java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage pSource, java.awt.image.BufferedImage pDestination)java.awt.image.WritableRasterfilter(java.awt.image.Raster pSource, java.awt.image.WritableRaster pDestination)java.awt.geom.Rectangle2DgetBounds2D(java.awt.image.BufferedImage pSource)java.awt.geom.Rectangle2DgetBounds2D(java.awt.image.Raster pSource)intgetEdgeCondition()Returns the edge condition.java.awt.image.KernelgetKernel()java.awt.geom.Point2DgetPoint2D(java.awt.geom.Point2D pSourcePoint, java.awt.geom.Point2D pDestinationPoint)java.awt.RenderingHintsgetRenderingHints()
-
-
-
Field Detail
-
EDGE_ZERO_FILL
public static final int EDGE_ZERO_FILL
Alias forConvolveOp.EDGE_ZERO_FILL.- See Also:
EDGE_REFLECT, Constant Field Values
-
EDGE_NO_OP
public static final int EDGE_NO_OP
Alias forConvolveOp.EDGE_NO_OP.- See Also:
EDGE_REFLECT, Constant Field Values
-
EDGE_REFLECT
public static final int EDGE_REFLECT
Adds a border to the image while convolving. The border will reflect the edges of the original image. This is usually a good default. Note that while this mode typically provides better quality than the standard modesEDGE_ZERO_FILLandEDGE_NO_OP, it does so at the expense of higher memory consumption and considerable more computation.- See Also:
- Constant Field Values
-
EDGE_WRAP
public static final int EDGE_WRAP
Adds a border to the image while convolving. The border will wrap the edges of the original image. This is usually the best choice for tiles. Note that while this mode typically provides better quality than the standard modesEDGE_ZERO_FILLandEDGE_NO_OP, it does so at the expense of higher memory consumption and considerable more computation.- See Also:
EDGE_REFLECT, Constant Field Values
-
kernel
private final java.awt.image.Kernel kernel
-
edgeCondition
private final int edgeCondition
-
convolve
private final java.awt.image.ConvolveOp convolve
-
-
Method Detail
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage pSource, java.awt.image.BufferedImage pDestination)- Specified by:
filterin interfacejava.awt.image.BufferedImageOp
-
addBorder
private java.awt.image.BufferedImage addBorder(java.awt.image.BufferedImage pOriginal, int pBorderX, int pBorderY)
-
getEdgeCondition
public int getEdgeCondition()
Returns the edge condition.- Returns:
- the edge condition of this
ConvolveOp. - See Also:
EDGE_NO_OP,EDGE_ZERO_FILL,EDGE_REFLECT,EDGE_WRAP
-
filter
public java.awt.image.WritableRaster filter(java.awt.image.Raster pSource, java.awt.image.WritableRaster pDestination)- Specified by:
filterin interfacejava.awt.image.RasterOp
-
createCompatibleDestImage
public java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage pSource, java.awt.image.ColorModel pDesinationColorModel)- Specified by:
createCompatibleDestImagein interfacejava.awt.image.BufferedImageOp
-
createCompatibleDestRaster
public java.awt.image.WritableRaster createCompatibleDestRaster(java.awt.image.Raster pSource)
- Specified by:
createCompatibleDestRasterin interfacejava.awt.image.RasterOp
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage pSource)
- Specified by:
getBounds2Din interfacejava.awt.image.BufferedImageOp
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.Raster pSource)
- Specified by:
getBounds2Din interfacejava.awt.image.RasterOp
-
getPoint2D
public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D pSourcePoint, java.awt.geom.Point2D pDestinationPoint)- Specified by:
getPoint2Din interfacejava.awt.image.BufferedImageOp- Specified by:
getPoint2Din interfacejava.awt.image.RasterOp
-
getRenderingHints
public java.awt.RenderingHints getRenderingHints()
- Specified by:
getRenderingHintsin interfacejava.awt.image.BufferedImageOp- Specified by:
getRenderingHintsin interfacejava.awt.image.RasterOp
-
getKernel
public java.awt.image.Kernel getKernel()
-
-