|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.imaging.Matrix
public class Matrix
Replaces the GDI+ Matrix.
Field Summary | |
---|---|
static int |
TYPE_FLIP
This flag bit indicates that the transform defined by this object performs a mirror image flip about some axis which changes the normally right handed coordinate system into a left handed system in addition to the conversions indicated by other flag bits. |
static int |
TYPE_GENERAL_ROTATION
This flag bit indicates that the transform defined by this object performs a rotation by an arbitrary angle in addition to the conversions indicated by other flag bits. |
static int |
TYPE_GENERAL_SCALE
A general scale multiplies the length of vectors by different amounts in the x and y directions without changing the angle between perpendicular vectors. |
static int |
TYPE_GENERAL_TRANSFORM
This constant indicates that the transform defined by this object performs an arbitrary conversion of the input coordinates. |
static int |
TYPE_IDENTITY
An identity transform is one in which the output coordinates are always the same as the input coordinates. |
static int |
TYPE_MASK_ROTATION
This constant is a bit mask for any of the rotation flag bits. |
static int |
TYPE_MASK_SCALE
This constant is a bit mask for any of the scale flag bits. |
static int |
TYPE_QUADRANT_ROTATION
This flag bit indicates that the transform defined by this object performs a quadrant rotation by some multiple of 90 degrees in addition to the conversions indicated by other flag bits. |
static int |
TYPE_TRANSLATION
A translation moves the coordinates by a constant amount in x and y without changing the length or angle of vectors. |
static int |
TYPE_UNIFORM_SCALE
A uniform scale multiplies the length of vectors by the same amount in both the x and y directions without changing the angle between vectors. |
Constructor Summary | |
---|---|
Matrix()
Initializes a new instance of the Matrix class as the identity matrix. |
|
Matrix(float m11,
float m12,
float m21,
float m22,
float m31,
float m32)
Initializes a new instance of the Matrix class. |
|
Matrix(RectangleF rect,
PointF[] plgpts)
Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points. |
|
Matrix(Rectangle rect,
Point[] plgpts)
Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points. |
Method Summary | |
---|---|
static boolean |
equals(Matrix a,
Matrix b)
Determines whether two matricies are equal. |
boolean |
equals(java.lang.Object obj)
Determines whether the specified System.Object is equal to this instance. |
float[] |
getElements_Rename_Namesake()
Gets an array of floating-point values that represents the elements of this Matrix . |
float[] |
getElements()
Gets the copy of matrix elements. |
float |
getM11()
Gets the matrix element at first row first column. |
float |
getM12()
Gets the matrix element at first row second column. |
float |
getM21()
Gets the matrix element at second row first column. |
float |
getM22()
Gets the matrix element at second row second column. |
float |
getM31()
Gets the matrix element at third row first column. |
float |
getM32()
Gets the matrix element at third row first column. |
int |
hashCode()
Returns a hash code for this instance. |
void |
multiply(Matrix Tx)
Multiplies this Matrix by the matrix specified in the matrix parameter using (default) Prepend order. |
void |
multiply(Matrix Tx,
int order)
Multiplies this Matrix by the matrix specified in the matrix parameter, and in the order specified in the order parameter. |
static boolean |
op_Equality(Matrix matrix1,
Matrix matrix2)
Implements the operator ==. |
static boolean |
op_Inequality(Matrix matrix1,
Matrix matrix2)
Implements the operator ! |
void |
reset()
Resets this Matrix to have the elements of the identity matrix. |
void |
rotate(float angle)
Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix in the default (Prepend) order. |
void |
rotate(float angle,
int order)
Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix in the specified order. |
void |
rotateAt(float angle,
PointF point)
Applies a clockwise rotation about the specified point to this Matrix in the default (Prepend) order. |
void |
rotateAt(float angle,
PointF point,
int order)
Applies a clockwise rotation about the specified point to this Matrix in the specified order. |
void |
scale(float sx,
float sy)
Applies the specified scale vector (scaleX and scaleY) to this Matrix using (default) Prepend order. |
void |
scale(float scaleX,
float scaleY,
int order)
Applies the specified scale vector (scaleX and scaleY) to this Matrix using the specified order. |
java.lang.String |
toString()
Returns a System.String that represents this instance. |
void |
transformPoints(PointF[] points)
Applies the geometric transform represented by this Matrix to a specified array of points. |
void |
translate(float tx,
float ty)
Applies the specified translation vector to this Matrix using (default) Prepend order. |
void |
translate(float offsetX,
float offsetY,
int order)
Applies the specified translation vector to this Matrix in the specified order. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_FLIP
This flag bit indicates that the transform defined by this object performs a mirror image flip about some axis which changes the normally right handed coordinate system into a left handed system in addition to the conversions indicated by other flag bits. A right handed coordinate system is one where the positive X axis rotates counterclockwise to overlay the positive Y axis similar to the direction that the fingers on your right hand curl when you stare end on at your thumb. A left handed coordinate system is one where the positive X axis rotates clockwise to overlay the positive Y axis similar to the direction that the fingers on your left hand curl. There is no mathematical way to determine the angle of the original flipping or mirroring transformation since all angles of flip are identical given an appropriate adjusting rotation. NOTE: TypeFlip was added after GENERAL_TRANSFORM was in public circulation and the flag bits could no longer be conveniently renumbered without introducing binary incompatibility in outside code.
public static final int TYPE_GENERAL_ROTATION
This flag bit indicates that the transform defined by this object performs a rotation by an arbitrary angle in addition to the conversions indicated by other flag bits. A rotation changes the angles of vectors by the same amount regardless of the original direction of the vector and without changing the length of the vector. This flag bit is mutually exclusive with the
public static final int TYPE_GENERAL_SCALE
A general scale multiplies the length of vectors by different amounts in the x and y directions without changing the angle between perpendicular vectors. This flag bit is mutually exclusive with the TypeUniformScale flag.
public static final int TYPE_GENERAL_TRANSFORM
This constant indicates that the transform defined by this object performs an arbitrary conversion of the input coordinates. If this transform can be classified by any of the above constants, the type will either be the constant TypeIdentity or a combination of the appropriate flag bits for the various coordinate conversions that this transform performs.
public static final int TYPE_IDENTITY
An identity transform is one in which the output coordinates are always the same as the input coordinates. If this transform is anything other than the identity transform, the type will either be the constant GENERAL_TRANSFORM or a combination of the appropriate flag bits for the various coordinate conversions that this transform performs.
public static final int TYPE_MASK_ROTATION
This constant is a bit mask for any of the rotation flag bits.
public static final int TYPE_MASK_SCALE
This constant is a bit mask for any of the scale flag bits.
public static final int TYPE_QUADRANT_ROTATION
This flag bit indicates that the transform defined by this object performs a quadrant rotation by some multiple of 90 degrees in addition to the conversions indicated by other flag bits. A rotation changes the angles of vectors by the same amount regardless of the original direction of the vector and without changing the length of the vector. This flag bit is mutually exclusive with the TypeGeneralRotation flag.
public static final int TYPE_TRANSLATION
A translation moves the coordinates by a constant amount in x and y without changing the length or angle of vectors.
public static final int TYPE_UNIFORM_SCALE
A uniform scale multiplies the length of vectors by the same amount in both the x and y directions without changing the angle between vectors. This flag bit is mutually exclusive with the TypeGeneralScale flag.
Constructor Detail |
---|
public Matrix()
Initializes a new instance of the Matrix class as the identity matrix.
public Matrix(float m11, float m12, float m21, float m22, float m31, float m32)
Initializes a new instance of the Matrix
class.
m11
- m00 M11 Scale Xm12
- m10 M12 Shear Ym21
- m01 M21 Shear Xm22
- m11 M22 Scale Ym31
- m02 M31 Translate Xm32
- m12 M32 Translate Ypublic Matrix(RectangleF rect, PointF[] plgpts)
Initializes a new instance of the Matrix
class to the geometric transform defined by the specified rectangle and array of points.
rect
- A RectangleF
structure that represents the rectangle to be transformed.plgpts
- An array of three PointF
structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners of the rectangle is to be transformed. The lower-right corner of the parallelogram is implied by the first three corners.public Matrix(Rectangle rect, Point[] plgpts)
Initializes a new instance of the Matrix
class to the geometric transform defined by the specified rectangle and array of points.
rect
- A Rectangle
structure that represents the rectangle to be transformed.plgpts
- An array of three Point
structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners of the rectangle is to be transformed. The lower-right corner of the parallelogram is implied by the first three corners.Method Detail |
---|
public static boolean equals(Matrix a, Matrix b)
Determines whether two matricies are equal.
a
- The first matrix to compare.b
- The second matrix to compare.
public boolean equals(java.lang.Object obj)
Determines whether the specified System.Object
is equal to this instance.
equals
in class java.lang.Object
obj
- The System.Object
to compare with this instance.
true
if the specified System.Object
is equal to this instance; otherwise, false
.
System.NullReferenceException
- The obj
parameter is null.public float[] getElements_Rename_Namesake()
Gets an array of floating-point values that represents the elements of this Matrix
.
Matrix
.
public float[] getElements()
Gets the copy of matrix elements.
public float getM11()
Gets the matrix element at first row first column. Represents scale along X axis.
public float getM12()
Gets the matrix element at first row second column. Represents shear along Y axis.
public float getM21()
Gets the matrix element at second row first column. Represents shear along X axis.
public float getM22()
Gets the matrix element at second row second column. Represents scale along Y axis.
public float getM31()
Gets the matrix element at third row first column. Represents translation along X axis.
public float getM32()
Gets the matrix element at third row first column. Represents translation along Y axis.
public int hashCode()
Returns a hash code for this instance.
hashCode
in class java.lang.Object
public void multiply(Matrix Tx)
Multiplies this Matrix by the matrix specified in the matrix parameter using (default) Prepend order.
Tx
- The tx.public void multiply(Matrix Tx, int order)
Multiplies this Matrix by the matrix specified in the matrix parameter, and in the order specified in the order parameter.
Tx
- The tx. The tx. The tx.order
- The order. The order. The order.public static boolean op_Equality(Matrix matrix1, Matrix matrix2)
Implements the operator ==.
matrix1
- The first matrix to compare.matrix2
- The second matrix to compare.
public static boolean op_Inequality(Matrix matrix1, Matrix matrix2)
Implements the operator !=.
matrix1
- The first matrix to compare.matrix2
- The second matrix to compare.
public void reset()
Resets this Matrix to have the elements of the identity matrix.
public void rotate(float angle)
Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix in the default (Prepend) order.
angle
- The rotate angle.public void rotate(float angle, int order)
Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix in the specified order.
angle
- The rotate angle.order
- The matrix order.public void rotateAt(float angle, PointF point)
Applies a clockwise rotation about the specified point to this Matrix in the default (Prepend) order.
angle
- The angle.point
- The point.public void rotateAt(float angle, PointF point, int order)
Applies a clockwise rotation about the specified point to this Matrix in the specified order.
angle
- The angle.point
- The point.order
- The order.public void scale(float sx, float sy)
Applies the specified scale vector (scaleX and scaleY) to this Matrix using (default) Prepend order.
sx
- The sx. The sx. The sx.sy
- The sy. The sy. The sy.public void scale(float scaleX, float scaleY, int order)
Applies the specified scale vector (scaleX and scaleY) to this Matrix
using the specified order.
scaleX
- The scale X.scaleY
- The scale Y.order
- The order.public java.lang.String toString()
Returns a System.String
that represents this instance.
toString
in class java.lang.Object
System.String
that represents this instance.public void transformPoints(PointF[] points)
Applies the geometric transform represented by this Matrix
to a specified array of points.
points
- The points.public void translate(float tx, float ty)
Applies the specified translation vector to this Matrix
using (default) Prepend order.
tx
- The tx. The tx. The tx.ty
- The ty. The ty. The ty.public void translate(float offsetX, float offsetY, int order)
Applies the specified translation vector to this Matrix in the specified order.
offsetX
- The offset X.offsetY
- The offset Y.order
- The order.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |