[][src]Struct nuuro::renderer::Affine

pub struct Affine { /* fields omitted */ }

Represents an affine transformation in 2D space.

Methods

impl Affine[src]

pub fn id() -> Affine[src]

Identity transformation.

pub fn translate(x_offset: f64, y_offset: f64) -> Affine[src]

Returns a translation transformation.

pub fn rotate(angle: f64) -> Affine[src]

Returns a rotation transformation, rotating counter-clockwise by angle radians.

pub fn scale_axes(scale_x: f64, scale_y: f64) -> Affine[src]

Returns a scaling transformation, scaling x and y axes separately.

pub fn scale(scale: f64) -> Affine[src]

Returns a scaling transformation, scaling x and y axes identically.

pub fn pre_transform(&self, rhs: &Affine) -> Affine[src]

Returns a transformation that is functionally equivalent to self composed with rhs.

This means that the rhs transformation is invoked first, and then the self transformation is invoked on the output of that. This is usually the desired ordering with graphics transformations.

pub fn pre_scale_axes(&self, scale_x: f64, scale_y: f64) -> Affine[src]

Logically equivalent to self.pre_transform(&Affine::scale_axes(scale_x, scale_y)).

pub fn pre_scale(&self, scale: f64) -> Affine[src]

Logically equivalent to self.pre_transform(&Affine::scale(scale)).

pub fn pre_rotate(&self, angle: f64) -> Affine[src]

Logically equivalent to self.pre_transform(&Affine::rotate(angle)).

pub fn pre_translate(&self, x_offset: f64, y_offset: f64) -> Affine[src]

Logically equivalent to self.pre_transform(&Affine::translate(x_offset, y_offset)).

pub fn post_scale_axes(&self, scale_x: f64, scale_y: f64) -> Affine[src]

Logically equivalent to Affine::scale_axes(scale_x, scale_y).pre_transform(self).

pub fn post_scale(&self, scale: f64) -> Affine[src]

Logically equivalent to Affine::scale(scale).pre_transform(self).

pub fn post_rotate(&self, angle: f64) -> Affine[src]

Logically equivalent to Affine::rotate(angle).pre_transform(self).

pub fn post_translate(&self, x_offset: f64, y_offset: f64) -> Affine[src]

Logically equivalent to Affine::translate(x_offset, y_offset).pre_transform(self).

Trait Implementations

impl Clone for Affine[src]

impl Copy for Affine[src]

Auto Trait Implementations

impl RefUnwindSafe for Affine

impl Send for Affine

impl Sync for Affine

impl Unpin for Affine

impl UnwindSafe for Affine

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.