ImmutableAffineTransform.Companion



Summary

Public functions

ImmutableAffineTransform

Returns a transformation that rotates degrees in the direction from the positive x-axis towards the positive y-axis.

Cmn
ImmutableAffineTransform
scale(scaleFactor: Float)

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

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

Cmn
ImmutableAffineTransform
scaleX(scaleFactor: Float)

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

Cmn
ImmutableAffineTransform
scaleY(scaleFactor: Float)

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

Cmn
ImmutableAffineTransform
skewX(sx: Float)

Returns a transformation that skews in the x-direction by the given factor.

Cmn
ImmutableAffineTransform
skewY(sy: Float)

Returns a transformation that skews in the y-direction by the given factor.

Cmn
ImmutableAffineTransform
translate(offset: Vec)

Returns a transformation that translates by the given offset vector.

Cmn
ImmutableAffineTransform
translate(x: Float, y: Float)

Returns a transformation that translates by the given x and y components.

Cmn

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

rotateDegrees

fun rotateDegrees(degrees: @AngleDegreesFloat Float): ImmutableAffineTransform

Returns a transformation that rotates degrees in the direction from the positive x-axis towards the positive y-axis.

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.

skewX

fun skewX(sx: Float): ImmutableAffineTransform

Returns a transformation that skews in the x-direction by the given factor.

skewY

fun skewY(sy: Float): ImmutableAffineTransform

Returns a transformation that skews in the y-direction by the given factor.

translate

fun translate(offset: Vec): ImmutableAffineTransform

Returns a transformation that translates by the given offset vector.

translate

fun translate(x: Float, y: Float): ImmutableAffineTransform

Returns a transformation that translates by the given x and y components.

Extension functions

ImmutableAffineTransform.Companion.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).

ImmutableAffineTransform.Companion.from

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.