Matrix
open class Matrix
| kotlin.Any | |
| ↳ | android.graphics.Matrix |
The Matrix class holds a 3x3 matrix for transforming coordinates.
Summary
| Nested classes | |
|---|---|
|
Controls how the src rect should align into the dst rect for setRectToRect(). |
|
| Constants | |
|---|---|
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| Public constructors | |
|---|---|
Matrix()Create an identity matrix |
|
|
Create a matrix that is a (deep) copy of src |
|
| Public methods | |
|---|---|
| Unit |
dump(pw: PrintWriter)Dumps a human-readable shortened string of the matrix into the given stream |
| open Boolean |
Returns true iff obj is a Matrix and its values equal our values. |
| open Unit |
getValues(values: FloatArray!)Copy 9 values from the matrix into the array. |
| open Int |
hashCode()Returns a hash code value for the object. |
| open Boolean |
If this matrix can be inverted, return true and if inverse is not null, set inverse to be the inverse of this matrix. |
| open Boolean |
isAffine()Gets whether this matrix is affine. |
| open Boolean |
Returns true if the matrix is identity. |
| open Unit |
mapPoints(pts: FloatArray!)Apply this matrix to the array of 2D points, and write the transformed points back into the array |
| open Unit |
mapPoints(dst: FloatArray!, src: FloatArray!)Apply this matrix to the array of 2D points specified by src, and write the transformed points into the array of points specified by dst. |
| open Unit |
mapPoints(dst: FloatArray!, dstIndex: Int, src: FloatArray!, srcIndex: Int, pointCount: Int)Apply this matrix to the array of 2D points specified by src, and write the transformed points into the array of points specified by dst. |
| open Float |
Return the mean radius of a circle after it has been mapped by this matrix. |
| open Boolean |
Apply this matrix to the rectangle, and write the transformed rectangle back into it. |
| open Boolean |
Apply this matrix to the src rectangle, and write the transformed rectangle into dst. |
| open Unit |
mapVectors(vecs: FloatArray!)Apply this matrix to the array of 2D vectors, and write the transformed vectors back into the array. |
| open Unit |
mapVectors(dst: FloatArray!, src: FloatArray!)Apply this matrix to the array of 2D vectors specified by src, and write the transformed vectors into the array of vectors specified by dst. |
| open Unit |
mapVectors(dst: FloatArray!, dstIndex: Int, src: FloatArray!, srcIndex: Int, vectorCount: Int)Apply this matrix to the array of 2D vectors specified by src, and write the transformed vectors into the array of vectors specified by dst. |
| open Boolean |
postConcat(other: Matrix!)Postconcats the matrix with the specified matrix. |
| open Boolean |
postRotate(degrees: Float)Postconcats the matrix with the specified rotation. |
| open Boolean |
postRotate(degrees: Float, px: Float, py: Float)Postconcats the matrix with the specified rotation. |
| open Boolean |
Postconcats the matrix with the specified scale. |
| open Boolean |
Postconcats the matrix with the specified scale. |
| open Boolean |
Postconcats the matrix with the specified skew. |
| open Boolean |
Postconcats the matrix with the specified skew. |
| open Boolean |
postTranslate(dx: Float, dy: Float)Postconcats the matrix with the specified translation. |
| open Boolean |
Preconcats the matrix with the specified matrix. |
| open Boolean |
Preconcats the matrix with the specified rotation. |
| open Boolean |
Preconcats the matrix with the specified rotation. |
| open Boolean |
Preconcats the matrix with the specified scale. |
| open Boolean |
Preconcats the matrix with the specified scale. |
| open Boolean |
Preconcats the matrix with the specified skew. |
| open Boolean |
Preconcats the matrix with the specified skew. |
| open Boolean |
preTranslate(dx: Float, dy: Float)Preconcats the matrix with the specified translation. |
| open Boolean |
Returns true if will map a rectangle to another rectangle. |
| open Unit |
reset()Set the matrix to identity |
| open Unit |
(deep) copy the src matrix into this matrix. |
| open Boolean |
Set the matrix to the concatenation of the two specified matrices and return true. |
| open Boolean |
setPolyToPoly(src: FloatArray!, srcIndex: Int, dst: FloatArray!, dstIndex: Int, pointCount: Int)Set the matrix such that the specified src points would map to the specified dst points. |
| open Boolean |
setRectToRect(src: RectF!, dst: RectF!, stf: Matrix.ScaleToFit!)Set the matrix to the scale and translate values that map the source rectangle to the destination rectangle, returning true if the result can be represented. |
| open Unit |
Set the matrix to rotate about (0,0) by the specified number of degrees. |
| open Unit |
Set the matrix to rotate by the specified number of degrees, with a pivot point at (px, py). |
| open Unit |
Set the matrix to scale by sx and sy. |
| open Unit |
Set the matrix to scale by sx and sy, with a pivot point at (px, py). |
| open Unit |
Set the matrix to rotate by the specified sine and cosine values. |
| open Unit |
Set the matrix to rotate by the specified sine and cosine values, with a pivot point at (px, py). |
| open Unit |
Set the matrix to skew by sx and sy. |
| open Unit |
Set the matrix to skew by sx and sy, with a pivot point at (px, py). |
| open Unit |
setTranslate(dx: Float, dy: Float)Set the matrix to translate by (dx, dy). |
| open Unit |
setValues(values: FloatArray!)Copy 9 values from the array into the matrix. |
| open String! | |
| open String |
toString()Returns a string representation of the object. |
| Properties | |
|---|---|
| static Matrix |
The identity matrix. |
Constants
Public constructors
Matrix
Matrix(src: Matrix!)
Create a matrix that is a (deep) copy of src
| Parameters | |
|---|---|
src |
Matrix!: The matrix to copy into this matrix |
Public methods
dump
fun dump(pw: PrintWriter): Unit
Dumps a human-readable shortened string of the matrix into the given stream
| Parameters | |
|---|---|
pw |
PrintWriter: The PrintWriter into which the string representation of the matrix will be written. This value cannot be null. |
equals
open fun equals(other: Any?): Boolean
Returns true iff obj is a Matrix and its values equal our values.
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getValues
open fun getValues(values: FloatArray!): Unit
Copy 9 values from the matrix into the array.
hashCode
open fun hashCode(): Int
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.
The gen