Class WarpFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable

public class WarpFilter extends WholeImageFilter
A filter for warping images using the gridwarp algorithm. You need to supply two warp grids, one for the source image and one for the destination image. The image will be warped so that a point in the source grid moves to its counterpart in the destination grid.
  • Constructor Details

    • WarpFilter

      public WarpFilter()
      Create a WarpFilter.
    • WarpFilter

      public WarpFilter(WarpGrid sourceGrid, WarpGrid destGrid)
      Create a WarpFilter with two warp grids.
      Parameters:
      sourceGrid - the source grid
      destGrid - the destination grid
  • Method Details

    • setSourceGrid

      public void setSourceGrid(WarpGrid sourceGrid)
      Set the source warp grid.
      Parameters:
      sourceGrid - the source grid
      See Also:
    • getSourceGrid

      public WarpGrid getSourceGrid()
      Get the source warp grid.
      Returns:
      the source grid
      See Also:
    • setDestGrid

      public void setDestGrid(WarpGrid destGrid)
      Set the destination warp grid.
      Parameters:
      destGrid - the destination grid
      See Also:
    • getDestGrid

      public WarpGrid getDestGrid()
      Get the destination warp grid.
      Returns:
      the destination grid
      See Also:
    • setFrames

      public void setFrames(int frames)
    • getFrames

      public int getFrames()
    • setMorphImage

      public void setMorphImage(BufferedImage morphImage)
      For morphing, sets the image we're morphing to. If not, set then we're just warping.
    • getMorphImage

      public BufferedImage getMorphImage()
    • setTime

      public void setTime(float time)
    • getTime

      public float getTime()
    • transformSpace

      protected void transformSpace(Rectangle r)
      Description copied from class: WholeImageFilter
      Calculate output bounds for given input bounds.
      Overrides:
      transformSpace in class WholeImageFilter
      Parameters:
      r - input and output rectangle
    • filterPixels

      protected int[] filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace)
      Description copied from class: WholeImageFilter
      Actually filter the pixels.
      Specified by:
      filterPixels in class WholeImageFilter
      Parameters:
      width - the image width
      height - the image height
      inPixels - the image pixels
      transformedSpace - the output bounds
      Returns:
      the output pixels
    • morph

      public void morph(int[] srcPixels, int[] destPixels, int[] outPixels, WarpGrid srcGrid, WarpGrid destGrid, int width, int height, float t)
    • crossDissolve

      public void crossDissolve(int[] pixels1, int[] pixels2, int width, int height, float t)
    • toString

      public String toString()
      Overrides:
      toString in class Object