Facemorph
Class LinearWarp

java.lang.Object
  extended by Facemorph.Warp
      extended by Facemorph.LinearWarp
All Implemented Interfaces:
java.io.Serializable

public class LinearWarp
extends Warp

Performs triangulated linear interpolation for image warping

See Also:
Serialized Form

Field Summary
 
Fields inherited from class Facemorph.Warp
height, LINEAR, MULTISCALE, MULTISCALERB, TPS, width, xshift, yshift
 
Constructor Summary
LinearWarp()
          Output image width / int twidth; /** output image height / int theight; /* /** Construct an empty LinearWarp
LinearWarp(int w, int h, int W, int H, boolean r)
          Constructs a Linear warp with the input and output size specified
 
Method Summary
 java.awt.Image drawTess(java.awt.Image img)
          Draw the triangulation (tesselation) used for the warp on the supplied image
 boolean interpolate(int n, java.awt.geom.Point2D.Float[] dest, java.awt.geom.Point2D.Float[] source, boolean borders)
          Perform the interpolation
 
Methods inherited from class Facemorph.Warp
concatenate, concatenate, convert, createWarp, get, getHeight, getWidth, interpolate, interpolate, interpolate, iterate, overlap, reconvert, sample, sample, scaleWarp, set, stripPoints, warpFloatImage, warpImage, warpImage, warpImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearWarp

public LinearWarp()
Output image width / int twidth; /** output image height / int theight; /* /** Construct an empty LinearWarp


LinearWarp

public LinearWarp(int w,
                  int h,
                  int W,
                  int H,
                  boolean r)
Constructs a Linear warp with the input and output size specified

Parameters:
w - input width
h - input height
W - output width
H - output height
r - triangulate on reverse template??
Method Detail

interpolate

public boolean interpolate(int n,
                           java.awt.geom.Point2D.Float[] dest,
                           java.awt.geom.Point2D.Float[] source,
                           boolean borders)
Perform the interpolation

Specified by:
interpolate in class Warp
Parameters:
n - Number of input points to interpolate
dest - List of destination points to interpolate
source - List of source points to interpolate
borders - Indicates if the borders should be pinned down (using a set of points round the image edge)
Returns:
true if the interpolation was completed OK

drawTess

public java.awt.Image drawTess(java.awt.Image img)
Draw the triangulation (tesselation) used for the warp on the supplied image

Parameters:
img - The image to draw on
Returns:
A copy of the image with the tesselation shown