Package com.jhlabs.image
Class GaussianFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.ConvolveFilter
-
- com.jhlabs.image.GaussianFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp,java.lang.Cloneable
- Direct Known Subclasses:
GlowFilter,UnsharpFilter
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.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.image.Kernelkernelprotected floatradius-
Fields inherited from class com.jhlabs.image.ConvolveFilter
alpha, CLAMP_EDGES, WRAP_EDGES, ZERO_EDGES
-
-
Constructor Summary
Constructors Constructor Description GaussianFilter()Construct a Gaussian filterGaussianFilter(float radius)Construct a Gaussian filter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidconvolveAndTranspose(java.awt.image.Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)floatgetRadius()Get the radius of the kernel.static java.awt.image.KernelmakeKernel(float radius)Make a Gaussian blur kernel.voidsetRadius(float radius)Set the radius of the kernel, and hence the amount of blur.java.lang.StringtoString()-
Methods inherited from class com.jhlabs.image.ConvolveFilter
convolve, convolve, convolveH, convolveHV, convolveV, createCompatibleDestImage, getBounds2D, getEdgeAction, getKernel, getPoint2D, getRenderingHints, getUseAlpha, setEdgeAction, setKernel, setUseAlpha
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, getRGB, setRGB
-
-
-
-
Method Detail
-
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:
filterin interfacejava.awt.image.BufferedImageOp- Overrides:
filterin classConvolveFilter
-
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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classConvolveFilter
-
-