[−][src]Struct nuuro::renderer::Affine
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,