Package com.jhlabs.image
Class WarpFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.WholeImageFilter
com.jhlabs.image.WarpFilter
- All Implemented Interfaces:
BufferedImageOp
,Serializable
,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.
- See Also:
-
Field Summary
Fields inherited from class com.jhlabs.image.WholeImageFilter
originalSpace, transformedSpace
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a WarpFilter.WarpFilter
(WarpGrid sourceGrid, WarpGrid destGrid) Create a WarpFilter with two warp grids. -
Method Summary
Modifier and TypeMethodDescriptionvoid
crossDissolve
(int[] pixels1, int[] pixels2, int width, int height, float t) protected int[]
filterPixels
(int width, int height, int[] inPixels, Rectangle transformedSpace) Get the destination warp grid.int
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) toString()
protected void
Methods inherited from class com.jhlabs.image.WholeImageFilter
filter
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
Constructor Details
-
WarpFilter
public WarpFilter()Create a WarpFilter. -
WarpFilter
Create a WarpFilter with two warp grids.- Parameters:
sourceGrid
- the source griddestGrid
- the destination grid
-
-
Method Details
-
setSourceGrid
Set the source warp grid.- Parameters:
sourceGrid
- the source grid
-
getSourceGrid
Get the source warp grid.- Returns:
- the source grid
-
setDestGrid
Set the destination warp grid.- Parameters:
destGrid
- the destination grid
-
getDestGrid
Get the destination warp grid.- Returns:
- the destination grid
-
setFrames
public void setFrames(int frames) -
getFrames
public int getFrames() -
setMorphImage
For morphing, sets the image we're morphing to. If not, set then we're just warping. -
getMorphImage
-
setTime
public void setTime(float time) -
getTime
public float getTime() -
transformSpace
- Overrides:
transformSpace
in classWholeImageFilter
-
filterPixels
- Specified by:
filterPixels
in classWholeImageFilter
-
morph
-
crossDissolve
public void crossDissolve(int[] pixels1, int[] pixels2, int width, int height, float t) -
toString
-