ImmutableAffineTransform.Companion



Summary

Public functions

ImmutableAffineTransform
scale(scaleFactor: Float)

Returns a transformation that scales in both the x- and y-direction by the given scaleFactor, centered about the origin.

android
ImmutableAffineTransform
scale(xScaleFactor: Float, yScaleFactor: Float)

Returns a transformation that scales in both the x- and y-direction by the given pair of factors; xScaleFactor and yScaleFactor respectively, centered about the origin.

android
ImmutableAffineTransform
scaleX(scaleFactor: Float)

Returns a transformation that scales in the x-direction by the given factor, centered about the origin.

android
ImmutableAffineTransform
scaleY(scaleFactor: Float)

Returns a transformation that scales in the y-direction by the given factor, centered about the origin.

android
ImmutableAffineTransform
translate(offset: Vec)

Returns a transformation that translates by the given offset vector.

android

Extension functions

ImmutableAffineTransform?

Constructs an ImmutableAffineTransform with the values from matrix.

android
ImmutableAffineTransform?

Constructs an ImmutableAffineTransform with the values from matrix, if and only if matrix is a 2D affine transform; that is, that the Z row and column in matrix must both be 0, 0, 1, 0.

android

Public functions

scale

fun scale(scaleFactor: Float): ImmutableAffineTransform

Returns a transformation that scales in both the x- and y-direction by the given scaleFactor, centered about the origin.

scale

fun scale(xScaleFactor: Float, yScaleFactor: Float): ImmutableAffineTransform

Returns a transformation that scales in both the x- and y-direction by the given pair of factors; xScaleFactor and yScaleFactor respectively, centered about the origin.

scaleX

fun scaleX(scaleFactor: Float): ImmutableAffineTransform

Returns a transformation that scales in the x-direction by the given factor, centered about the origin.

scaleY

fun scaleY(scaleFactor: Float): ImmutableAffineTransform

Returns a transformation that scales in the y-direction by the given factor, centered about the origin.

translate

fun translate(offset: Vec): ImmutableAffineTransform

Returns a transformation that translates by the given offset vector.

Extension functions

from

fun ImmutableAffineTransform.Companion.from(matrix: Matrix): ImmutableAffineTransform?

Constructs an ImmutableAffineTransform with the values from matrix.

If matrix is not an affine transform, returns null instead.

Performance-sensitive code should use the populateFrom overload that takes a pre-allocated MutableAffineTransform, so that the instance can be reused across multiple calls.

Java callers should prefer AndroidGraphicsConverter.createAffineTransform(Matrix) (createAffineTransform).

fun ImmutableAffineTransform.Companion.from(matrix: Matrix): ImmutableAffineTransform?

Constructs an ImmutableAffineTransform with the values from matrix, if and only if matrix is a 2D affine transform; that is, that the Z row and column in matrix must both be 0, 0, 1, 0. Returns null if matrix is not a 2D affine transform.

Performance-sensitive code should use the populateFrom overload that takes a pre-allocated AffineTransform, so that the instance can be reused across multiple calls.