com.jhlabs.image

Class TransitionFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class TransitionFilter
extends AbstractBufferedImageOp

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

protected BufferedImageOp
filter
The filter used for the transition.
protected float
maxValue
The end value for the filter property.
protected float
minValue
The start value for the filter property.

Constructor Summary

TransitionFilter(BufferedImageOp filter, String property, float minValue, float maxValue)
Construct a TransitionFilter.

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
BufferedImage
getDestination()
Get the destination image.
float
getTransition()
Get the transition of the image.
void
prepareFilter(float transition)
Prepare the filter for the transiton at a given time.
void
setDestination(BufferedImage destination)
Set the destination image.
void
setTransition(float transition)
Set the transition of the image in the range 0..1.
String
toString()

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Field Details

filter

protected BufferedImageOp filter
The filter used for the transition.

maxValue

protected float maxValue
The end value for the filter property.

minValue

protected float minValue
The start value for the filter property.

Constructor Details

TransitionFilter

public TransitionFilter(BufferedImageOp filter,
                        String property,
                        float minValue,
                        float maxValue)
Construct a TransitionFilter.
Parameters:
filter - the filter to use
property - the filter property which is changed over the transition
minValue - the start value for the filter property
maxValue - the end value for the filter property

Method Details

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)

getDestination

public BufferedImage getDestination()
Get the destination image.
Returns:
the destination image

getTransition

public float getTransition()
Get the transition of the image.
Returns:
the transition

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

setDestination

public void setDestination(BufferedImage destination)
Set the destination image.
Parameters:
destination - the destination image

setTransition

public void setTransition(float transition)
Set the transition of the image in the range 0..1.
Parameters:
transition - the transition

toString

public String toString()