ImmutableAffineTransform.Companion


public static class ImmutableAffineTransform.Companion


Summary

Public methods

static final @NonNull ImmutableAffineTransform
scale(float scaleFactor)

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

static final @NonNull ImmutableAffineTransform
scale(float xScaleFactor, float yScaleFactor)

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.

static final @NonNull ImmutableAffineTransform
scaleX(float scaleFactor)

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

static final @NonNull ImmutableAffineTransform
scaleY(float scaleFactor)

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

static final @NonNull ImmutableAffineTransform

Returns a transformation that translates by the given offset vector.

Extension functions

static final ImmutableAffineTransform

Constructs an ImmutableAffineTransform with the values from matrix.

Public methods

scale

Added in 1.0.0-alpha05
public static final @NonNull ImmutableAffineTransform scale(float scaleFactor)

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

scale

Added in 1.0.0-alpha05
public static final @NonNull ImmutableAffineTransform scale(float xScaleFactor, float yScaleFactor)

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

Added in 1.0.0-alpha05
public static final @NonNull ImmutableAffineTransform scaleX(float scaleFactor)

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

scaleY

Added in 1.0.0-alpha05
public static final @NonNull ImmutableAffineTransform scaleY(float scaleFactor)

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

translate

Added in 1.0.0-alpha05
public static final @NonNull ImmutableAffineTransform translate(@NonNull Vec offset)

Returns a transformation that translates by the given offset vector.

Extension functions

AndroidGraphicsConverter.from

public static final ImmutableAffineTransform AndroidGraphicsConverter.from(
    @NonNull ImmutableAffineTransform.Companion receiver,
    @NonNull Matrix matrix
)

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