Package com.jhlabs.image
Class VariableBlurFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.VariableBlurFilter
- All Implemented Interfaces:
BufferedImageOp,Cloneable
A filter which performs a box blur with a different blur radius at each pixel. The radius can either be specified by
providing a blur mask image or by overriding the blurRadiusAt method.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidblur(int[] in, int[] out, int width, int height, int radius, int pass) protected floatblurRadiusAt(int x, int y, int width, int height) Override this to get a different blur radius at eahc point.createCompatibleDestImage(BufferedImage src, ColorModel dstCM) filter(BufferedImage src, BufferedImage dst) Get the mask used to give the amount of blur at each point.getBounds2D(BufferedImage src) intGet the horizontal size of the blur.intGet the number of iterations the blur is performed.getPoint2D(Point2D srcPt, Point2D dstPt) booleanGet whether to premultiply the alpha channel.intGet the radius of the effect.intGet the vertical size of the blur.voidsetBlurMask(BufferedImage blurMask) Set the mask used to give the amount of blur at each point.voidsetHRadius(int hRadius) Set the horizontal size of the blur.voidsetIterations(int iterations) Set the number of iterations the blur is performed.voidsetPremultiplyAlpha(boolean premultiplyAlpha) Set whether to premultiply the alpha channel.voidsetRadius(int radius) Set the radius of the effect.voidsetVRadius(int vRadius) Set the vertical size of the blur.toString()Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, getRGB, setRGB
-
Constructor Details
-
VariableBlurFilter
public VariableBlurFilter()
-
-
Method Details
-
setPremultiplyAlpha
public void setPremultiplyAlpha(boolean premultiplyAlpha) Set whether to premultiply the alpha channel.- Parameters:
premultiplyAlpha- true to premultiply the alpha- See Also:
-
getPremultiplyAlpha
public boolean getPremultiplyAlpha()Get whether to premultiply the alpha channel.- Returns:
- true to premultiply the alpha
- See Also:
-
filter
-
createCompatibleDestImage
- Specified by:
createCompatibleDestImagein interfaceBufferedImageOp- Overrides:
createCompatibleDestImagein classAbstractBufferedImageOp
-
getBounds2D
- Specified by:
getBounds2Din interfaceBufferedImageOp- Overrides:
getBounds2Din classAbstractBufferedImageOp
-
getPoint2D
- Specified by:
getPoint2Din interfaceBufferedImageOp- Overrides:
getPoint2Din classAbstractBufferedImageOp
-
getRenderingHints
- Specified by:
getRenderingHintsin interfaceBufferedImageOp- Overrides:
getRenderingHintsin classAbstractBufferedImageOp
-
blur
public void blur(int[] in, int[] out, int width, int height, int radius, int pass) -
blurRadiusAt
protected float blurRadiusAt(int x, int y, int width, int height) Override this to get a different blur radius at eahc point.- Parameters:
x- the x coordinatey- the y coordinatewidth- the width of the imageheight- the height of the image- Returns:
- the blur radius
-
setHRadius
public void setHRadius(int hRadius) Set the horizontal size of the blur.- Parameters:
hRadius- the radius of the blur in the horizontal direction- See Also:
-
getHRadius
public int getHRadius()Get the horizontal size of the blur.- Returns:
- the radius of the blur in the horizontal direction
- See Also:
-
setVRadius
public void setVRadius(int vRadius) Set the vertical size of the blur.- Parameters:
vRadius- the radius of the blur in the vertical direction- See Also:
-
getVRadius
public int getVRadius()Get the vertical size of the blur.- Returns:
- the radius of the blur in the vertical direction
- See Also:
-
setRadius
public void setRadius(int radius) Set the radius of the effect.- Parameters:
radius- the radius- See Also:
-
getRadius
public int getRadius()Get the radius of the effect.- Returns:
- the radius
- See Also:
-
setIterations
public void setIterations(int iterations) Set the number of iterations the blur is performed.- Parameters:
iterations- the number of iterations- See Also:
-
getIterations
public int getIterations()Get the number of iterations the blur is performed.- Returns:
- the number of iterations
- See Also:
-
setBlurMask
Set the mask used to give the amount of blur at each point.- Parameters:
blurMask- the mask- See Also:
-
getBlurMask
Get the mask used to give the amount of blur at each point.- Returns:
- the mask
- See Also:
-
toString
-