Package com.jhlabs.image
Class MotionBlurFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.MotionBlurFilter
-
- All Implemented Interfaces:
MotionBlur,java.awt.image.BufferedImageOp,java.lang.Cloneable
public class MotionBlurFilter extends AbstractBufferedImageOp implements MotionBlur
A filter which produces motion blur the slow, but higher-quality way.
-
-
Constructor Summary
Constructors Constructor Description MotionBlurFilter()Construct a MotionBlurFilter.MotionBlurFilter(float distance, float angle, float rotation, float zoom)Construct a MotionBlurFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)floatgetAngle()Returns the angle of blur.java.awt.geom.Point2DgetCentre()Get the centre of the effect as a proportion of the image size.floatgetCentreX()Get the centre of the effect in the X direction as a proportion of the image size.floatgetCentreY()Get the centre of the effect in the Y direction as a proportion of the image size.floatgetDistance()Get the distance of blur.booleangetPremultiplyAlpha()Get whether to premultiply the alpha channel.floatgetRotation()Get the blur rotation.booleangetWrapEdges()Get whether to wrap at the image edges.floatgetZoom()Get the blur zoom.voidsetAngle(float angle)Specifies the angle of blur.voidsetCentre(java.awt.geom.Point2D centre)Set the centre of the effect as a proportion of the image size.voidsetCentreX(float centreX)Set the centre of the effect in the X direction as a proportion of the image size.voidsetCentreY(float centreY)Set the centre of the effect in the Y direction as a proportion of the image size.voidsetDistance(float distance)Set the distance of blur.voidsetPremultiplyAlpha(boolean premultiplyAlpha)Set whether to premultiply the alpha channel.voidsetRotation(float rotation)Set the blur rotation.voidsetWrapEdges(boolean wrapEdges)Set whether to wrap at the image edges.voidsetZoom(float zoom)Set the blur zoom.java.lang.StringtoString()-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
-
-
-
Constructor Detail
-
MotionBlurFilter
public MotionBlurFilter()
Construct a MotionBlurFilter.
-
MotionBlurFilter
public MotionBlurFilter(float distance, float angle, float rotation, float zoom)Construct a MotionBlurFilter.- Parameters:
distance- the distance of blur.angle- the angle of blur.rotation- the angle of rotation.zoom- the zoom factor.
-
-
Method Detail
-
setCentreX
public void setCentreX(float centreX)
Set the centre of the effect in the X direction as a proportion of the image size.- Specified by:
setCentreXin interfaceMotionBlur- Parameters:
centreX- the center- See Also:
getCentreX()
-
getCentreX
public float getCentreX()
Get the centre of the effect in the X direction as a proportion of the image size.- Specified by:
getCentreXin interfaceMotionBlur- Returns:
- the center
- See Also:
setCentreX(float)
-
setCentreY
public void setCentreY(float centreY)
Set the centre of the effect in the Y direction as a proportion of the image size.- Specified by:
setCentreYin interfaceMotionBlur- Parameters:
centreY- the center- See Also:
getCentreY()
-
getCentreY
public float getCentreY()
Get the centre of the effect in the Y direction as a proportion of the image size.- Specified by:
getCentreYin interfaceMotionBlur- Returns:
- the center
- See Also:
setCentreY(float)
-
setCentre
public void setCentre(java.awt.geom.Point2D centre)
Set the centre of the effect as a proportion of the image size.- Specified by:
setCentrein interfaceMotionBlur- Parameters:
centre- the center- See Also:
getCentre()
-
getCentre
public java.awt.geom.Point2D getCentre()
Get the centre of the effect as a proportion of the image size.- Specified by:
getCentrein interfaceMotionBlur- Returns:
- the center
- See Also:
setCentre(java.awt.geom.Point2D)
-
setAngle
public void setAngle(float angle)
Specifies the angle of blur.- Specified by:
setAnglein interfaceMotionBlur- Parameters:
angle- the angle of blur.- See Also:
getAngle()
-
getAngle
public float getAngle()
Returns the angle of blur.- Specified by:
getAnglein interfaceMotionBlur- Returns:
- the angle of blur.
- See Also:
setAngle(float)
-
setDistance
public void setDistance(float distance)
Set the distance of blur.- Specified by:
setDistancein interfaceMotionBlur- Parameters:
distance- the distance of blur.- See Also:
getDistance()
-
getDistance
public float getDistance()
Get the distance of blur.- Specified by:
getDistancein interfaceMotionBlur- Returns:
- the distance of blur.
- See Also:
setDistance(float)
-
setRotation
public void setRotation(float rotation)
Set the blur rotation.- Specified by:
setRotationin interfaceMotionBlur- Parameters:
rotation- the angle of rotation.- See Also:
getRotation()
-
getRotation
public float getRotation()
Get the blur rotation.- Specified by:
getRotationin interfaceMotionBlur- Returns:
- the angle of rotation.
- See Also:
setRotation(float)
-
setZoom
public void setZoom(float zoom)
Set the blur zoom.- Specified by:
setZoomin interfaceMotionBlur- Parameters:
zoom- the zoom factor.- See Also:
getZoom()
-
getZoom
public float getZoom()
Get the blur zoom.- Specified by:
getZoomin interfaceMotionBlur- Returns:
- the zoom factor.
- See Also:
setZoom(float)
-
setWrapEdges
public void setWrapEdges(boolean wrapEdges)
Set whether to wrap at the image edges.- Parameters:
wrapEdges- true if it should wrap.- See Also:
getWrapEdges()
-
getWrapEdges
public boolean getWrapEdges()
Get whether to wrap at the image edges.- Returns:
- true if it should wrap.
- See Also:
setWrapEdges(boolean)
-
setPremultiplyAlpha
public void setPremultiplyAlpha(boolean premultiplyAlpha)
Set whether to premultiply the alpha channel.- Parameters:
premultiplyAlpha- true to premultiply the alpha- See Also:
getPremultiplyAlpha()
-
getPremultiplyAlpha
public boolean getPremultiplyAlpha()
Get whether to premultiply the alpha channel.- Returns:
- true to premultiply the alpha
- See Also:
setPremultiplyAlpha(boolean)
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)- Specified by:
filterin interfacejava.awt.image.BufferedImageOp
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-