org.jscience.media.pictures.filters
Class WarpFilter

java.lang.Object
  extended by java.awt.image.ImageFilter
      extended by org.jscience.media.pictures.filters.WholeImageFilter
          extended by org.jscience.media.pictures.filters.WarpFilter
All Implemented Interfaces:
java.awt.image.ImageConsumer, java.io.Serializable, 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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.media.pictures.filters.WholeImageFilter
canFilterIndexColorModel, defaultRGBModel, inBytePixels, inPixels, originalSpace, transformedSpace
 
Fields inherited from class java.awt.image.ImageFilter
consumer
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
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)
          DOCUMENT ME!
 WarpGrid getDestGrid()
          Get the destination warp grid.
 int getFrames()
          DOCUMENT ME!
 int[] getPixels(java.awt.Image image, int width, int height)
          DOCUMENT ME!
 WarpGrid getSourceGrid()
          Get the source warp grid.
 void imageComplete(int status)
          DOCUMENT ME!
 void morph(int[] srcPixels, int[] destPixels, int[] outPixels, WarpGrid srcGrid, WarpGrid destGrid, int width, int height, float t)
          DOCUMENT ME!
 void setDestGrid(WarpGrid destGrid)
          Set the destination warp grid.
 void setFrames(int frames)
          DOCUMENT ME!
 void setSourceGrid(WarpGrid sourceGrid)
          Set the source warp grid.
 java.lang.String toString()
          DOCUMENT ME!
protected  void transformSpace(java.awt.Rectangle r)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.media.pictures.filters.WholeImageFilter
setColorModel, setDimensions, setPixels, setPixels
 
Methods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, resendTopDownLeftRight, setHints, setProperties
 
Methods inherited from class java.lang.Object
equals, finalize, 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)
DOCUMENT ME!

Parameters:
frames - DOCUMENT ME!

getFrames

public int getFrames()
DOCUMENT ME!

Returns:
DOCUMENT ME!

transformSpace

protected void transformSpace(java.awt.Rectangle r)
DOCUMENT ME!

Overrides:
transformSpace in class WholeImageFilter
Parameters:
r - DOCUMENT ME!

imageComplete

public void imageComplete(int status)
DOCUMENT ME!

Specified by:
imageComplete in interface java.awt.image.ImageConsumer
Overrides:
imageComplete in class java.awt.image.ImageFilter
Parameters:
status - DOCUMENT ME!

getPixels

public int[] getPixels(java.awt.Image image,
                       int width,
                       int height)
DOCUMENT ME!

Parameters:
image - DOCUMENT ME!
width - DOCUMENT ME!
height - DOCUMENT ME!
Returns:
DOCUMENT ME!

morph

public void morph(int[] srcPixels,
                  int[] destPixels,
                  int[] outPixels,
                  WarpGrid srcGrid,
                  WarpGrid destGrid,
                  int width,
                  int height,
                  float t)
DOCUMENT ME!

Parameters:
srcPixels - DOCUMENT ME!
destPixels - DOCUMENT ME!
outPixels - DOCUMENT ME!
srcGrid - DOCUMENT ME!
destGrid - DOCUMENT ME!
width - DOCUMENT ME!
height - DOCUMENT ME!
t - DOCUMENT ME!

crossDissolve

public void crossDissolve(int[] pixels1,
                          int[] pixels2,
                          int width,
                          int height,
                          float t)
DOCUMENT ME!

Parameters:
pixels1 - DOCUMENT ME!
pixels2 - DOCUMENT ME!
width - DOCUMENT ME!
height - DOCUMENT ME!
t - DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!