public class JHBlurFilter extends JHFilter
Constructor and Description |
---|
JHBlurFilter()
Construct a default BoxBlurFilter.
|
JHBlurFilter(float hRadius,
float vRadius,
int iterations)
Construct a BoxBlurFilter.
|
Modifier and Type | Method and Description |
---|---|
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) |
static int |
clamp(int x,
int a,
int b)
Clamp a value to an interval.
|
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage src,
java.awt.image.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.
|
static void |
premultiply(int[] p,
int offset,
int length)
Premultiply a block of pixels
|
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.
|
java.lang.String |
toString() |
static void |
unpremultiply(int[] p,
int offset,
int length)
Premultiply a block of pixels
|
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
public JHBlurFilter()
public JHBlurFilter(float hRadius, float vRadius, int iterations)
hRadius
- the horizontal radius of blurvRadius
- the vertical radius of bluriterations
- the number of time to iterate the blurpublic void setPremultiplyAlpha(boolean premultiplyAlpha)
premultiplyAlpha
- true to premultiply the alphagetPremultiplyAlpha()
public boolean getPremultiplyAlpha()
setPremultiplyAlpha(boolean)
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
public static void blur(int[] in, int[] out, int width, int height, float radius)
in
- the input pixelsout
- the output pixelswidth
- the width of the pixel arrayheight
- the height of the pixel arrayradius
- the radius of blurpublic static void blurFractional(int[] in, int[] out, int width, int height, float radius)
public void setHRadius(float hRadius)
hRadius
- the radius of the blur in the horizontal directiongetHRadius()
public float getHRadius()
setHRadius(float)
public void setVRadius(float vRadius)
vRadius
- the radius of the blur in the vertical directiongetVRadius()
public float getVRadius()
setVRadius(float)
public void setRadius(float radius)
radius
- the radius of the blur in both directionsgetRadius()
public float getRadius()
setRadius(float)
public void setIterations(int iterations)
iterations
- the number of iterationsgetIterations()
public int getIterations()
setIterations(int)
public java.lang.String toString()
toString
in class java.lang.Object
public static void premultiply(int[] p, int offset, int length)
p
- pixelsoffset
- the offsetlength
- the lengthpublic static void unpremultiply(int[] p, int offset, int length)
p
- the pixelsoffset
- the offsetlength
- the lengthpublic static int clamp(int x, int a, int b)
a
- the lower clamp thresholdb
- the upper clamp thresholdx
- the input parameterCopyright © 2012-2018 Bartosz Firyn (SarXos). All Rights Reserved.