com.alee.graphics.filters
Class GaussianFilter
java.lang.Object
com.alee.graphics.filters.AbstractBufferedImageOp
com.alee.graphics.filters.ConvolveFilter
com.alee.graphics.filters.GaussianFilter
- All Implemented Interfaces:
- java.awt.image.BufferedImageOp
public class GaussianFilter
- extends ConvolveFilter
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.
- Author:
- Jerry Huxtable
Field Summary |
protected java.awt.image.Kernel |
kernel
|
protected float |
radius
|
Method Summary |
static void |
convolveAndTranspose(java.awt.image.Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction)
|
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst)
|
float |
getRadius()
Get the radius of the kernel. |
static java.awt.image.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. |
Methods inherited from class com.alee.graphics.filters.ConvolveFilter |
convolve, convolve, convolveH, convolveHV, convolveV, createCompatibleDestImage, getBounds2D, getEdgeAction, getKernel, getPoint2D, getRenderingHints, setEdgeAction, setKernel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
radius
protected float radius
kernel
protected java.awt.image.Kernel kernel
GaussianFilter
public GaussianFilter()
- Construct a Gaussian filter
GaussianFilter
public GaussianFilter(float radius)
- Construct a Gaussian filter
- Parameters:
radius
- blur radius in pixels
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.
- Parameters:
radius
- the radius of the blur in pixels.
getRadius
public float getRadius()
- Get the radius of the kernel.
- Returns:
- the radius
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst)
- Specified by:
filter
in interface java.awt.image.BufferedImageOp
- Overrides:
filter
in class ConvolveFilter
convolveAndTranspose
public static void convolveAndTranspose(java.awt.image.Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction)
makeKernel
public static java.awt.image.Kernel makeKernel(float radius)
- Make a Gaussian blur kernel.