com.jhlabs.image
Class GaussianFilter
- BufferedImageOp, Cloneable
public class GaussianFilter
A filter which applies Gaussian blur to an image. This is a subclass of ConvolveFilter
which simply creates a kernel with a Gaussian distribution for blurring.
protected Kernel | kernel - The convolution kernel.
|
protected float | radius - The blur radius.
|
static void | convolveAndTranspose(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, boolean premultiply, boolean unpremultiply, int edgeAction) - Blur and transpose a block of ARGB pixels.
|
BufferedImage | filter(BufferedImage src, BufferedImage dst)
|
float | getRadius() - Get the radius of the kernel.
|
static Kernel | makeKernel(float radius) - Make a Gaussian blur kernel.
|
void | setRadius(float radius) - Set the radius of the kernel, and hence the amount of blur.
|
String | toString()
|
convolve , convolve , convolveH , convolveHV , convolveV , createCompatibleDestImage , filter , getBounds2D , getEdgeAction , getKernel , getPoint2D , getPremultiplyAlpha , getRenderingHints , getUseAlpha , setEdgeAction , setKernel , setPremultiplyAlpha , setUseAlpha , toString |
kernel
protected Kernel kernel
The convolution kernel.
radius
protected float radius
The blur radius.
GaussianFilter
public GaussianFilter()
Construct a Gaussian filter.
GaussianFilter
public GaussianFilter(float radius)
Construct a Gaussian filter.
radius
- blur radius in pixels
convolveAndTranspose
public static void convolveAndTranspose(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
boolean premultiply,
boolean unpremultiply,
int edgeAction)
Blur and transpose a block of ARGB pixels.
kernel
- the blur kernelinPixels
- the input pixelsoutPixels
- the output pixelswidth
- the width of the pixel arrayheight
- the height of the pixel arrayalpha
- whether to blur the alpha channeledgeAction
- what to do at the edges
filter
public BufferedImage filter(BufferedImage src,
BufferedImage dst)
- filter in interface ConvolveFilter
getRadius
public float getRadius()
Get the radius of the kernel.
makeKernel
public static Kernel makeKernel(float radius)
Make a Gaussian blur kernel.
setRadius
public void setRadius(float radius)
Set the radius of the kernel, and hence the amount of blur. The bigger the radius, the longer this filter will take.
radius
- the radius of the blur in pixels.