public class AffineTransform extends AbstractTransform
[ m00, m10, tx ]
[ m01, m11, ty ]
[ 0, 0, 1 ]
Modifier and Type | Field and Description |
---|---|
static int |
GENERALITY
Identifies the affine transform in
generality() . |
double |
m00
The scale, rotation and shear components of this transform.
|
double |
m01
The scale, rotation and shear components of this transform.
|
double |
m10
The scale, rotation and shear components of this transform.
|
double |
m11
The scale, rotation and shear components of this transform.
|
double |
tx
The translation components of this transform.
|
double |
ty
The translation components of this transform.
|
Constructor and Description |
---|
AffineTransform()
Creates an affine transform configured with the identity transform.
|
AffineTransform(double scale,
double angle,
double tx,
double ty)
Creates an affine transform from the supplied scale, rotation and translation.
|
AffineTransform(double scaleX,
double scaleY,
double angle,
double tx,
double ty)
Creates an affine transform from the supplied scale, rotation and translation.
|
AffineTransform(double m00,
double m01,
double m10,
double m11,
double tx,
double ty)
Creates an affine transform with the specified transform matrix.
|
Modifier and Type | Method and Description |
---|---|
Transform |
concatenate(Transform other)
Returns a new transform comprised of the concatenation of
other to this transform
(i.e. |
AffineTransform |
copy()
Returns a copy of this transform.
|
int |
generality()
Returns an integer that increases monotonically with the generality of the transform
implementation.
|
void |
get(double[] matrix)
Copies the affine transform matrix into the supplied array.
|
Point |
inverseTransform(IPoint p,
Point into)
Inverse transforms the supplied point, writing the result into
into . |
Vector |
inverseTransform(IVector v,
Vector into)
Inverse transforms the supplied vector, writing the result into
into . |
AffineTransform |
invert()
Returns a new transform that represents the inverse of this transform.
|
Transform |
lerp(Transform other,
double t)
Returns a new transform comprised of the linear interpolation between this transform and
the specified other.
|
Transform |
preConcatenate(Transform other)
Returns a new transform comprised of the concatenation of this transform to
other
(i.e. |
AffineTransform |
rotate(double angle)
Rotates this transform.
|
double |
rotation()
Returns the rotation applied by this transform.
|
AffineTransform |
scale(double scaleX,
double scaleY)
Scales this transform by the specified amount in the x and y dimensions.
|
double |
scaleX()
Returns the x-component of the scale applied by this transform.
|
AffineTransform |
scaleX(double scaleX)
Scales this transform by the specified amount in the x dimension.
|
double |
scaleY()
Returns the y-component of the scale applied by this transform.
|
AffineTransform |
scaleY(double scaleY)
Scales this transform by the specified amount in the y dimension.
|
AffineTransform |
set(AffineTransform other)
Sets this affine transform matrix to
other . |
AffineTransform |
setRotation(double angle)
Sets the rotation component of this transform.
|
AffineTransform |
setScaleX(double scaleX)
Sets the x scale of this transform.
|
AffineTransform |
setScaleY(double scaleY)
Sets the y scale of this transform.
|
AffineTransform |
setTransform(double m00,
double m01,
double m10,
double m11,
double tx,
double ty)
Sets the affine transform matrix.
|
AffineTransform |
setTranslation(double tx,
double ty)
Sets the translation component of this transform.
|
AffineTransform |
setTx(double tx)
Sets the x-component of this transform's translation.
|
AffineTransform |
setTy(double ty)
Sets the y-component of this transform's translation.
|
AffineTransform |
setUniformScale(double scale)
Sets the uniform scale of this transform.
|
AffineTransform |
shear(double sx,
double sy)
Shears this transform.
|
AffineTransform |
shearX(double sx)
Shears this transform in the x dimension.
|
AffineTransform |
shearY(double sy)
Shears this transform in the y dimension.
|
String |
toString() |
void |
transform(double[] src,
int srcOff,
double[] dst,
int dstOff,
int count)
Transforms the supplied points.
|
void |
transform(IPoint[] src,
int srcOff,
Point[] dst,
int dstOff,
int count)
Transforms the supplied points.
|
Point |
transform(IPoint p,
Point into)
Transforms the supplied point, writing the result into
into . |
Vector |
transform(IVector v,
Vector into)
Transforms the supplied vector, writing the result into
into . |
Vector |
transformPoint(IVector v,
Vector into)
Transforms the supplied vector as a point (accounting for translation), writing the result
into
into . |
AffineTransform |
translate(double tx,
double ty)
Translates this transform.
|
AffineTransform |
translateX(double tx)
Translates this transform in the x dimension.
|
AffineTransform |
translateY(double ty)
Translates this transform in the y dimension.
|
double |
tx()
Returns the x-coordinate of the translation component.
|
double |
ty()
Returns the y-coordinate of the translation component.
|
double |
uniformScale()
Returns the uniform scale applied by this transform.
|
AffineTransform |
uniformScale(double scale)
Scales this transform in a uniform manner by the specified amount.
|
clone, scale, setScale, translation
public static final int GENERALITY
generality()
.public double m00
public double m01
public double m10
public double m11
public double tx
public double ty
public AffineTransform()
public AffineTransform(double scale, double angle, double tx, double ty)
public AffineTransform(double scaleX, double scaleY, double angle, double tx, double ty)
public AffineTransform(double m00, double m01, double m10, double m11, double tx, double ty)
public AffineTransform set(AffineTransform other)
other
.public double uniformScale()
Transform
public double scaleX()
Transform
public double scaleY()
Transform
public double rotation()
Transform
public double tx()
Transform
public double ty()
Transform
public void get(double[] matrix)
Transform
matrix
- the array which receives m00, m01, m10, m11, tx, ty
.public AffineTransform setUniformScale(double scale)
Transform
setUniformScale
in interface Transform
setUniformScale
in class AbstractTransform
public AffineTransform setScaleX(double scaleX)
Transform
setScaleX
in interface Transform
setScaleX
in class AbstractTransform
public AffineTransform setScaleY(double scaleY)
Transform
setScaleY
in interface Transform
setScaleY
in class AbstractTransform
public AffineTransform setRotation(double angle)
Transform
setRotation
in interface Transform
setRotation
in class AbstractTransform
public AffineTransform setTranslation(double tx, double ty)
Transform
setTranslation
in interface Transform
setTranslation
in class AbstractTransform
public AffineTransform setTx(double tx)
Transform
setTx
in interface Transform
setTx
in class AbstractTransform
public AffineTransform setTy(double ty)
Transform
setTy
in interface Transform
setTy
in class AbstractTransform
public AffineTransform setTransform(double m00, double m01, double m10, double m11, double tx, double ty)
Transform
setTransform
in interface Transform
setTransform
in class AbstractTransform
public AffineTransform uniformScale(double scale)
Transform
uniformScale
in interface Transform
uniformScale
in class AbstractTransform
public AffineTransform scale(double scaleX, double scaleY)
Transform
scale
in interface Transform
scale
in class AbstractTransform
public AffineTransform scaleX(double scaleX)
Transform
scaleX
in interface Transform
scaleX
in class AbstractTransform
public AffineTransform scaleY(double scaleY)
Transform
scaleY
in interface Transform
scaleY
in class AbstractTransform
public AffineTransform rotate(double angle)
Transform
rotate
in interface Transform
rotate
in class AbstractTransform
public AffineTransform translate(double tx, double ty)
Transform
translate
in interface Transform
translate
in class AbstractTransform
public AffineTransform translateX(double tx)
Transform
translateX
in interface Transform
translateX
in class AbstractTransform
public AffineTransform translateY(double ty)
Transform
translateY
in interface Transform
translateY
in class AbstractTransform
public AffineTransform shear(double sx, double sy)
Transform
shear
in interface Transform
shear
in class AbstractTransform
public AffineTransform shearX(double sx)
Transform
shearX
in interface Transform
shearX
in class AbstractTransform
public AffineTransform shearY(double sy)
Transform
shearY
in interface Transform
shearY
in class AbstractTransform
public AffineTransform invert()
Transform
public Transform concatenate(Transform other)
Transform
other
to this transform
(i.e. this x other
).public Transform preConcatenate(Transform other)
Transform
other
(i.e. other x this
).public Transform lerp(Transform other, double t)
Transform
public Point transform(IPoint p, Point into)
Transform
into
.into
- a point into which to store the result, may be the same object as p
.into
for chaining.public void transform(IPoint[] src, int srcOff, Point[] dst, int dstOff, int count)
Transform
src
- the points to be transformed.srcOff
- the offset into the src
array at which to start.dst
- the points into which to store the transformed points. May be src
.dstOff
- the offset into the dst
array at which to start.count
- the number of points to transform.public void transform(double[] src, int srcOff, double[] dst, int dstOff, int count)
Transform
src
- the points to be transformed (as [x, y, x, y, ...]
).srcOff
- the offset into the src
array at which to start.dst
- the points into which to store the transformed points. May be src
.dstOff
- the offset into the dst
array at which to start.count
- the number of points to transform.public Point inverseTransform(IPoint p, Point into)
Transform
into
.into
- a point into which to store the result, may be the same object as p
.into
, for chaining.public Vector transformPoint(IVector v, Vector into)
Transform
into
.into
- a vector into which to store the result, may be the same object as v
.into
, for chaining.public Vector transform(IVector v, Vector into)
Transform
into
.into
- a vector into which to store the result, may be the same object as v
.into
, for chaining.public Vector inverseTransform(IVector v, Vector into)
Transform
into
.into
- a vector into which to store the result, may be the same object as v
.into
, for chaining.public AffineTransform copy()
Transform
copy
in interface Transform
copy
in class AbstractTransform
public int generality()
Transform
Copyright © 2017. All rights reserved.