|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.TransformFilter
com.jhlabs.image.PerspectiveFilter
public class PerspectiveFilter
A filter which performs a perspective distortion on an image. Coordinates are treated as if the image was a unit square, i.e. the bottom-right corner of the image is at (1, 1). The filter maps the unit square onto an arbitrary convex quadrilateral or vice versa.
| Field Summary |
|---|
| Fields inherited from class com.jhlabs.image.TransformFilter |
|---|
BILINEAR, CLAMP, edgeAction, interpolation, NEAREST_NEIGHBOUR, originalSpace, RGB_CLAMP, transformedSpace, WRAP, ZERO |
| Constructor Summary | |
|---|---|
PerspectiveFilter()
Construct a PerspectiveFilter. |
|
PerspectiveFilter(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Construct a PerspectiveFilter. |
|
| Method Summary | |
|---|---|
BufferedImage |
filter(BufferedImage src,
BufferedImage dst)
|
Rectangle2D |
getBounds2D(BufferedImage src)
|
boolean |
getClip()
|
float |
getOriginX()
Get the origin of the output image. |
float |
getOriginY()
Get the origin of the output image. |
Point2D |
getPoint2D(Point2D srcPt,
Point2D dstPt)
|
void |
quadToUnitSquare(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Set the transform to map a quadrilateral onto the unit square. |
void |
setClip(boolean clip)
|
void |
setCorners(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Set the new positions of the image corners. |
String |
toString()
|
protected void |
transformInverse(int x,
int y,
float[] out)
Inverse transform a point. |
protected void |
transformSpace(Rectangle rect)
Forward transform a rectangle. |
void |
unitSquareToQuad(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Set the transform to map the unit square onto a quadrilateral. |
| Methods inherited from class com.jhlabs.image.TransformFilter |
|---|
filterPixelsNN, getEdgeAction, getInterpolation, setEdgeAction, setInterpolation |
| Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp |
|---|
clone, createCompatibleDestImage, getRenderingHints, getRGB, setRGB |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PerspectiveFilter()
public PerspectiveFilter(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
x0 - the new position of the top left cornery0 - the new position of the top left cornerx1 - the new position of the top right cornery1 - the new position of the top right cornerx2 - the new position of the bottom right cornery2 - the new position of the bottom right cornerx3 - the new position of the bottom left cornery3 - the new position of the bottom left corner| Method Detail |
|---|
public void setClip(boolean clip)
public boolean getClip()
public void setCorners(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
x0 - the new position of the top left cornery0 - the new position of the top left cornerx1 - the new position of the top right cornery1 - the new position of the top right cornerx2 - the new position of the bottom right cornery2 - the new position of the bottom right cornerx3 - the new position of the bottom left cornery3 - the new position of the bottom left corner
public void unitSquareToQuad(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
x0 - the new position of the top left cornery0 - the new position of the top left cornerx1 - the new position of the top right cornery1 - the new position of the top right cornerx2 - the new position of the bottom right cornery2 - the new position of the bottom right cornerx3 - the new position of the bottom left cornery3 - the new position of the bottom left corner
public void quadToUnitSquare(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
x0 - the old position of the top left cornery0 - the old position of the top left cornerx1 - the old position of the top right cornery1 - the old position of the top right cornerx2 - the old position of the bottom right cornery2 - the old position of the bottom right cornerx3 - the old position of the bottom left cornery3 - the old position of the bottom left corner
public BufferedImage filter(BufferedImage src,
BufferedImage dst)
filter in interface BufferedImageOpfilter in class TransformFilterprotected void transformSpace(Rectangle rect)
TransformFilter
transformSpace in class TransformFilterrect - the rectangle to transformpublic float getOriginX()
public float getOriginY()
public Rectangle2D getBounds2D(BufferedImage src)
getBounds2D in interface BufferedImageOpgetBounds2D in class AbstractBufferedImageOp
public Point2D getPoint2D(Point2D srcPt,
Point2D dstPt)
getPoint2D in interface BufferedImageOpgetPoint2D in class AbstractBufferedImageOp
protected void transformInverse(int x,
int y,
float[] out)
TransformFilter
transformInverse in class TransformFilterx - the X position of the pixel in the output imagey - the Y position of the pixel in the output imageout - the position of the pixel in the input imagepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||