BufferedImageOp, CloneableAverageFilter, BlurFilter, BumpFilter, GaussianFilter, SharpenFilterpublic class ConvolveFilter extends AbstractBufferedImageOp
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
protected boolean |
alpha |
Whether to convolve alpha.
|
static int |
CLAMP_EDGES |
Clamp pixels off the edge to the nearest edge.
|
protected Kernel |
kernel |
The convolution kernel.
|
protected boolean |
premultiplyAlpha |
Whether to promultiply the alpha before convolving.
|
static int |
WRAP_EDGES |
Wrap pixels off the edge to the opposite edge.
|
static int |
ZERO_EDGES |
Treat 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(Kernel kernel) |
Construct a filter with the given 3x3 kernel.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static void |
convolve(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction) |
Convolve a block of pixels.
|
static void |
convolve(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
int edgeAction) |
Convolve a block of pixels.
|
static void |
convolveH(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction) |
Convolve with a kernel consisting of one row.
|
static void |
convolveHV(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction) |
Convolve with a 2D kernel.
|
static void |
convolveV(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction) |
Convolve with a kernel consisting of one column.
|
BufferedImage |
createCompatibleDestImage(BufferedImage src,
ColorModel dstCM) |
|
BufferedImage |
filter(BufferedImage src,
BufferedImage dst) |
|
Rectangle2D |
getBounds2D(BufferedImage src) |
|
int |
getEdgeAction() |
Get the action to perfomr for pixels off the image edges.
|
Kernel |
getKernel() |
Get the convolution kernel.
|
Point2D |
getPoint2D(Point2D srcPt,
Point2D dstPt) |
|
boolean |
getPremultiplyAlpha() |
Get whether to premultiply the alpha channel.
|
RenderingHints |
getRenderingHints() |
|
boolean |
getUseAlpha() |
Get whether to convolve the alpha channel.
|
void |
setEdgeAction(int edgeAction) |
Set the action to perfomr for pixels off the image edges.
|
void |
setKernel(Kernel kernel) |
Set the convolution kernel.
|
void |
setPremultiplyAlpha(boolean premultiplyAlpha) |
Set whether to premultiply the alpha channel.
|
void |
setUseAlpha(boolean useAlpha) |
Set whether to convolve the alpha channel.
|
String |
toString() |
clone, getRGB, setRGBpublic static int ZERO_EDGES
public static int CLAMP_EDGES
public static int WRAP_EDGES
protected Kernel kernel
protected boolean alpha
protected boolean premultiplyAlpha
public ConvolveFilter()
public ConvolveFilter(float[] matrix)
matrix - an array of 9 floats containing the kernelpublic ConvolveFilter(int rows,
int cols,
float[] matrix)
rows - the number of rows in the kernelcols - the number of columns in the kernelmatrix - an array of rows*cols floats containing the kernelpublic ConvolveFilter(Kernel kernel)
kernel - the convolution kernelpublic void setKernel(Kernel kernel)
kernel - the kernelgetKernel()public Kernel getKernel()
setKernel(java.awt.image.Kernel)public void setEdgeAction(int edgeAction)
edgeAction - the actiongetEdgeAction()public int getEdgeAction()
setEdgeAction(int)public void setUseAlpha(boolean useAlpha)
useAlpha - true to convolve the alphagetUseAlpha()public boolean getUseAlpha()
setUseAlpha(boolean)public void setPremultiplyAlpha(boolean premultiplyAlpha)
premultiplyAlpha - true to premultiply the alphagetPremultiplyAlpha()public boolean getPremultiplyAlpha()
setPremultiplyAlpha(boolean)public BufferedImage filter(BufferedImage src, BufferedImage dst)
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM)
public Rectangle2D getBounds2D(BufferedImage src)
getBounds2D 在接口中 BufferedImageOpgetBounds2D 在类中 AbstractBufferedImageOppublic Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
getPoint2D 在接口中 BufferedImageOpgetPoint2D 在类中 AbstractBufferedImageOppublic RenderingHints getRenderingHints()
getRenderingHints 在接口中 BufferedImageOpgetRenderingHints 在类中 AbstractBufferedImageOppublic static void convolve(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, int edgeAction)
kernel - the kernelinPixels - the input pixelsoutPixels - the output pixelswidth - the widthheight - the heightedgeAction - what to do at the edgespublic static void convolve(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)
kernel - the kernelinPixels - the input pixelsoutPixels - the output pixelswidth - the widthheight - the heightalpha - include alpha channeledgeAction - what to do at the edgespublic static void convolveHV(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)
kernel - the kernelinPixels - the input pixelsoutPixels - the output pixelswidth - the widthheight - the heightalpha - include alpha channeledgeAction - what to do at the edgespublic static void convolveH(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)
kernel - the kernelinPixels - the input pixelsoutPixels - the output pixelswidth - the widthheight - the heightalpha - include alpha channeledgeAction - what to do at the edgespublic static void convolveV(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)
kernel - the kernelinPixels - the input pixelsoutPixels - the output pixelswidth - the widthheight - the heightalpha - include alpha channeledgeAction - what to do at the edgesCopyright © 2019. All rights reserved.