类 ConvolveFilter
- java.lang.Object
-
- org.meteoinfo.image.filter.AbstractBufferedImageOp
-
- org.meteoinfo.image.filter.ConvolveFilter
-
- 所有已实现的接口:
java.awt.image.BufferedImageOp,java.lang.Cloneable
- 直接已知子类:
AverageFilter,BlurFilter,BumpFilter,GaussianFilter,SharpenFilter
public class ConvolveFilter extends AbstractBufferedImageOp
A filter which applies a convolution kernel to an image.- 作者:
- Jerry Huxtable
-
-
字段概要
字段 修饰符和类型 字段 说明 protected booleanalphaWhether to convolve alpha.static intCLAMP_EDGESClamp pixels off the edge to the nearest edge.protected java.awt.image.KernelkernelThe convolution kernel.protected booleanpremultiplyAlphaWhether to promultiply the alpha before convolving.static intWRAP_EDGESWrap pixels off the edge to the opposite edge.static intZERO_EDGESTreat pixels off the edge as zero.
-
构造器概要
构造器 构造器 说明 ConvolveFilter()Construct a filter with a null kernel.ConvolveFilter(float[] matrix)Construct a filter with the given 3x3 kernel.ConvolveFilter(int rows, int cols, float[] matrix)Construct a filter with the given kernel.ConvolveFilter(java.awt.image.Kernel kernel)Construct a filter with the given 3x3 kernel.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static voidconvolve(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)Convolve a block of pixels.static voidconvolve(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, int edgeAction)Convolve a block of pixels.static voidconvolveH(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)Convolve with a kernel consisting of one row.static voidconvolveHV(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)Convolve with a 2D kernel.static voidconvolveV(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)Convolve with a kernel consisting of one column.java.awt.image.BufferedImagecreateCompatibleDestImage(java.awt.image.BufferedImage src, java.awt.image.ColorModel dstCM)java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)java.awt.geom.Rectangle2DgetBounds2D(java.awt.image.BufferedImage src)intgetEdgeAction()Get the action to perfomr for pixels off the image edges.java.awt.image.KernelgetKernel()Get the convolution kernel.java.awt.geom.Point2DgetPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)booleangetPremultiplyAlpha()Get whether to premultiply the alpha channel.java.awt.RenderingHintsgetRenderingHints()booleangetUseAlpha()Get whether to convolve the alpha channel.voidsetEdgeAction(int edgeAction)Set the action to perfomr for pixels off the image edges.voidsetKernel(java.awt.image.Kernel kernel)Set the convolution kernel.voidsetPremultiplyAlpha(boolean premultiplyAlpha)Set whether to premultiply the alpha channel.voidsetUseAlpha(boolean useAlpha)Set whether to convolve the alpha channel.java.lang.StringtoString()-
从类继承的方法 org.meteoinfo.image.filter.AbstractBufferedImageOp
clone, getRGB, setRGB
-
-
-
-
字段详细资料
-
ZERO_EDGES
public static int ZERO_EDGES
Treat pixels off the edge as zero.
-
CLAMP_EDGES
public static int CLAMP_EDGES
Clamp pixels off the edge to the nearest edge.
-
WRAP_EDGES
public static int WRAP_EDGES
Wrap pixels off the edge to the opposite edge.
-
kernel
protected java.awt.image.Kernel kernel
The convolution kernel.
-
alpha
protected boolean alpha
Whether to convolve alpha.
-
premultiplyAlpha
protected boolean premultiplyAlpha
Whether to promultiply the alpha before convolving.
-
-
构造器详细资料
-
ConvolveFilter
public ConvolveFilter()
Construct a filter with a null kernel. This is only useful if you're going to change the kernel later on.
-
ConvolveFilter
public ConvolveFilter(float[] matrix)
Construct a filter with the given 3x3 kernel.- 参数:
matrix- an array of 9 floats containing the kernel
-
ConvolveFilter
public ConvolveFilter(int rows, int cols, float[] matrix)Construct a filter with the given kernel.- 参数:
rows- the number of rows in the kernelcols- the number of columns in the kernelmatrix- an array of rows*cols floats containing the kernel
-
ConvolveFilter
public ConvolveFilter(java.awt.image.Kernel kernel)
Construct a filter with the given 3x3 kernel.- 参数:
kernel- the convolution kernel
-
-
方法详细资料
-
setKernel
public void setKernel(java.awt.image.Kernel kernel)
Set the convolution kernel.- 参数:
kernel- the kernel- 另请参阅:
getKernel()
-
getKernel
public java.awt.image.Kernel getKernel()
Get the convolution kernel.- 返回:
- the kernel
- 另请参阅:
setKernel(java.awt.image.Kernel)
-
setEdgeAction
public void setEdgeAction(int edgeAction)
Set the action to perfomr for pixels off the image edges.- 参数:
edgeAction- the action- 另请参阅:
getEdgeAction()
-
getEdgeAction
public int getEdgeAction()
Get the action to perfomr for pixels off the image edges.- 返回:
- the action
- 另请参阅:
setEdgeAction(int)
-
setUseAlpha
public void setUseAlpha(boolean useAlpha)
Set whether to convolve the alpha channel.- 参数:
useAlpha- true to convolve the alpha- 另请参阅:
getUseAlpha()
-
getUseAlpha
public boolean getUseAlpha()
Get whether to convolve the alpha channel.- 返回:
- true to convolve the alpha
- 另请参阅:
setUseAlpha(boolean)
-
setPremultiplyAlpha
public void setPremultiplyAlpha(boolean premultiplyAlpha)
Set whether to premultiply the alpha channel.- 参数:
premultiplyAlpha- true to premultiply the alpha- 另请参阅:
getPremultiplyAlpha()
-
getPremultiplyAlpha
public boolean getPremultiplyAlpha()
Get whether to premultiply the alpha channel.- 返回:
- true to premultiply the alpha
- 另请参阅:
setPremultiplyAlpha(boolean)
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
-
createCompatibleDestImage
public java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage src, java.awt.image.ColorModel dstCM)- 指定者:
createCompatibleDestImage在接口中java.awt.image.BufferedImageOp- 覆盖:
createCompatibleDestImage在类中AbstractBufferedImageOp
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
- 指定者:
getBounds2D在接口中java.awt.image.BufferedImageOp- 覆盖:
getBounds2D在类中AbstractBufferedImageOp
-
getPoint2D
public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)- 指定者:
getPoint2D在接口中java.awt.image.BufferedImageOp- 覆盖:
getPoint2D在类中AbstractBufferedImageOp
-
getRenderingHints
public java.awt.RenderingHints getRenderingHints()
- 指定者:
getRenderingHints在接口中java.awt.image.BufferedImageOp- 覆盖:
getRenderingHints在类中AbstractBufferedImageOp
-
convolve
public static void convolve(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, int edgeAction)Convolve a block of pixels.- 参数:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightedgeAction- what to do at the edges
-
convolve
public static void convolve(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)Convolve a block of pixels.- 参数:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightalpha- include alpha channeledgeAction- what to do at the edges
-
convolveHV
public static void convolveHV(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)Convolve with a 2D kernel.- 参数:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightalpha- include alpha channeledgeAction- what to do at the edges
-
convolveH
public static void convolveH(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)Convolve with a kernel consisting of one row.- 参数:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightalpha- include alpha channeledgeAction- what to do at the edges
-
convolveV
public static void convolveV(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)Convolve with a kernel consisting of one column.- 参数:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightalpha- include alpha channeledgeAction- what to do at the edges
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
-