Package com.jhlabs.image
Class TransitionFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.TransitionFilter
- All Implemented Interfaces:
BufferedImageOp,Cloneable
A filter which uses another filter to perform a transition.
e.g. to create a blur transition, you could write: new TransitionFilter( new BoxBlurFilter(), "radius", 0, 100 );
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BufferedImageOpThe filter used for the transition.protected floatThe end value for the filter property.protected floatThe start value for the filter property. -
Constructor Summary
ConstructorsConstructorDescriptionTransitionFilter(BufferedImageOp filter, String property, float minValue, float maxValue) Construct a TransitionFilter. -
Method Summary
Modifier and TypeMethodDescriptionfilter(BufferedImage src, BufferedImage dst) Get the destination image.floatGet the transition of the image.voidprepareFilter(float transition) Prepare the filter for the transiton at a given time.voidsetDestination(BufferedImage destination) Set the destination image.voidsetTransition(float transition) Set the transition of the image in the range 0..1.toString()Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
Field Details
-
filter
The filter used for the transition. -
minValue
protected float minValueThe start value for the filter property. -
maxValue
protected float maxValueThe end value for the filter property.
-
-
Constructor Details
-
TransitionFilter
Construct a TransitionFilter.- Parameters:
filter- the filter to useproperty- the filter property which is changed over the transitionminValue- the start value for the filter propertymaxValue- the end value for the filter property
-
-
Method Details
-
setTransition
public void setTransition(float transition) Set the transition of the image in the range 0..1.- Parameters:
transition- the transition- See Also:
-
getTransition
public float getTransition()Get the transition of the image.- Returns:
- the transition
- See Also:
-
setDestination
Set the destination image.- Parameters:
destination- the destination image- See Also:
-
getDestination
Get the destination image.- Returns:
- the destination image
- See Also:
-
prepareFilter
public void prepareFilter(float transition) Prepare the filter for the transiton at a given time. The default implementation sets the given filter property, but you could override this method to make other changes.- Parameters:
transition- the transition time in the range 0 - 1
-
filter
-
toString
-