A filter which applies a convolution kernel to an image.
convolve
public static void convolve(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
convolve
public static void convolve(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
convolveH
public 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.
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(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
convolveV
public 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.
kernel
- the kernelinPixels
- the input pixelsoutPixels
- the output pixelswidth
- the widthheight
- the heightalpha
- include alpha channeledgeAction
- what to do at the edges
filter
public BufferedImage filter(BufferedImage src,
BufferedImage dst)
getEdgeAction
public int getEdgeAction()
Get the action to perfomr for pixels off the image edges.
getKernel
public Kernel getKernel()
Get the convolution kernel.
getPremultiplyAlpha
public boolean getPremultiplyAlpha()
Get whether to premultiply the alpha channel.
- true to premultiply the alpha
getUseAlpha
public boolean getUseAlpha()
Get whether to convolve the alpha channel.
- true to convolve the alpha
setEdgeAction
public void setEdgeAction(int edgeAction)
Set the action to perfomr for pixels off the image edges.
setKernel
public void setKernel(Kernel kernel)
Set the convolution kernel.
setPremultiplyAlpha
public void setPremultiplyAlpha(boolean premultiplyAlpha)
Set whether to premultiply the alpha channel.
premultiplyAlpha
- true to premultiply the alpha
setUseAlpha
public void setUseAlpha(boolean useAlpha)
Set whether to convolve the alpha channel.
useAlpha
- true to convolve the alpha
toString
public String toString()