|
Bartosz Firyn (SarXos) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.sarxos.webcam.util.jh.JHFilter
com.github.sarxos.webcam.util.jh.JHBlurFilter
public class JHBlurFilter
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.
Constructor Summary | |
---|---|
JHBlurFilter()
Construct a default BoxBlurFilter. |
|
JHBlurFilter(float hRadius,
float vRadius,
int iterations)
Construct a BoxBlurFilter. |
Method Summary | |
---|---|
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. |
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. |
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. |
String |
toString()
|
static void |
unpremultiply(int[] p,
int offset,
int length)
Premultiply a block of pixels |
Methods inherited from class com.github.sarxos.webcam.util.jh.JHFilter |
---|
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 blurMethod Detail |
---|
public void setPremultiplyAlpha(boolean premultiplyAlpha)
premultiplyAlpha
- true to premultiply the alphagetPremultiplyAlpha()
public boolean getPremultiplyAlpha()
setPremultiplyAlpha(boolean)
public BufferedImage filter(BufferedImage src, 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 String toString()
toString
in class Object
public static void premultiply(int[] p, int offset, int length)
public static void unpremultiply(int[] p, int offset, int length)
public static int clamp(int x, int a, int b)
a
- the lower clamp thresholdb
- the upper clamp thresholdx
- the input parameter
|
Bartosz Firyn (SarXos) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |