com.jhlabs.image
Class BoxBlurFilter
- BufferedImageOp, Cloneable
public class BoxBlurFilter
A filter which performs a box blur on an image. The horizontal and vertical blurs can be specified separately
and a number of iterations can be given which allows an approximation to Gaussian blur.
BoxBlurFilter() - Construct a default BoxBlurFilter.
|
BoxBlurFilter(float hRadius, float vRadius, int iterations) - Construct a BoxBlurFilter.
|
static void | blur(int[] in, int[] out, int width, int height, float radius) - Blur and transpose a block of ARGB pixels.
|
static void | blurFractional(int[] in, int[] out, int width, int height, float radius)
|
BufferedImage | filter(BufferedImage src, BufferedImage dst)
|
float | getHRadius() - Get the horizontal size of the blur.
|
int | getIterations() - Get the number of iterations the blur is performed.
|
boolean | getPremultiplyAlpha() - Get whether to premultiply the alpha channel.
|
float | getRadius() - Get the size of the blur.
|
float | getVRadius() - Get the vertical size of the blur.
|
void | setHRadius(float hRadius) - Set the horizontal size of the blur.
|
void | setIterations(int iterations) - Set the number of iterations the blur is performed.
|
void | setPremultiplyAlpha(boolean premultiplyAlpha) - Set whether to premultiply the alpha channel.
|
void | setRadius(float radius) - Set both the horizontal and vertical sizes of the blur.
|
void | setVRadius(float vRadius) - Set the vertical size of the blur.
|
String | toString()
|
BoxBlurFilter
public BoxBlurFilter()
Construct a default BoxBlurFilter.
BoxBlurFilter
public BoxBlurFilter(float hRadius,
float vRadius,
int iterations)
Construct a BoxBlurFilter.
hRadius
- the horizontal radius of blurvRadius
- the vertical radius of bluriterations
- the number of time to iterate the blur
blur
public static void blur(int[] in,
int[] out,
int width,
int height,
float radius)
Blur and transpose a block of ARGB pixels.
in
- the input pixelsout
- the output pixelswidth
- the width of the pixel arrayheight
- the height of the pixel arrayradius
- the radius of blur
blurFractional
public static void blurFractional(int[] in,
int[] out,
int width,
int height,
float radius)
filter
public BufferedImage filter(BufferedImage src,
BufferedImage dst)
getHRadius
public float getHRadius()
Get the horizontal size of the blur.
- the radius of the blur in the horizontal direction
getIterations
public int getIterations()
Get the number of iterations the blur is performed.
getPremultiplyAlpha
public boolean getPremultiplyAlpha()
Get whether to premultiply the alpha channel.
- true to premultiply the alpha
getRadius
public float getRadius()
Get the size of the blur.
- the radius of the blur in the horizontal direction
getVRadius
public float getVRadius()
Get the vertical size of the blur.
- the radius of the blur in the vertical direction
setHRadius
public void setHRadius(float hRadius)
Set the horizontal size of the blur.
hRadius
- the radius of the blur in the horizontal direction
setIterations
public void setIterations(int iterations)
Set the number of iterations the blur is performed.
iterations
- the number of iterations
setPremultiplyAlpha
public void setPremultiplyAlpha(boolean premultiplyAlpha)
Set whether to premultiply the alpha channel.
premultiplyAlpha
- true to premultiply the alpha
setRadius
public void setRadius(float radius)
Set both the horizontal and vertical sizes of the blur.
radius
- the radius of the blur in both directions
setVRadius
public void setVRadius(float vRadius)
Set the vertical size of the blur.
vRadius
- the radius of the blur in the vertical direction
toString
public String toString()