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.RasterOp
This 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.ConvolveOp
convolve
static int
EDGE_NO_OP
Alias forConvolveOp.EDGE_NO_OP
.static int
EDGE_REFLECT
Adds a border to the image while convolving.static int
EDGE_WRAP
Adds a border to the image while convolving.static int
EDGE_ZERO_FILL
Alias forConvolveOp.EDGE_ZERO_FILL
.private int
edgeCondition
private java.awt.image.Kernel
kernel
-
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.BufferedImage
addBorder(java.awt.image.BufferedImage pOriginal, int pBorderX, int pBorderY)
java.awt.image.BufferedImage
createCompatibleDestImage(java.awt.image.BufferedImage pSource, java.awt.image.ColorModel pDesinationColorModel)
java.awt.image.WritableRaster
createCompatibleDestRaster(java.awt.image.Raster pSource)
java.awt.image.BufferedImage
filter(java.awt.image.BufferedImage pSource, java.awt.image.BufferedImage pDestination)
java.awt.image.WritableRaster
filter(java.awt.image.Raster pSource, java.awt.image.WritableRaster pDestination)
java.awt.geom.Rectangle2D
getBounds2D(java.awt.image.BufferedImage pSource)
java.awt.geom.Rectangle2D
getBounds2D(java.awt.image.Raster pSource)
int
getEdgeCondition()
Returns the edge condition.java.awt.image.Kernel
getKernel()
java.awt.geom.Point2D
getPoint2D(java.awt.geom.Point2D pSourcePoint, java.awt.geom.Point2D pDestinationPoint)
java.awt.RenderingHints
getRenderingHints()
-
-
-
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_FILL
andEDGE_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_FILL
andEDGE_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:
filter
in 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:
filter
in interfacejava.awt.image.RasterOp
-
createCompatibleDestImage
public java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage pSource, java.awt.image.ColorModel pDesinationColorModel)
- Specified by:
createCompatibleDestImage
in interfacejava.awt.image.BufferedImageOp
-
createCompatibleDestRaster
public java.awt.image.WritableRaster createCompatibleDestRaster(java.awt.image.Raster pSource)
- Specified by:
createCompatibleDestRaster
in interfacejava.awt.image.RasterOp
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage pSource)
- Specified by:
getBounds2D
in interfacejava.awt.image.BufferedImageOp
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.Raster pSource)
- Specified by:
getBounds2D
in interfacejava.awt.image.RasterOp
-
getPoint2D
public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D pSourcePoint, java.awt.geom.Point2D pDestinationPoint)
- Specified by:
getPoint2D
in interfacejava.awt.image.BufferedImageOp
- Specified by:
getPoint2D
in interfacejava.awt.image.RasterOp
-
getRenderingHints
public java.awt.RenderingHints getRenderingHints()
- Specified by:
getRenderingHints
in interfacejava.awt.image.BufferedImageOp
- Specified by:
getRenderingHints
in interfacejava.awt.image.RasterOp
-
getKernel
public java.awt.image.Kernel getKernel()
-
-