Package icyllis.modernui.graphics

# 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.

- ## Field Summary

  ### Fields inherited from class icyllis.arc3d.core.Matrix

  `m11, m12, m14, m21, m22, m24, m41, m42, m44`

  ### Fields inherited from interface icyllis.arc3d.core.Matrixc

  `kAffine_Mask, kIdentity_Mask, kPerspective_Mask, kScale_Mask, kTranslate_Mask`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Matrix()`
  Create a new identity matrix.
  `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.
  `Matrix(Matrix m)`
  Create a new matrix copied from the given matrix.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `mapPoint(PointF p)`
  Map a point in the X-Y plane.
  `void`
  `mapRect(float left, float top, float right, float bottom, Rect out)`
  Map a rectangle points in the X-Y plane to get the maximum bounds.
  `void`
  `mapRect(RectF r)`
  Map a rectangle points in the X-Y plane to get the maximum bounds.
  `void`
  `mapRect(RectF r, Rect out)`
  Map a rectangle points in the X-Y plane to get the maximum bounds.
  `void`
  `mapRect(Rect r, Rect out)`
  Map a rectangle points in the X-Y plane to get the maximum bounds.
  `void`
  `mapRectOut(float left, float top, float right, float bottom, Rect out)`
  Map a rectangle points in the X-Y plane to get the maximum bounds.
  `void`
  `mapRectOut(RectF r, Rect out)`
  Map a rectangle points in the X-Y plane to get the maximum bounds.
  `void`
  `mapRectOut(Rect r, Rect out)`
  Map a rectangle points in the X-Y plane to get the maximum bounds.
  `void`
  `set(Matrix m)`
  Copy the given matrix into this matrix.

  ### Methods inherited from class icyllis.arc3d.core.Matrix

  `clone, determinant, differentialAreaScale, equals, equals, getMaxScale, getMaxScale, getMinScale, getMinScale, getPerspX, getPerspY, getScaleX, getScaleY, getShearX, getShearY, getTranslateX, getTranslateY, getType, hashCode, hasPerspective, identity, invert, invert, isApproxEqual, isAxisAligned, isFinite, isIdentity, isScaleTranslate, isSimilarity, isTranslate, localAARadius, localAARadius, m11, m11, m12, m12, m14, m14, m21, m21, m22, m22, m24, m24, m41, m41, m42, m42, m44, m44, makeScale, makeTranslate, mapPoints, mapRect, mapRect, mapRectOut, normalizePerspective, postConcat, postRotate, postScale, postShear, postTranslate, preConcat, preRotate, preScale, preservesRightAngles, preShear, preTranslate, set, set, set, set, set, set, set, setIdentity, setPerspX, setPerspY, setRectToRect, setRotate, setRotate, setScale, setScale, setScaleTranslate, setScaleX, setScaleY, setShear, setShear, setShearX, setShearY, setSinCos, setSinCos, setTranslate, setTranslateX, setTranslateY, store, store, store, store, store, store, storeAligned, storeAligned, storeAligned, toMatrix4, toMatrix4, toString, trace`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface icyllis.arc3d.core.Matrixc

  `mapPoint, mapPoints, mapPoints, mapPoints, mapPoints, mapRect, mapRect, mapRect, mapRect, mapRectOut, mapRectOut, mapRectOut`

- ## 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