Added in API level 11
Deprecated in API level 31

Matrix2f


open class Matrix2f
kotlin.Any
   ↳ android.renderscript.Matrix2f

Class for exposing the native RenderScript rs_matrix2x2 type back to the Android system.

Summary

Public constructors

Creates a new identity 2x2 matrix

Matrix2f(dataArray: FloatArray!)

Creates a new matrix and sets its values from the given parameter

Public methods
open Float
get(x: Int, y: Int)

Returns the value for a given row and column

open FloatArray!

Return a reference to the internal array representing matrix values.

open Unit
load(src: Matrix2f!)

Sets the values of the matrix to those of the parameter

open Unit

Sets the matrix values to identity

open Unit

Sets current values to be the result of multiplying two given matrices

open Unit

Sets current values to be a rotation matrix of given angle

open Unit

Sets current values to be a scale matrix of given dimensions

open Unit

Post-multiplies the current matrix by a given parameter

open Unit
rotate(rot: Float)

Modifies the current matrix by post-multiplying it with a rotation matrix of given angle

open Unit
scale(x: Float, y: Float)

Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions

open Unit
set(x: Int, y: Int, v: Float)

Sets the value for a given row and column

open Unit

Sets the current matrix to its transpose

Public constructors

Matrix2f

Added in API level 11
Matrix2f()

Creates a new identity 2x2 matrix

Matrix2f

Added in API level 11
Matrix2f(dataArray: FloatArray!)

Creates a new matrix and sets its values from the given parameter

Parameters
dataArray FloatArray!: values to set the matrix to, must be 4 floats long

Public methods

get

Added in API level 11
open fun get(
    x: Int,
    y: Int
): Float

Deprecated: Deprecated in Java.

Returns the value for a given row and column

Parameters
x Int: column of the value to return
y Int: row of the value to return
Return
Float value in the yth row and xth column

getArray

Added in API level 11
open fun getArray(): FloatArray!

Deprecated: Deprecated in Java.

Return a reference to the internal array representing matrix values. Modifying this array will also change the matrix

Return
FloatArray! internal array representing the matrix

load

Added in API level 11
open fun load(src: Matrix2f!): Unit

Deprecated: Deprecated in Java.

Sets the values of the matrix to those of the parameter

Parameters
src Matrix2f!: matrix to load the values from

loadIdentity

Added in API level 11
open fun loadIdentity(): Unit

Deprecated: Deprecated in Java.

Sets the matrix values to identity

loadMultiply

Added in API level 11
open fun loadMultiply(
    lhs: Matrix2f!,
    rhs: Matrix2f!
): Unit

Deprecated: Deprecated in Java.

Sets current values to be the result of multiplying two given matrices

Parameters
lhs Matrix2f!: left hand side matrix
rhs Matrix2f!: right hand side matrix

loadRotate

Added in API level 11
open fun loadRotate(rot: Float): Unit

Deprecated: Deprecated in Java.

Sets current values to be a rotation matrix of given angle

Parameters
rot Float: rotation angle

loadScale

Added in API level 11
open fun loadScale(
    x: Float,
    y: Float
): Unit

Deprecated: Deprecated in Java.

Sets current values to be a scale matrix of given dimensions

Parameters
x Float: scale component x
y Float: scale component y

multiply

Added in API level 11
open fun multiply(rhs: Matrix2f!): Unit

Deprecated: Deprecated in Java.

Post-multiplies the current matrix by a given parameter

Parameters
rhs Matrix2f!: right hand side to multiply by

rotate

Added in API level 11
open fun rotate(rot: Float): Unit

Deprecated: Deprecated in Java.

Modifies the current matrix by post-multiplying it with a rotation matrix of given angle

Parameters
rot Float: angle of rotation

scale

Added in API level 11
open fun scale(
    x: Float,
    y: Float
): Unit

Deprecated: Deprecated in Java.

Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions

Parameters
x Float: scale component x
y Float: scale component y

set

Added in API level 11
open fun set(
    x: Int,
    y: Int,
    v: Float
): Unit

Deprecated: Deprecated in Java.

Sets the value for a given row and column

Parameters
x Int: column of the value to set
y Int: row of the value to set

transpose

Added in API level 11
open fun transpose(): Unit

Deprecated: Deprecated in Java.

Sets the current matrix to its transpose