[][src]Struct semeion::math::transform::Transform

pub struct Transform { /* fields omitted */ }

The transformation matrix for 2 dimensions.

Implementations

impl Transform[src]

pub fn identity() -> Self[src]

Constructs the identity matrix.

pub fn zero() -> Self[src]

Constructs a transformation matrix where all the elements are equal to zero.

pub fn translate(translation: impl Into<Vector>) -> Self[src]

Constructs a translation transformation and specifies the displacements in the direction of the x-axis and y-axis.

pub fn translation(&self) -> Vector[src]

Gets the translation vector.

pub fn scale(scale: impl Into<Vector>) -> Self[src]

Constructs a scale transformation that has the specified scale factors and the origin as center point.

pub fn scale_around(
    scale: impl Into<Vector>,
    center: impl Into<Coordinate>
) -> Self
[src]

Constructs a scale transformation that has the specified scale factors and the given center point.

pub fn scaling(&self) -> Vector[src]

Gets the scaling vector.

pub fn rotate(angle: f32) -> Self[src]

Constructs a rotation transformation with the given angle in degrees around the origin.

pub fn rotate_around(angle: f32, center: impl Into<Coordinate>) -> Self[src]

Constructs a rotation transformation with the given angle in degrees and the given center point.

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

Gets the rotation angle in degrees.

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

Gets the transpose of this matrix.

pub fn to_row_matrix4(&self) -> [[f32; 4]; 4][src]

Gets the 4x4 row matrix representation of this transformation matrix.

pub fn to_column_matrix4(&self) -> [[f32; 4]; 4][src]

Gets the 4x4 column matrix representation of this transformation matrix.

Trait Implementations

impl Add<Transform> for Transform[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Transform> for Transform[src]

impl Clone for Transform[src]

impl Copy for Transform[src]

impl Debug for Transform[src]

impl Default for Transform[src]

pub fn default() -> Self[src]

Returns the identity matrix.

impl Deref for Transform[src]

type Target = [[f32; 3]; 3]

The resulting type after dereferencing.

impl DerefMut for Transform[src]

impl From<[[f32; 3]; 3]> for Transform[src]

impl From<Transform> for [[f32; 3]; 3][src]

impl Mul<Point<f32>> for Transform[src]

type Output = Vector

The resulting type after applying the * operator.

impl Mul<Transform> for Transform[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<f32> for Transform[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<Transform> for Transform[src]

impl MulAssign<f32> for Transform[src]

impl PartialEq<Transform> for Transform[src]

impl StructuralPartialEq for Transform[src]

impl Sub<Transform> for Transform[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Transform> for Transform[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.