com.aspose.xps

Class XpsMatrix

  • All Implemented Interfaces:
    Iterable<XpsElement>


    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  XpsMatrix.MatrixOrder
      Enumeration defining the order of matrix operations.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      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.
    • Method Detail

      • getM11

        public float getM11()

        Gets the M11 element.

        Returns:
        The M11 element.
      • getM12

        public float getM12()

        Gets the M12 element.

        Returns:
        The M12 element.
      • getM21

        public float getM21()

        Gets the M21 element.

        Returns:
        The M21 element.
      • getM22

        public float getM22()

        Gets the M22 element.

        Returns:
        The M22 element.
      • getM31

        public float getM31()

        Gets the M31 element.

        Returns:
        The M31 element.
      • getM32

        public float getM32()

        Gets the M32 element.

        Returns:
        The M32 element.
      • isIdentity

        public boolean isIdentity()

        Gets a value indicating whether this instance is identity matrix.

        Value: True if this instance is identity matrix; otherwise, false.
        Returns:
        A value indicating whether this instance is identity matrix.
      • transformPoints

        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.

        Parameters:
        points - The points.
        startIndex - The start index.
        numberOfPoints - The number of points.
      • transformPoint

        public Point2D transformPoint(Point2D point)

        Applies the affine transformation represented by this Matrix to a specified point.

        Parameters:
        point - The point.
        Returns:
        Transformed point
      • transformPoints

        public void transformPoints(Point2D[] points)

        Applies the affine transformation represented by this Matrix to a specified array of points.

        Parameters:
        points - The points.
      • transform

        public Rectangle2D transform(Rectangle2D rect)

        Applies the affine transformation represented by this Matrix to a specified rectangle.

        Parameters:
        rect - The rectangle.
        Returns:
        Transformed rectangle
      • scale

        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.

        Parameters:
        scaleX - The scale X.
        scaleY - The scale Y.
        matrixOrder - The order.
      • scale

        public void scale(float scaleX,
                          float scaleY)

        Applies the specified scale vector (scaleX and scaleY) to this Matrix in default (Prepend) order.

        Parameters:
        scaleX - The scale x.
        scaleY - The scale y.
      • translate

        public void translate(float offsetX,
                              float offsetY,
                              XpsMatrix.MatrixOrder matrixOrder)

        Applies the specified translation vector to this Matrix in order specified by matrixOrder.

        Parameters:
        offsetX - The offset X.
        offsetY - The offset Y.
        matrixOrder - The order.
      • translate

        public void translate(float offsetX,
                              float offsetY)

        Applies the specified translation vector to this Matrix.

        Parameters:
        offsetX - The offset X.
        offsetY - The offset Y.
      • multiply

        public void multiply(XpsMatrix matrix,
                             XpsMatrix.MatrixOrder matrixOrder)

        Multiplies this matrix by the matrix specified by the matrix in order specified by matrixOrder.

        Parameters:
        matrix - The matrix.
        matrixOrder - The order.
      • multiply

        public void multiply(XpsMatrix matrix)

        Multiplies this matrix by the matrix specified by the matrix in default (Prepend) order.

        Parameters:
        matrix - The matrix.
      • skew

        public void skew(double skewX,
                         double skewY)

        Applies specified skew transformation to this Matrix.

        Parameters:
        skewX - The skew x.
        skewY - The skew y.
      • rotate

        public void rotate(float angle,
                           XpsMatrix.MatrixOrder matrixOrder)

        Applies clockwise rotation by angle to this Matrix in order specified by matrixOrder.

        Parameters:
        angle - The angle.
        matrixOrder - The order.
      • rotate

        public void rotate(float angle)

        Applies clockwise rotation by angle to this Matrix in default (Prepend) order.

        Parameters:
        angle - The angle.
      • rotateAround

        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.

        Parameters:
        angle - The angle.
        pivot - The pivot point.
        matrixOrder - The order.
      • rotateAround

        public void rotateAround(float angle,
                                 Point2D pivot)

        Applies clockwise rotation by angle around the pivot to this Matrix in default (Prepend) order.

        Parameters:
        angle - The angle.
        pivot - The pivot point.
      • reset

        public void reset()

        Resets this Matrix to identity matrix.

      • hashCode

        public int hashCode()

        Returns a hash code for this instance.

        Overrides:
        hashCode in class Object
        Returns:
        A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
      • equals

        public boolean equals(Object obj)

        Determines whether the specified object is equal to this instance.

        Overrides:
        equals in class Object
        Parameters:
        obj - The object to compare with this instance.
        Returns:
        true if the specified object is equal to this instance; otherwise, false. The obj parameter is null.
      • equals

        public static boolean equals(XpsMatrix a,
                                     XpsMatrix b)

        The actual implementation.

        Parameters:
        a - The first matrix.
        b - The second matrix.
        Returns:
        [true] if martrices are equals
      • op_Equality

        public static boolean op_Equality(XpsMatrix a,
                                          XpsMatrix b)

        Implements the operator ==.

        Parameters:
        a - The first matrix.
        b - The second matrix.
        Returns:
        The result of the operator.
      • op_Inequality

        public static boolean op_Inequality(XpsMatrix a,
                                            XpsMatrix b)

        Implements the operator !=.

        Parameters:
        a - The first matrix.
        b - The second matrix.
        Returns:
        The result of the operator.
      • toString

        public String toString()

        Returns the string representation of this XpsMatrix instance.

        Overrides:
        toString in class Object
        Returns:
        String representation
      • deepClone

        public XpsMatrix deepClone()

        Clones this transformation matrix.

        Returns:
        Clone of this transformation matrix.