pub struct Transform {
    pub sx: f32,
    pub kx: f32,
    pub ky: f32,
    pub sy: f32,
    pub tx: f32,
    pub ty: f32,
}
Expand description

An affine transformation matrix.

Stores scale, skew and transform coordinates and a type of a transform.

Fields

sx: f32kx: f32ky: f32sy: f32tx: f32ty: f32

Implementations

Creates an identity transform.

Creates a new Transform.

We are using column-major-column-vector matrix notation, therefore it’s ky-kx, not kx-ky.

Creates a new translating Transform.

Creates a new scaling Transform.

Creates a new skewing Transform.

Creates a new rotating Transform.

Creates a new rotating Transform at the specified position.

Checks that transform is identity.

The transform type is detected on creation, so this method is essentially free.

Checks that transform is scale-only.

The transform type is detected on creation, so this method is essentially free.

Checks that transform is skew-only.

The transform type is detected on creation, so this method is essentially free.

Checks that transform is translate-only.

The transform type is detected on creation, so this method is essentially free.

Checks that transform contains only scale and translate.

The transform type is detected on creation, so this method is essentially free.

Checks that transform contains a scale part.

The transform type is detected on creation, so this method is essentially free.

Checks that transform contains a skew part.

The transform type is detected on creation, so this method is essentially free.

Checks that transform contains a translate part.

The transform type is detected on creation, so this method is essentially free.

Pre-scales the current transform.

Post-scales the current transform.

Pre-translates the current transform.

Post-translates the current transform.

Pre-concats the current transform.

Post-concats the current transform.

Transforms a slice of points using the current transform.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.