|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdesktop.beans.AbstractBean org.jdesktop.swingx.image.AbstractFilter org.jdesktop.swingx.image.StackBlurFilter
public class StackBlurFilter
A stack blur filter can be used to create an approximation of a
gaussian blur. The approximation is controlled by the number of times the
FastBlurFilter
is applied onto the source
picture. The default number of iterations, 3, provides a decent compromise
between speed and rendering quality.
The force of the blur can be controlled with a radius and the default radius is 3. Since the blur clamps values on the edges of the source picture, you might need to provide a picture with empty borders to avoid artifacts at the edges. The performance of this filter are independant from the radius.
Constructor Summary | |
---|---|
StackBlurFilter()
Creates a new blur filter with a default radius of 3 and 3 iterations. |
|
StackBlurFilter(int radius)
Creates a new blur filter with the specified radius and 3 iterations. |
|
StackBlurFilter(int radius,
int iterations)
Creates a new blur filter with the specified radius. |
Method Summary | |
---|---|
BufferedImage |
filter(BufferedImage src,
BufferedImage dst)
Performs a single-input/single-output operation on a BufferedImage . |
int |
getEffectiveRadius()
Returns the effective radius of the stack blur. |
int |
getIterations()
Returns the number of iterations used to approximate a gaussian blur. |
int |
getRadius()
Returns the radius used by this filter, in pixels. |
Methods inherited from class org.jdesktop.swingx.image.AbstractFilter |
---|
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StackBlurFilter()
Creates a new blur filter with a default radius of 3 and 3 iterations.
public StackBlurFilter(int radius)
Creates a new blur filter with the specified radius and 3 iterations. If the radius is lower than 1, a radius of 1 will be used automatically.
radius
- the radius, in pixels, of the blurpublic StackBlurFilter(int radius, int iterations)
Creates a new blur filter with the specified radius. If the radius is lower than 1, a radius of 1 will be used automatically. The number of iterations controls the approximation to a gaussian blur. If the number of iterations is lower than 1, one iteration will be used automatically.
radius
- the radius, in pixels, of the bluriterations
- the number of iterations to approximate a gaussian blurMethod Detail |
---|
public int getEffectiveRadius()
Returns the effective radius of the stack blur. If the radius of the blur is 1 and the stack iterations count is 3, then the effective blur radius is 1 * 3 = 3.
public int getRadius()
Returns the radius used by this filter, in pixels.
public int getIterations()
Returns the number of iterations used to approximate a gaussian blur.
public BufferedImage filter(BufferedImage src, BufferedImage dst)
BufferedImage
.
If the color models for the two images do not match, a color
conversion into the destination color model is performed.
If the destination image is null,
a BufferedImage
with an appropriate ColorModel
is created.
An IllegalArgumentException
may be thrown if the source
and/or destination image is incompatible with the types of images $
allowed by the class implementing this filter.
filter
in interface BufferedImageOp
filter
in class AbstractFilter
src
- The BufferedImage
to be filtereddst
- The BufferedImage
in which to store the results$
BufferedImage
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |