Struct raqote::draw_target::fk::Transform2F

source ·
pub struct Transform2F {
    pub matrix: Matrix2x2F,
    pub vector: Vector2F,
}
Expand description

An affine transform, optimized with SIMD.

Fields§

§matrix: Matrix2x2F§vector: Vector2F

Implementations§

source§

impl Transform2F

source

pub fn from_scale<S>(scale: S) -> Transform2F
where S: IntoVector2F,

source

pub fn from_rotation(theta: f32) -> Transform2F

source

pub fn from_rotation_vector(vector: UnitVector) -> Transform2F

source

pub fn from_translation(vector: Vector2F) -> Transform2F

source

pub fn from_scale_rotation_translation<S>( scale: S, theta: f32, translation: Vector2F, ) -> Transform2F
where S: IntoVector2F,

source

pub fn row_major( m11: f32, m12: f32, m21: f32, m22: f32, m31: f32, m32: f32, ) -> Transform2F

source

pub fn to_3d(&self) -> Transform4F

source

pub fn is_identity(&self) -> bool

source

pub fn extract_scale(&self) -> Vector2F

Extracts the scale from this matrix.

source

pub fn m11(&self) -> f32

source

pub fn m21(&self) -> f32

source

pub fn m12(&self) -> f32

source

pub fn m22(&self) -> f32

source

pub fn m31(&self) -> f32

source

pub fn m32(&self) -> f32

source

pub fn translate(&self, vector: Vector2F) -> Transform2F

source

pub fn rotate(&self, theta: f32) -> Transform2F

source

pub fn scale<S>(&self, scale: S) -> Transform2F
where S: IntoVector2F,

source

pub fn translation(&self) -> Vector2F

Returns the translation part of this matrix.

This decomposition assumes that scale, rotation, and translation are applied in that order.

source

pub fn rotation(&self) -> f32

Returns the rotation angle of this matrix.

This decomposition assumes that scale, rotation, and translation are applied in that order.

source

pub fn scale_factor(&self) -> f32

Returns the scale factor of this matrix.

This decomposition assumes that scale, rotation, and translation are applied in that order.

source

pub fn inverse(&self) -> Transform2F

Trait Implementations§

source§

impl Clone for Transform2F

source§

fn clone(&self) -> Transform2F

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Transform2F

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Transform2F

source§

fn default() -> Transform2F

Returns the “default value” for a type. Read more
source§

impl Mul<LineSegment2F> for Transform2F

source§

type Output = LineSegment2F

The resulting type after applying the * operator.
source§

fn mul(self, line_segment: LineSegment2F) -> LineSegment2F

Performs the * operation. Read more
source§

impl Mul<RectF> for Transform2F

source§

type Output = RectF

The resulting type after applying the * operator.
source§

fn mul(self, rect: RectF) -> RectF

Performs the * operation. Read more
source§

impl Mul<Vector2F> for Transform2F

source§

type Output = Vector2F

The resulting type after applying the * operator.
source§

fn mul(self, vector: Vector2F) -> Vector2F

Performs the * operation. Read more
source§

impl Mul for Transform2F

source§

type Output = Transform2F

The resulting type after applying the * operator.
source§

fn mul(self, other: Transform2F) -> Transform2F

Performs the * operation. Read more
source§

impl MulAssign for Transform2F

source§

fn mul_assign(&mut self, other: Transform2F)

Performs the *= operation. Read more
source§

impl PartialEq for Transform2F

source§

fn eq(&self, other: &Transform2F) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Transform2F

source§

impl StructuralPartialEq for Transform2F

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.