Class TransitionFilter

  • All Implemented Interfaces:
    java.awt.image.BufferedImageOp, java.lang.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

      Fields 
      Modifier and Type Field Description
      protected java.awt.image.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

      Constructors 
      Constructor Description
      TransitionFilter​(java.awt.image.BufferedImageOp filter, java.lang.String property, float minValue, float maxValue)
      Construct a TransitionFilter.
    • Field Detail

      • filter

        protected java.awt.image.BufferedImageOp filter
        The filter used for the transition.
      • minValue

        protected float minValue
        The start value for the filter property.
      • maxValue

        protected float maxValue
        The end value for the filter property.
    • Constructor Detail

      • TransitionFilter

        public TransitionFilter​(java.awt.image.BufferedImageOp filter,
                                java.lang.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 Detail

      • setTransition

        public void setTransition​(float transition)
        Set the transition of the image in the range 0..1.
        Parameters:
        transition - the transition. Minimum value: 0, maximum value: 1
        See Also:
        getTransition()
      • getTransition

        public float getTransition()
        Get the transition of the image.
        Returns:
        the transition
        See Also:
        setTransition(float)
      • setDestination

        public void setDestination​(java.awt.image.BufferedImage destination)
        Set the destination image.
        Parameters:
        destination - the destination image
        See Also:
        getDestination()
      • getDestination

        public java.awt.image.BufferedImage getDestination()
        Get the destination image.
        Returns:
        the destination image
        See Also:
        setDestination(BufferedImage)
      • 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

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src,
                                                   java.awt.image.BufferedImage dst)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object