public class AffineTransform extends NativeBase
Modifier and Type | Field and Description |
---|---|
double |
a
The 'a' matrix element.
|
double |
b
The 'b' matrix element.
|
double |
c
The 'c' matrix element.
|
double |
d
The 'd' matrix element.
|
double |
e
The 'e' matrix element.
|
double |
f
The 'f' matrix element.
|
Constructor and Description |
---|
AffineTransform()
Constructor.
|
AffineTransform(double a,
double b,
double c,
double d,
double e,
double f) |
Modifier and Type | Method and Description |
---|---|
void |
concatenate(AffineTransform other)
Concatenate transform with other transform.
|
boolean |
equals(java.lang.Object obj) |
double |
getA()
Gets
a |
double |
getB()
Gets
b |
double |
getC()
Gets
c |
double |
getD()
Gets
d |
double |
getE()
Gets
e |
double |
getF()
Gets
f |
static AffineTransform |
getIdentity()
The identity transform (Getter)
|
void |
invert()
Invert the transform
|
void |
rotate(double angle,
Point center)
Rotate.
|
void |
scale(double sx,
double sy)
Scale.
|
void |
setA(double a)
Sets
a |
void |
setB(double b)
Sets
b |
void |
setC(double c)
Sets
c |
void |
setD(double d)
Sets
d |
void |
setE(double e)
Sets
e |
void |
setF(double f)
Sets
f |
void |
skew(double alpha,
double beta)
Skew.
|
Point |
transformPoint(Point original)
Transforms the given point.
|
Quadrilateral |
transformQuadrilateral(Quadrilateral original)
Transform a given quadrilateral
|
Quadrilateral |
transformRectangle(Rectangle original)
Transform the given rectangle
|
void |
translate(double tx,
double ty)
Translate.
|
public double a
public double b
public double c
public double d
public double e
public double f
public AffineTransform()
public AffineTransform(double a, double b, double c, double d, double e, double f)
public double getA()
a
public void setA(double a)
a
public double getB()
b
public void setB(double b)
b
public double getC()
c
public void setC(double c)
c
public double getD()
d
public void setD(double d)
d
public double getE()
e
public void setE(double e)
e
public double getF()
f
public void setF(double f)
f
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void translate(double tx, double ty)
tx
- horizontal translationty
- vertical translationjava.lang.IllegalStateException
- If the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)public void scale(double sx, double sy)
sx
- horizontal scale factorsy
- vertical scale factorjava.lang.IllegalStateException
- If the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)public void rotate(double angle, Point center)
Rotations are produced by [cos(a) sin(a) -sin(a) cos(a) 0 0], which has the effect of rotating the coordinate system axes by an angle "a" in counterclockwise direction around the origin.
If the given center
is not null
,
then the rotation is performed around the given center point,
which is equivalent to the following sequence:
translate(double, double)
to center
.
rotate(double, com.pdf_tools.fourheights.pdftoolbox.geometry.real.Point)
by angle
around the origin.
translate(double, double)
"back" to the original origin.
angle
- center
- If null
then the origin (0/0) is taken as center.java.lang.IllegalStateException
- If the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)public void skew(double alpha, double beta)
alpha
- angle a in degreesbeta
- angle b in degreesjava.lang.IllegalStateException
- If the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)java.lang.IllegalArgumentException
- if any of the given angles is too close to 90 + k*180 degrees for k = ..., -2, -1, 0, 1, 2, ...public void concatenate(AffineTransform other)
other
- the transform to be concatenated to this transformjava.lang.IllegalStateException
- If the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)java.lang.IllegalArgumentException
- If the other
affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)java.lang.IllegalArgumentException
- if other
is null
public void invert()
java.lang.IllegalStateException
- If the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)public Point transformPoint(Point original)
original
- the point to be transformedjava.lang.IllegalStateException
- If the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)java.lang.IllegalArgumentException
- if original
is null
public Quadrilateral transformRectangle(Rectangle original)
Quadrilateral
is a parallelogram.original
- the rectangle to be transformedjava.lang.IllegalStateException
- if the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)java.lang.IllegalArgumentException
- if original
is null
public Quadrilateral transformQuadrilateral(Quadrilateral original)
original
- the quadrilateral to be transformedjava.lang.IllegalStateException
- if the affine transform is singular, e.g. default initialized.
(Use getIdentity()
as an initial value.)java.lang.IllegalArgumentException
- if original
is null
public static AffineTransform getIdentity()