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() . |
float |
m00
The scale, rotation and shear components of this transform.
|
float |
m01
The scale, rotation and shear components of this transform.
|
float |
m10
The scale, rotation and shear components of this transform.
|
float |
m11
The scale, rotation and shear components of this transform.
|
float |
tx
The translation components of this transform.
|
float |
ty
The translation components of this transform.
|
Constructor and Description |
---|
AffineTransform()
Creates an affine transform configured with the identity transform.
|
AffineTransform(float scale,
float angle,
float tx,
float ty)
Creates an affine transform from the supplied scale, rotation and translation.
|
AffineTransform(float scaleX,
float scaleY,
float angle,
float tx,
float ty)
Creates an affine transform from the supplied scale, rotation and translation.
|
AffineTransform(float m00,
float m01,
float m10,
float m11,
float tx,
float 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(float[] 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,
float 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(float angle)
Rotates this transform.
|
float |
rotation()
Returns the rotation applied by this transform.
|
AffineTransform |
scale(float scaleX,
float scaleY)
Scales this transform by the specified amount in the x and y dimensions.
|
float |
scaleX()
Returns the x-component of the scale applied by this transform.
|
AffineTransform |
scaleX(float scaleX)
Scales this transform by the specified amount in the x dimension.
|
float |
scaleY()
Returns the y-component of the scale applied by this transform.
|
AffineTransform |
scaleY(float 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(float angle)
Sets the rotation component of this transform.
|
AffineTransform |
setScaleX(float scaleX)
Sets the x scale of this transform.
|
AffineTransform |
setScaleY(float scaleY)
Sets the y scale of this transform.
|
AffineTransform |
setTransform(float m00,
float m01,
float m10,
float m11,
float tx,
float ty)
Sets the affine transform matrix.
|
AffineTransform |
setTranslation(float tx,
float ty)
Sets the translation component of this transform.
|
AffineTransform |
setTx(float tx)
Sets the x-component of this transform's translation.
|
AffineTransform |
setTy(float ty)
Sets the y-component of this transform's translation.
|
AffineTransform |
setUniformScale(float scale)
Sets the uniform scale of this transform.
|
AffineTransform |
shear(float sx,
float sy)
Shears this transform.
|
AffineTransform |
shearX(float sx)
Shears this transform in the x dimension.
|
AffineTransform |
shearY(float sy)
Shears this transform in the y dimension.
|
String |
toString() |
void |
transform(float[] src,
int srcOff,
float[] 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(float tx,
float ty)
Translates this transform.
|
AffineTransform |
translateX(float tx)
Translates this transform in the x dimension.
|
AffineTransform |
translateY(float ty)
Translates this transform in the y dimension.
|
float |
tx()
Returns the x-coordinate of the translation component.
|
float |
ty()
Returns the y-coordinate of the translation component.
|
float |
uniformScale()
Returns the uniform scale applied by this transform.
|
AffineTransform |
uniformScale(float scale)
Scales this transform in a uniform manner by the specified amount.
|
clone, scale, setScale, translation
public static final int GENERALITY
generality()
.public float m00
public float m01
public float m10
public float m11
public float tx
public float ty
public AffineTransform()
public AffineTransform(float scale, float angle, float tx, float ty)
public AffineTransform(float scaleX, float scaleY, float angle, float tx, float ty)
public AffineTransform(float m00, float m01, float m10, float m11, float tx, float ty)
public AffineTransform set(AffineTransform other)
other
.public float uniformScale()
Transform
public float scaleX()
Transform
public float scaleY()
Transform
public float rotation()
Transform
public float tx()
Transform
public float ty()
Transform
public void get(float[] matrix)
Transform
matrix
- the array which receives m00, m01, m10, m11, tx, ty
.public AffineTransform setUniformScale(float scale)
Transform
setUniformScale
in interface Transform
setUniformScale
in class AbstractTransform
public AffineTransform setScaleX(float scaleX)
Transform
setScaleX
in interface Transform
setScaleX
in class AbstractTransform
public AffineTransform setScaleY(float scaleY)
Transform
setScaleY
in interface Transform
setScaleY
in class AbstractTransform
public AffineTransform setRotation(float angle)
Transform
setRotation
in interface Transform
setRotation
in class AbstractTransform
public AffineTransform setTranslation(float tx, float ty)
Transform
setTranslation
in interface Transform
setTranslation
in class AbstractTransform
public AffineTransform setTx(float tx)
Transform
setTx
in interface Transform
setTx
in class AbstractTransform
public AffineTransform setTy(float ty)
Transform
setTy
in interface Transform
setTy
in class AbstractTransform
public AffineTransform setTransform(float m00, float m01, float m10, float m11, float tx, float ty)
Transform
setTransform
in interface Transform
setTransform
in class AbstractTransform
public AffineTransform uniformScale(float scale)
Transform
uniformScale
in interface Transform
uniformScale
in class AbstractTransform
public AffineTransform scale(float scaleX, float scaleY)
Transform
scale
in interface Transform
scale
in class AbstractTransform
public AffineTransform scaleX(float scaleX)
Transform
scaleX
in interface Transform
scaleX
in class AbstractTransform
public AffineTransform scaleY(float scaleY)
Transform
scaleY
in interface Transform
scaleY
in class AbstractTransform
public AffineTransform rotate(float angle)
Transform
rotate
in interface Transform
rotate
in class AbstractTransform
public AffineTransform translate(float tx, float ty)
Transform
translate
in interface Transform
translate
in class AbstractTransform
public AffineTransform translateX(float tx)
Transform
translateX
in interface Transform
translateX
in class AbstractTransform
public AffineTransform translateY(float ty)
Transform
translateY
in interface Transform
translateY
in class AbstractTransform
public AffineTransform shear(float sx, float sy)
Transform
shear
in interface Transform
shear
in class AbstractTransform
public AffineTransform shearX(float sx)
Transform
shearX
in interface Transform
shearX
in class AbstractTransform
public AffineTransform shearY(float 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, float 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(float[] src, int srcOff, float[] 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.