com.jhlabs.image
Class WarpFilter

java.lang.Object
  extended by com.jhlabs.image.AbstractBufferedImageOp
      extended by j2d.filters.WholeImageFilter
          extended by com.jhlabs.image.WarpFilter
All Implemented Interfaces:
ImageProcessorInterface, java.awt.image.BufferedImageOp, java.lang.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 Summary
WarpFilter()
          Create a WarpFilter.
WarpFilter(WarpGrid sourceGrid, WarpGrid destGrid)
          Create a WarpFilter with two warp grids.
 
Method Summary
 void crossDissolve(int[] pixels1, int[] pixels2, int width, int height, float t)
           
 WarpGrid getDestGrid()
          Get the destination warp grid.
 int getFrames()
           
 java.awt.image.BufferedImage getMorphImage()
           
 WarpGrid getSourceGrid()
          Get the source warp grid.
 float getTime()
           
 void morph(int[] srcPixels, int[] destPixels, int[] outPixels, WarpGrid srcGrid, WarpGrid destGrid, int width, int height, float t)
           
 void setDestGrid(WarpGrid destGrid)
          Set the destination warp grid.
 void setFrames(int frames)
           
 void setMorphImage(java.awt.image.BufferedImage morphImage)
          For morphing, sets the image we're morphing to.
 void setSourceGrid(WarpGrid sourceGrid)
          Set the source warp grid.
 void setTime(float time)
           
 java.lang.String toString()
           
 
Methods inherited from class j2d.filters.WholeImageFilter
filter
 
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, process, setRGB
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

setSourceGrid

public void setSourceGrid(WarpGrid sourceGrid)
Set the source warp grid.

Parameters:
sourceGrid - the source grid

getSourceGrid

public WarpGrid getSourceGrid()
Get the source warp grid.

Returns:
the source grid

setDestGrid

public void setDestGrid(WarpGrid destGrid)
Set the destination warp grid.

Parameters:
destGrid - the destination grid

getDestGrid

public WarpGrid getDestGrid()
Get the destination warp grid.

Returns:
the destination grid

setFrames

public void setFrames(int frames)

getFrames

public int getFrames()

setMorphImage

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


getMorphImage

public java.awt.image.BufferedImage getMorphImage()

setTime

public void setTime(float time)

getTime

public float getTime()

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 java.lang.String toString()
Overrides:
toString in class java.lang.Object