Package com.jhlabs.image
Class MotionBlurFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.MotionBlurFilter
- All Implemented Interfaces:
MotionBlur
,BufferedImageOp
,Cloneable
A filter which produces motion blur the slow, but higher-quality way.
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a MotionBlurFilter.MotionBlurFilter
(float distance, float angle, float rotation, float zoom) Construct a MotionBlurFilter. -
Method Summary
Modifier and TypeMethodDescriptionfilter
(BufferedImage src, BufferedImage dst) float
getAngle()
Returns the angle of blur.Get the centre of the effect as a proportion of the image size.float
Get the centre of the effect in the X direction as a proportion of the image size.float
Get the centre of the effect in the Y direction as a proportion of the image size.float
Get the distance of blur.boolean
Get whether to premultiply the alpha channel.float
Get the blur rotation.boolean
Get whether to wrap at the image edges.float
getZoom()
Get the blur zoom.void
setAngle
(float angle) Specifies the angle of blur.void
Set the centre of the effect as a proportion of the image size.void
setCentreX
(float centreX) Set the centre of the effect in the X direction as a proportion of the image size.void
setCentreY
(float centreY) Set the centre of the effect in the Y direction as a proportion of the image size.void
setDistance
(float distance) Set the distance of blur.void
setPremultiplyAlpha
(boolean premultiplyAlpha) Set whether to premultiply the alpha channel.void
setRotation
(float rotation) Set the blur rotation.void
setWrapEdges
(boolean wrapEdges) Set whether to wrap at the image edges.void
setZoom
(float zoom) Set the blur zoom.toString()
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.image.BufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints
-
Constructor Details
-
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 Details
-
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:
setCentreX
in interfaceMotionBlur
- Parameters:
centreX
- the center- See Also:
-
getCentreX
public float getCentreX()Get the centre of the effect in the X direction as a proportion of the image size.- Specified by:
getCentreX
in interfaceMotionBlur
- Returns:
- the center
- See Also:
-
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:
setCentreY
in interfaceMotionBlur
- Parameters:
centreY
- the center- See Also:
-
getCentreY
public float getCentreY()Get the centre of the effect in the Y direction as a proportion of the image size.- Specified by:
getCentreY
in interfaceMotionBlur
- Returns:
- the center
- See Also:
-
setCentre
Set the centre of the effect as a proportion of the image size.- Specified by:
setCentre
in interfaceMotionBlur
- Parameters:
centre
- the center- See Also:
-
getCentre
Get the centre of the effect as a proportion of the image size.- Specified by:
getCentre
in interfaceMotionBlur
- Returns:
- the center
- See Also:
-
setAngle
public void setAngle(float angle) Specifies the angle of blur.- Specified by:
setAngle
in interfaceMotionBlur
- Parameters:
angle
- the angle of blur.- See Also:
-
getAngle
public float getAngle()Returns the angle of blur.- Specified by:
getAngle
in interfaceMotionBlur
- Returns:
- the angle of blur.
- See Also:
-
setDistance
public void setDistance(float distance) Set the distance of blur.- Specified by:
setDistance
in interfaceMotionBlur
- Parameters:
distance
- the distance of blur.- See Also:
-
getDistance
public float getDistance()Get the distance of blur.- Specified by:
getDistance
in interfaceMotionBlur
- Returns:
- the distance of blur.
- See Also:
-
setRotation
public void setRotation(float rotation) Set the blur rotation.- Specified by:
setRotation
in interfaceMotionBlur
- Parameters:
rotation
- the angle of rotation.- See Also:
-
getRotation
public float getRotation()Get the blur rotation.- Specified by:
getRotation
in interfaceMotionBlur
- Returns:
- the angle of rotation.
- See Also:
-
setZoom
public void setZoom(float zoom) Set the blur zoom.- Specified by:
setZoom
in interfaceMotionBlur
- Parameters:
zoom
- the zoom factor.- See Also:
-
getZoom
public float getZoom()Get the blur zoom.- Specified by:
getZoom
in interfaceMotionBlur
- Returns:
- the zoom factor.
- See Also:
-
setWrapEdges
public void setWrapEdges(boolean wrapEdges) Set whether to wrap at the image edges.- Parameters:
wrapEdges
- true if it should wrap.- See Also:
-
getWrapEdges
public boolean getWrapEdges()Get whether to wrap at the image edges.- Returns:
- true if it should wrap.
- See Also:
-
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
- Specified by:
filter
in interfaceBufferedImageOp
-
toString
-