com.jhlabs.image
Class WarpFilter
- BufferedImageOp, Cloneable
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.
void | crossDissolve(int[] pixels1, int[] pixels2, int width, int height, float t)
|
protected int[] | filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace)
|
WarpGrid | getDestGrid() - Get the destination warp grid.
|
int | getFrames()
|
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(BufferedImage morphImage) - For morphing, sets the image we're morphing to.
|
void | setSourceGrid(WarpGrid sourceGrid) - Set the source warp grid.
|
void | setTime(float time)
|
String | toString()
|
protected void | transformSpace(Rectangle r)
|
WarpFilter
public WarpFilter()
Create a WarpFilter.
WarpFilter
public WarpFilter(WarpGrid sourceGrid,
WarpGrid destGrid)
Create a WarpFilter with two warp grids.
sourceGrid
- the source griddestGrid
- the destination grid
crossDissolve
public void crossDissolve(int[] pixels1,
int[] pixels2,
int width,
int height,
float t)
filterPixels
protected int[] filterPixels(int width,
int height,
int[] inPixels,
Rectangle transformedSpace)
- filterPixels in interface WholeImageFilter
getDestGrid
public WarpGrid getDestGrid()
Get the destination warp grid.
getFrames
public int getFrames()
getMorphImage
public BufferedImage getMorphImage()
getSourceGrid
public WarpGrid getSourceGrid()
Get the source warp grid.
getTime
public float getTime()
morph
public void morph(int[] srcPixels,
int[] destPixels,
int[] outPixels,
WarpGrid srcGrid,
WarpGrid destGrid,
int width,
int height,
float t)
setDestGrid
public void setDestGrid(WarpGrid destGrid)
Set the destination warp grid.
destGrid
- the destination grid
setFrames
public void setFrames(int frames)
setMorphImage
public void setMorphImage(BufferedImage morphImage)
For morphing, sets the image we're morphing to. If not, set then we're just warping.
setSourceGrid
public void setSourceGrid(WarpGrid sourceGrid)
Set the source warp grid.
sourceGrid
- the source grid
setTime
public void setTime(float time)
toString
public String toString()