[][src]Struct femtovg::Transform2D

pub struct Transform2D(pub [f32; 6]);

2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, or scaling.

Implementations

impl Transform2D[src]

pub fn identity() -> Self[src]

Creates an identity transformation with no translation, rotation or scaling applied.

pub fn new_translation(x: f32, y: f32) -> Self[src]

pub fn translate(&mut self, tx: f32, ty: f32)[src]

pub fn scale(&mut self, sx: f32, sy: f32)[src]

pub fn rotate(&mut self, a: f32)[src]

pub fn skew_x(&mut self, a: f32)[src]

pub fn skew_y(&mut self, a: f32)[src]

pub fn multiply(&mut self, other: &Self)[src]

pub fn premultiply(&mut self, other: &Self)[src]

pub fn inverse(&mut self)[src]

pub fn inversed(&self) -> Self[src]

pub fn transform_point(&self, sx: f32, sy: f32) -> (f32, f32)[src]

pub fn average_scale(&self) -> f32[src]

pub fn to_mat3x4(self) -> [f32; 12][src]

pub fn cache_key(&self) -> u64[src]

Trait Implementations

impl Clone for Transform2D[src]

impl Copy for Transform2D[src]

impl Debug for Transform2D[src]

impl Default for Transform2D[src]

impl Index<usize> for Transform2D[src]

type Output = f32

The returned type after indexing.

impl IndexMut<usize> for Transform2D[src]

impl PartialEq<Transform2D> for Transform2D[src]

impl PartialOrd<Transform2D> for Transform2D[src]

impl StructuralPartialEq for Transform2D[src]

Auto Trait Implementations

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> 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.