Struct nanovg::Transform [] [src]

pub struct Transform {
    pub matrix: [f32; 6],
    // some fields omitted
}

Represents a transformation in 2D space. A transformation is a column-major matrix in the following form: [a c e] - indices [0 2 4] [b d f] - indices [1 3 5] [0 0 1] - not passed. The last row however is not specified; it is always [0 0 1] behind the scenes.

Fields

Methods

impl Transform
[src]

[src]

Construct a new transform with an identity matrix.

[src]

Set flag on this transform to use it in absolute coordinate space.

[src]

Set flag on this transform to use it in local (relative) coordinate space.

[src]

Set the translation of the transform.

[src]

Set the scale of the transform.

[src]

Set the skew of the transform.

[src]

Set the rotation of the transform.

[src]

Translate transform by x and y.

[src]

Rotate transform with spcified angle.

[src]

Skew transform along x axis with specified angle.

[src]

Skew transform along y axis with specified angle.

[src]

Scale transform along x and y.

[src]

Transforms a point with this transform. Returns transformed point (x, y).

[src]

Inverses this transform. Returns inversed copy or None if inversion fails.

Trait Implementations

impl Clone for Transform
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Transform
[src]

impl Debug for Transform
[src]

[src]

Formats the value using the given formatter. Read more

impl Mul for Transform
[src]

Implementation of multiplication Trait for Transform. The order in which you multiplicate matters (you are multiplicating matrices)

The resulting type after applying the * operator.

[src]

Multiplies transform with other transform (the order matters).

Auto Trait Implementations

impl Send for Transform

impl Sync for Transform