Class Matrix

java.lang.Object
icyllis.arc3d.core.Matrix
icyllis.modernui.graphics.Matrix
All Implemented Interfaces:
Matrixc, Cloneable

public class Matrix extends Matrix
This class represents a 3x3 matrix and a 2D transformation, its components correspond to x, y, and w of a 4x4 matrix, where z is discarded.
  • Constructor Details

    • Matrix

      public Matrix()
      Create a new identity matrix.
    • Matrix

      public Matrix(@Nullable Matrix m)
      Create a new matrix copied from the given matrix.
    • Matrix

      public Matrix(float scaleX, float shearY, float persp0, float shearX, float scaleY, float persp1, float transX, float transY, float persp2)
      Create a new matrix from the given elements. The order matches GLSL's column major.
      Parameters:
      scaleX - the value of m11
      shearY - the value of m12
      persp0 - the value of m14
      shearX - the value of m21
      scaleY - the value of m22
      persp1 - the value of m24
      transX - the value of m41
      transY - the value of m42
      persp2 - the value of m44
  • Method Details

    • set

      public void set(@Nullable Matrix m)
      Copy the given matrix into this matrix. If m is null, reset this matrix to the identity matrix.
    • mapRect

      public void mapRect(@NonNull RectF r)
      Map a rectangle points in the X-Y plane to get the maximum bounds.
      Parameters:
      r - the rectangle to transform
    • mapRect

      public void mapRect(@NonNull RectF r, @NonNull Rect out)
      Map a rectangle points in the X-Y plane to get the maximum bounds.
      Parameters:
      out - the round values
    • mapRect

      public void mapRect(@NonNull Rect r, @NonNull Rect out)
      Map a rectangle points in the X-Y plane to get the maximum bounds.
      Parameters:
      out - the round values
    • mapRect

      public void mapRect(float left, float top, float right, float bottom, @NonNull Rect out)
      Map a rectangle points in the X-Y plane to get the maximum bounds.
      Parameters:
      out - the round values
    • mapRectOut

      public void mapRectOut(@NonNull RectF r, @NonNull Rect out)
      Map a rectangle points in the X-Y plane to get the maximum bounds.
      Parameters:
      out - the round out values
    • mapRectOut

      public void mapRectOut(@NonNull Rect r, @NonNull Rect out)
      Map a rectangle points in the X-Y plane to get the maximum bounds.
      Parameters:
      out - the round out values
    • mapRectOut

      public void mapRectOut(float left, float top, float right, float bottom, @NonNull Rect out)
      Map a rectangle points in the X-Y plane to get the maximum bounds.
      Parameters:
      out - the round out values
    • mapPoint

      public void mapPoint(@NonNull PointF p)
      Map a point in the X-Y plane.
      Parameters:
      p - the point to transform