public class PerspectiveFilter extends TransformFilter
Modifier and Type | Field and Description |
---|---|
private float |
A |
private float |
a11 |
private float |
a12 |
private float |
a13 |
private float |
a21 |
private float |
a22 |
private float |
a23 |
private float |
a31 |
private float |
a32 |
private float |
a33 |
private float |
B |
private float |
C |
private boolean |
clip |
private float |
D |
private float |
dx1 |
private float |
dx2 |
private float |
dx3 |
private float |
dy1 |
private float |
dy2 |
private float |
dy3 |
private float |
E |
private float |
F |
private float |
G |
private float |
H |
private float |
I |
private boolean |
scaled |
private float |
x0 |
private float |
x1 |
private float |
x2 |
private float |
x3 |
private float |
y0 |
private float |
y1 |
private float |
y2 |
private float |
y3 |
BILINEAR, CLAMP, edgeAction, interpolation, NEAREST_NEIGHBOUR, originalSpace, RGB_CLAMP, transformedSpace, WRAP, ZERO
Constructor and Description |
---|
PerspectiveFilter()
Construct a PerspectiveFilter.
|
PerspectiveFilter(float x0,
float y0,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Construct a PerspectiveFilter.
|
Modifier and Type | Method and Description |
---|---|
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.
|
filterPixelsNN, getEdgeAction, getInterpolation, setEdgeAction, setInterpolation
clone, createCompatibleDestImage, getRenderingHints, getRGB, setRGB
private float x0
private float y0
private float x1
private float y1
private float x2
private float y2
private float x3
private float y3
private float dx1
private float dy1
private float dx2
private float dy2
private float dx3
private float dy3
private float A
private float B
private float C
private float D
private float E
private float F
private float G
private float H
private float I
private float a11
private float a12
private float a13
private float a21
private float a22
private float a23
private float a31
private float a32
private float a33
private boolean scaled
private boolean clip
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 cornerpublic 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 cornerpublic 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 cornerpublic 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 cornerpublic BufferedImage filter(BufferedImage src, BufferedImage dst)
filter
in interface BufferedImageOp
filter
in class TransformFilter
protected void transformSpace(Rectangle rect)
TransformFilter
transformSpace
in class TransformFilter
rect
- the rectangle to transformpublic float getOriginX()
public float getOriginY()
public Rectangle2D getBounds2D(BufferedImage src)
getBounds2D
in interface BufferedImageOp
getBounds2D
in class AbstractBufferedImageOp
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
getPoint2D
in interface BufferedImageOp
getPoint2D
in class AbstractBufferedImageOp
protected void transformInverse(int x, int y, float[] out)
TransformFilter
transformInverse
in class TransformFilter
x
- 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 imageWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses