| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectFacemorph.GridWarp2D
public class GridWarp2D
Warps using a grid of fixed size using B-splines and an affine term
| Constructor Summary | |
|---|---|
GridWarp2D(int gridWidth,
           int gridHeight,
           int width,
           int height)
Creates a new instance of GridWarp2D  | 
|
| Method Summary | |
|---|---|
 java.awt.geom.Point2D.Double | 
get(double x,
    double y)
Gets the interpolated value at the point specified  | 
static void | 
main(java.lang.String[] args)
Main method for testing  | 
static java.awt.Color | 
sample(java.awt.image.BufferedImage img,
       float x,
       float y)
Sample from a non-integer point in an image (as an int array) using linear interpolated sampling  | 
 void | 
setAffine(Vector3 ax,
          Vector3 ay)
Sets the affine terms  | 
 void | 
setGridValue(int x,
             int y,
             double xval,
             double yval)
Sets a specific grid value  | 
 double | 
spline(double x)
Calculates the cubic B-spline on interval x=[0.0,4.0]  | 
 java.awt.image.BufferedImage | 
warpImage(java.awt.image.BufferedImage img)
Warps the given image using this GridWarp2D  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public GridWarp2D(int gridWidth,
                  int gridHeight,
                  int width,
                  int height)
gridWidth - the width of the gridwidth - the width of the warped imagegridHeight - the height of the gridheight - the height of the grid to warp| Method Detail | 
|---|
public void setGridValue(int x,
                         int y,
                         double xval,
                         double yval)
x - the x-grid coordy - the y-grid coordxval - the new x-value of the warpyval - the new y-value of the warp
public void setAffine(Vector3 ax,
                      Vector3 ay)
ax - the x affine termay - the y affine term
public java.awt.geom.Point2D.Double get(double x,
                                        double y)
x - the x-coordy - the y-coord
public double spline(double x)
x - the position on the interval
public static java.awt.Color sample(java.awt.image.BufferedImage img,
                                    float x,
                                    float y)
img - The BufferedImage to sample fromx - The x-coord of the sample pointy - Te y-coord of the sample point
public java.awt.image.BufferedImage warpImage(java.awt.image.BufferedImage img)
img - the image top warp
public static void main(java.lang.String[] args)
args - command line arguments (not used)
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||