Package ca.cgjennings.graphics.filters
Class GaussianBlurFilter
- java.lang.Object
-
- ca.cgjennings.graphics.filters.AbstractImageFilter
-
- ca.cgjennings.graphics.filters.AbstractImagewiseFilter
-
- ca.cgjennings.graphics.filters.AbstractConvolver
-
- ca.cgjennings.graphics.filters.GaussianBlurFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
public class GaussianBlurFilter extends AbstractConvolver
A filter that applies a Gaussian blur to the source image.In-place filtering: Unless otherwise noted, filters based on this class support in-place filtering (the source and destination images can be the same).
- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description GaussianBlurFilter()
Creates a filter with a 1-pixel blur radius.GaussianBlurFilter(float radius)
Creates a filter with the specified blur radius.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.image.Kernel[]
getKernels()
Returns the convolution kernel(s) that should be applied to execute this filter.float
getRadius()
Returns the current blur radius.void
setRadius(float radius)
Sets the radius of the blur effect.-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractConvolver
filter, filterPixels, getEdgeHandling, isAlphaFiltered, isAlphaPremultiplied, workFactor
-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractImagewiseFilter
filter
-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractImageFilter
clamp, clamp, clamp, clampBoth, createCompatibleDestImage, fA, fB, fG, fR, getARGB, getARGB, getARGBSynch, getBounds2D, getPoint2D, getRenderingHints, iA, iB, iG, iR, setARGB, setARGB, setARGBSynch
-
-
-
-
Method Detail
-
setRadius
public void setRadius(float radius)
Sets the radius of the blur effect.- Parameters:
radius
- the blur radius
-
getRadius
public float getRadius()
Returns the current blur radius.- Returns:
- the radius of the blur effect
-
getKernels
protected java.awt.image.Kernel[] getKernels()
Description copied from class:AbstractConvolver
Returns the convolution kernel(s) that should be applied to execute this filter. Typically, array is either length one (non-separable) or length two (separable).- Specified by:
getKernels
in classAbstractConvolver
- Returns:
- an array of non-
null
convolution kernels
-
-