ImmutableAffineTransform
-
Cmn
class ImmutableAffineTransform : AffineTransform
An immutable affine transformation in the plane. Individual operations can be constructed with factory methods like translate and rotateDegrees.
See AffineTransform for more general documentation about how these transforms are represented. See MutableAffineTransform for a mutable alternative to this class.
Summary
Nested types |
|---|
Public companion functions |
||
|---|---|---|
ImmutableAffineTransform |
rotateDegrees(degrees: @AngleDegreesFloat Float)Returns a transformation that rotates |
Cmn
|
ImmutableAffineTransform |
Returns a transformation that scales in both the x- and y-direction by the given |
Cmn
|
ImmutableAffineTransform |
Returns a transformation that scales in both the x- and y-direction by the given pair of factors; |
Cmn
|
ImmutableAffineTransform |
Returns a transformation that scales in the x-direction by the given factor, centered about the origin. |
Cmn
|
ImmutableAffineTransform |
Returns a transformation that scales in the y-direction by the given factor, centered about the origin. |
Cmn
|
ImmutableAffineTransform |
Returns a transformation that skews in the x-direction by the given factor. |
Cmn
|
ImmutableAffineTransform |
Returns a transformation that skews in the y-direction by the given factor. |
Cmn
|
ImmutableAffineTransform |
Returns a transformation that translates by the given |
Cmn
|
ImmutableAffineTransform |
Returns a transformation that translates by the given |
Cmn
|
Public constructors |
|
|---|---|
ImmutableAffineTransform(values: @Size(min = 6) FloatArray)Like the primary constructor, but accepts a |
Cmn
|
|
Constructs this transform with 6 float values, starting with the top left corner of the matrix and proceeding in row-major order. |
Cmn
|
Public functions |
||
|---|---|---|
open operator Boolean |
Component-wise equality operator for |
Cmn
|
open Int |
hashCode() |
Cmn
|
open ImmutableAffineTransform |
Returns an immutable equivalent of this object. |
Cmn
|
open String |
toString() |
Cmn
|
Public properties |
||
|---|---|---|
open Float |
Value in the first row, first column of the transform matrix. |
Cmn
|
open Float |
Value in the second row, first column of the transform matrix. |
Cmn
|
open Float |
Value in the first row, second column of the transform matrix. |
Cmn
|
open Float |
Value in the second row, second column of the transform matrix. |
Cmn
|
open Float |
Value in the first row, third column of the transform matrix. |
Cmn
|
open Float |
Value in the second row, third column of the transform matrix. |
Cmn
|
Inherited functions |
||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public companion 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.
Public constructors
ImmutableAffineTransform
ImmutableAffineTransform(values: @Size(min = 6) FloatArray)
Like the primary constructor, but accepts a FloatArray instead of individual Float values.
ImmutableAffineTransform
ImmutableAffineTransform(
m00: Float,
m10: Float,
m20: Float,
m01: Float,
m11: Float,
m21: Float
)
Constructs this transform with 6 float values, starting with the top left corner of the matrix and proceeding in row-major order. Prefer to create this object with functions that apply specific transform operations, such as scale or translate, rather than directly passing in the actual numeric values of this transform. This constructor is useful for when the values are needed to be provided all at once, for example for serialization. To access these values in the same order as they are passed in here, use AffineTransform.getValues. To construct this object using an array as input, there is another public constructor for that.
Public functions
equals
open operator fun equals(other: Any?): Boolean
Component-wise equality operator for ImmutableAffineTransform.
Due to the propagation floating point precision errors, operations that may be equivalent over the real numbers are not always equivalent for floats, and might return false for equals in some cases.
toImmutable
open fun toImmutable(): ImmutableAffineTransform
Returns an immutable equivalent of this object. This will return itself if called on an immutable instance.