public final class XpsMatrix extends XpsElement
Class incapsulating MatrixTransform property element features. This element defines an arbitrary affine matrix transformation used to manipulate the coordinate systems of elements.
Modifier and Type | Class and Description |
---|---|
static class |
XpsMatrix.MatrixOrder
Enumeration defining the order of matrix operations.
|
Modifier and Type | Method and Description |
---|---|
XpsMatrix |
deepClone()
Clones this transformation matrix.
|
boolean |
equals(Object obj)
Determines whether the specified
object is equal to this instance. |
static boolean |
equals(XpsMatrix a,
XpsMatrix b)
The actual implementation.
|
float |
getM11()
Gets the M11 element.
|
float |
getM12()
Gets the M12 element.
|
float |
getM21()
Gets the M21 element.
|
float |
getM22()
Gets the M22 element.
|
float |
getM31()
Gets the M31 element.
|
float |
getM32()
Gets the M32 element.
|
int |
hashCode()
Returns a hash code for this instance.
|
boolean |
isIdentity()
Gets a value indicating whether this instance is identity matrix.
|
void |
multiply(XpsMatrix matrix)
Multiplies this matrix by the matrix specified by the
matrix
in default (Prepend) order. |
void |
multiply(XpsMatrix matrix,
XpsMatrix.MatrixOrder matrixOrder)
Multiplies this matrix by the matrix specified by the
matrix
in order specified by matrixOrder . |
static boolean |
op_Equality(XpsMatrix a,
XpsMatrix b)
Implements the operator ==.
|
static boolean |
op_Inequality(XpsMatrix a,
XpsMatrix b)
Implements the operator !
|
void |
reset()
Resets this Matrix to identity matrix.
|
void |
rotate(float angle)
Applies clockwise rotation by
angle to this Matrix in default (Prepend) order. |
void |
rotate(float angle,
XpsMatrix.MatrixOrder matrixOrder)
Applies clockwise rotation by
angle to this Matrix in order
specified by matrixOrder . |
void |
rotateAround(float angle,
Point2D pivot)
Applies clockwise rotation by
angle around the pivot
to this Matrix in default (Prepend) order. |
void |
rotateAround(float angle,
Point2D pivot,
XpsMatrix.MatrixOrder matrixOrder)
Applies clockwise rotation by
angle around the pivot
to this Matrix in order specified by matrixOrder . |
void |
scale(float scaleX,
float scaleY)
Applies the specified scale vector (scaleX and scaleY) to this Matrix in default (Prepend) order.
|
void |
scale(float scaleX,
float scaleY,
XpsMatrix.MatrixOrder matrixOrder)
Applies the specified scale vector (scaleX and scaleY) to this Matrix in order
specified by
matrixOrder . |
void |
skew(double skewX,
double skewY)
Applies specified skew transformation to this Matrix.
|
String |
toString()
Returns the string representation of this
XpsMatrix instance. |
Rectangle2D |
transform(Rectangle2D rect)
Applies the affine transformation represented by this Matrix to a specified rectangle.
|
Point2D |
transformPoint(Point2D point)
Applies the affine transformation represented by this Matrix to a specified point.
|
void |
transformPoints(Point2D[] points)
Applies the affine transformation represented by this Matrix to a specified array of points.
|
void |
transformPoints(Point2D[] points,
int startIndex,
int numberOfPoints)
Applies the affine transformation represented by this Matrix to a specified part of array of points.
|
void |
translate(float offsetX,
float offsetY)
Applies the specified translation vector to this Matrix.
|
void |
translate(float offsetX,
float offsetY,
XpsMatrix.MatrixOrder matrixOrder)
Applies the specified translation vector to this Matrix in order specified by
matrixOrder . |
get, iterator, size
forEach, spliterator
public float getM11()
Gets the M11 element.
public float getM12()
Gets the M12 element.
public float getM21()
Gets the M21 element.
public float getM22()
Gets the M22 element.
public float getM31()
Gets the M31 element.
public float getM32()
Gets the M32 element.
public boolean isIdentity()
Gets a value indicating whether this instance is identity matrix.
Value:True
if this instance is identity matrix; otherwise, false
.public void transformPoints(Point2D[] points, int startIndex, int numberOfPoints)
Applies the affine transformation represented by this Matrix to a specified part of array of points.
points
- The points.startIndex
- The start index.numberOfPoints
- The number of points.public Point2D transformPoint(Point2D point)
Applies the affine transformation represented by this Matrix to a specified point.
point
- The point.public void transformPoints(Point2D[] points)
Applies the affine transformation represented by this Matrix to a specified array of points.
points
- The points.public Rectangle2D transform(Rectangle2D rect)
Applies the affine transformation represented by this Matrix to a specified rectangle.
rect
- The rectangle.public void scale(float scaleX, float scaleY, XpsMatrix.MatrixOrder matrixOrder)
Applies the specified scale vector (scaleX and scaleY) to this Matrix in order
specified by matrixOrder
.
scaleX
- The scale X.scaleY
- The scale Y.matrixOrder
- The order.public void scale(float scaleX, float scaleY)
Applies the specified scale vector (scaleX and scaleY) to this Matrix in default (Prepend) order.
scaleX
- The scale x.scaleY
- The scale y.public void translate(float offsetX, float offsetY, XpsMatrix.MatrixOrder matrixOrder)
Applies the specified translation vector to this Matrix in order specified by matrixOrder
.
offsetX
- The offset X.offsetY
- The offset Y.matrixOrder
- The order.public void translate(float offsetX, float offsetY)
Applies the specified translation vector to this Matrix.
offsetX
- The offset X.offsetY
- The offset Y.public void multiply(XpsMatrix matrix, XpsMatrix.MatrixOrder matrixOrder)
Multiplies this matrix by the matrix specified by the matrix
in order specified by matrixOrder
.
matrix
- The matrix.matrixOrder
- The order.public void multiply(XpsMatrix matrix)
Multiplies this matrix by the matrix specified by the matrix
in default (Prepend) order.
matrix
- The matrix.public void skew(double skewX, double skewY)
Applies specified skew transformation to this Matrix.
skewX
- The skew x.skewY
- The skew y.public void rotate(float angle, XpsMatrix.MatrixOrder matrixOrder)
Applies clockwise rotation by angle
to this Matrix in order
specified by matrixOrder
.
angle
- The angle.matrixOrder
- The order.public void rotate(float angle)
Applies clockwise rotation by angle
to this Matrix in default (Prepend) order.
angle
- The angle.public void rotateAround(float angle, Point2D pivot, XpsMatrix.MatrixOrder matrixOrder)
Applies clockwise rotation by angle
around the pivot
to this Matrix in order specified by matrixOrder
.
angle
- The angle.pivot
- The pivot point.matrixOrder
- The order.public void rotateAround(float angle, Point2D pivot)
Applies clockwise rotation by angle
around the pivot
to this Matrix in default (Prepend) order.
angle
- The angle.pivot
- The pivot point.public void reset()
Resets this Matrix to identity matrix.
public int hashCode()
Returns a hash code for this instance.
public boolean equals(Object obj)
Determines whether the specified object
is equal to this instance.
public static boolean equals(XpsMatrix a, XpsMatrix b)
The actual implementation.
a
- The first matrix.b
- The second matrix.public static boolean op_Equality(XpsMatrix a, XpsMatrix b)
Implements the operator ==.
a
- The first matrix.b
- The second matrix.public static boolean op_Inequality(XpsMatrix a, XpsMatrix b)
Implements the operator !=.
a
- The first matrix.b
- The second matrix.public String toString()
Returns the string representation of this XpsMatrix
instance.
public XpsMatrix deepClone()
Clones this transformation matrix.