pub struct Matrix2D<T> { /* private fields */ }Implementations§
source§impl<T: Add<T, Output = T> + Copy + Clone + Mul<T, Output = T> + One + PartialOrd + Sub<T, Output = T> + Zero> Matrix2D<T>
impl<T: Add<T, Output = T> + Copy + Clone + Mul<T, Output = T> + One + PartialOrd + Sub<T, Output = T> + Zero> Matrix2D<T>
pub fn new(m11: T, m12: T, m21: T, m22: T, m31: T, m32: T) -> Matrix2D<T>
pub fn mul(&self, m: &Matrix2D<T>) -> Matrix2D<T>
pub fn translate(&self, x: T, y: T) -> Matrix2D<T>
pub fn scale(&self, x: T, y: T) -> Matrix2D<T>
pub fn identity() -> Matrix2D<T>
pub fn to_array(&self) -> [T; 6]
sourcepub fn transform_point(&self, point: &Point2D<T>) -> Point2D<T>
pub fn transform_point(&self, point: &Point2D<T>) -> Point2D<T>
Returns the given point transformed by this matrix.
sourcepub fn transform_rect(&self, rect: &Rect<T>) -> Rect<T>
pub fn transform_rect(&self, rect: &Rect<T>) -> Rect<T>
Returns a rectangle that encompasses the result of transforming the given rectangle by this matrix.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Matrix2D<T>where
T: Freeze,
impl<T> RefUnwindSafe for Matrix2D<T>where
T: RefUnwindSafe,
impl<T> Send for Matrix2D<T>where
T: Send,
impl<T> Sync for Matrix2D<T>where
T: Sync,
impl<T> Unpin for Matrix2D<T>where
T: Unpin,
impl<T> UnwindSafe for Matrix2D<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)