Struct freya_engine::prelude::Matrix

#[repr(C)]
pub struct Matrix { /* private fields */ }

Implementations§

§

impl Matrix

pub fn new_scale(scale: (f32, f32)) -> Matrix

👎Deprecated since 0.33.0: use Matrix::scale()

pub fn scale(_: (f32, f32)) -> Matrix

pub fn new_trans(d: impl Into<Point>) -> Matrix

👎Deprecated since 0.33.0: use Matrix::translate()

pub fn translate(d: impl Into<Point>) -> Matrix

pub fn rotate_deg(deg: f32) -> Matrix

pub fn rotate_deg_pivot(deg: f32, pivot: impl Into<Point>) -> Matrix

pub fn rotate_rad(rad: f32) -> Matrix

pub fn skew(_: (f32, f32)) -> Matrix

pub fn rect_to_rect( src: impl AsRef<Rect>, dst: impl AsRef<Rect>, scale_to_fit: impl Into<Option<SkMatrix_ScaleToFit>>, ) -> Option<Matrix>

pub fn new_all( scale_x: f32, skew_x: f32, trans_x: f32, skew_y: f32, scale_y: f32, trans_y: f32, pers_0: f32, pers_1: f32, pers_2: f32, ) -> Matrix

pub fn get_type(&self) -> TypeMask

pub fn is_identity(&self) -> bool

pub fn is_scale_translate(&self) -> bool

pub fn is_translate(&self) -> bool

pub fn rect_stays_rect(&self) -> bool

pub fn preserves_axis_alignment(&self) -> bool

pub fn has_perspective(&self) -> bool

pub fn is_similarity(&self) -> bool

pub fn preserves_right_angles(&self) -> bool

pub fn rc(&self, r: usize, c: usize) -> f32

pub fn scale_x(&self) -> f32

pub fn scale_y(&self) -> f32

pub fn skew_y(&self) -> f32

pub fn skew_x(&self) -> f32

pub fn translate_x(&self) -> f32

pub fn translate_y(&self) -> f32

pub fn persp_x(&self) -> f32

pub fn persp_y(&self) -> f32

pub fn set_scale_x(&mut self, v: f32) -> &mut Matrix

pub fn set_scale_y(&mut self, v: f32) -> &mut Matrix

pub fn set_skew_y(&mut self, v: f32) -> &mut Matrix

pub fn set_skew_x(&mut self, v: f32) -> &mut Matrix

pub fn set_translate_x(&mut self, v: f32) -> &mut Matrix

pub fn set_translate_y(&mut self, v: f32) -> &mut Matrix

pub fn set_persp_x(&mut self, v: f32) -> &mut Matrix

pub fn set_persp_y(&mut self, v: f32) -> &mut Matrix

pub fn set_all( &mut self, scale_x: f32, skew_x: f32, trans_x: f32, skew_y: f32, scale_y: f32, trans_y: f32, persp_0: f32, persp_1: f32, persp_2: f32, ) -> &mut Matrix

pub fn get_9(&self, buffer: &mut [f32; 9])

pub fn set_9(&mut self, buffer: &[f32; 9]) -> &mut Matrix

pub fn reset(&mut self) -> &mut Matrix

pub fn set_identity(&mut self) -> &mut Matrix

pub fn set_translate(&mut self, v: impl Into<Point>) -> &mut Matrix

pub fn set_scale( &mut self, _: (f32, f32), pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn set_rotate( &mut self, degrees: f32, pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn set_sin_cos( &mut self, _: (f32, f32), pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn set_rsxform(&mut self, rsxform: &RSXform) -> &mut Matrix

pub fn set_skew( &mut self, _: (f32, f32), pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn set_concat(&mut self, a: &Matrix, b: &Matrix) -> &mut Matrix

pub fn pre_translate(&mut self, delta: impl Into<Point>) -> &mut Matrix

pub fn pre_scale( &mut self, _: (f32, f32), pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn pre_rotate( &mut self, degrees: f32, pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn pre_skew( &mut self, _: (f32, f32), pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn pre_concat(&mut self, other: &Matrix) -> &mut Matrix

pub fn post_translate(&mut self, delta: impl Into<Point>) -> &mut Matrix

pub fn post_scale( &mut self, _: (f32, f32), pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn post_idiv(&mut self, _: (i32, i32)) -> bool

👎Deprecated since 0.27.0: use post_scale((1.0 / x as scalar, 1.0 / y as scalar), None)

pub fn post_rotate( &mut self, degrees: f32, pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn post_skew( &mut self, _: (f32, f32), pivot: impl Into<Option<Point>>, ) -> &mut Matrix

pub fn post_concat(&mut self, other: &Matrix) -> &mut Matrix

pub fn set_rect_to_rect( &mut self, src: impl AsRef<Rect>, dst: impl AsRef<Rect>, stf: SkMatrix_ScaleToFit, ) -> bool

pub fn from_rect_to_rect( src: impl AsRef<Rect>, dst: impl AsRef<Rect>, stf: SkMatrix_ScaleToFit, ) -> Option<Matrix>

pub fn set_poly_to_poly(&mut self, src: &[Point], dst: &[Point]) -> bool

pub fn from_poly_to_poly(src: &[Point], dst: &[Point]) -> Option<Matrix>

pub fn invert(&self) -> Option<Matrix>

pub fn set_affine_identity(affine: &mut [f32; 6])

pub fn to_affine(self) -> Option<[f32; 6]>

pub fn set_affine(&mut self, affine: &[f32; 6]) -> &mut Matrix

pub fn from_affine(affine: &[f32; 6]) -> Matrix

pub fn normalize_perspective(&mut self)

pub fn map_points(&self, dst: &mut [Point], src: &[Point])

pub fn map_points_inplace(&self, pts: &mut [Point])

pub fn map_homogeneous_points(&self, dst: &mut [Point3], src: &[Point3])

pub fn map_homogeneous_points_2d(&self, dst: &mut [Point3], src: &[Point])

pub fn map_point(&self, point: impl Into<Point>) -> Point

pub fn map_xy(&self, x: f32, y: f32) -> Point

pub fn map_origin(&self) -> Point

pub fn map_vectors(&self, dst: &mut [Point], src: &[Point])

pub fn map_vectors_inplace(&self, vecs: &mut [Point])

pub fn map_vector(&self, vec: impl Into<Point>) -> Point

pub fn map_rect(&self, rect: impl AsRef<Rect>) -> (Rect, bool)

pub fn map_rect_with_perspective_clip( &self, rect: impl AsRef<Rect>, perspective_clip: SkApplyPerspectiveClip, ) -> (Rect, bool)

pub fn map_rect_to_quad(&self, rect: impl AsRef<Rect>) -> [Point; 4]

pub fn map_rect_scale_translate(&self, src: impl AsRef<Rect>) -> Option<Rect>

pub fn map_radius(&self, radius: f32) -> Option<f32>

pub fn is_fixed_step_in_x(&self) -> !

👎Deprecated since 0.27.0: removed without replacement

pub fn fixed_step_in_x(&self, _y: f32) -> !

👎Deprecated since 0.27.0: removed without replacement

pub fn cheap_equal_to(&self, _other: &Matrix) -> !

👎Deprecated since 0.27.0: removed without replacement

pub fn dump(&self)

pub fn min_scale(&self) -> f32

pub fn max_scale(&self) -> f32

pub fn min_max_scales(&self) -> (f32, f32)

pub fn decompose_scale(&self, remaining: Option<&mut Matrix>) -> Option<Size>

pub fn i() -> &'static Matrix

pub fn invalid_matrix() -> &'static Matrix

pub fn concat(a: &Matrix, b: &Matrix) -> Matrix

pub fn dirty_matrix_type_cache(&mut self)

pub fn set_scale_translate( &mut self, _: (f32, f32), t: impl Into<Point>, ) -> &mut Matrix

pub fn is_finite(&self) -> bool

pub const fn new_identity() -> Matrix

Trait Implementations§

§

impl Clone for Matrix

§

fn clone(&self) -> Matrix

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
§

impl Debug for Matrix

§

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

Formats the value using the given formatter. Read more
§

impl Default for Matrix

§

fn default() -> Matrix

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

impl From<&Matrix> for M44

§

fn from(src: &Matrix) -> M44

Converts to this type from the input type.
§

impl From<Matrix> for M44

§

fn from(m: Matrix) -> M44

Converts to this type from the input type.
§

impl Index<AffineMember> for Matrix

§

type Output = f32

The returned type after indexing.
§

fn index(&self, index: AffineMember) -> &<Matrix as Index<AffineMember>>::Output

Performs the indexing (container[index]) operation. Read more
§

impl Index<Member> for Matrix

§

type Output = f32

The returned type after indexing.
§

fn index(&self, index: Member) -> &<Matrix as Index<Member>>::Output

Performs the indexing (container[index]) operation. Read more
§

impl Index<usize> for Matrix

§

type Output = f32

The returned type after indexing.
§

fn index(&self, index: usize) -> &<Matrix as Index<usize>>::Output

Performs the indexing (container[index]) operation. Read more
§

impl IndexMut<AffineMember> for Matrix

§

fn index_mut( &mut self, index: AffineMember, ) -> &mut <Matrix as Index<AffineMember>>::Output

Performs the mutable indexing (container[index]) operation. Read more
§

impl IndexMut<Member> for Matrix

§

fn index_mut(&mut self, index: Member) -> &mut <Matrix as Index<Member>>::Output

Performs the mutable indexing (container[index]) operation. Read more
§

impl IndexMut<usize> for Matrix

§

fn index_mut(&mut self, index: usize) -> &mut <Matrix as Index<usize>>::Output

Performs the mutable indexing (container[index]) operation. Read more
§

impl Mul for Matrix

§

type Output = Matrix

The resulting type after applying the * operator.
§

fn mul(self, rhs: Matrix) -> <Matrix as Mul>::Output

Performs the * operation. Read more
§

impl PartialEq for Matrix

§

fn eq(&self, rhs: &Matrix) -> bool

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

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

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

impl Copy for Matrix

Auto Trait Implementations§

§

impl Freeze for Matrix

§

impl RefUnwindSafe for Matrix

§

impl Send for Matrix

§

impl Sync for Matrix

§

impl Unpin for Matrix

§

impl UnwindSafe for Matrix

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

§

impl<N, T> NativeTransmutableWrapper<N> for T
where T: NativeTransmutable<N>,

§

fn wrap(native: N) -> T

§

fn unwrap(self) -> N

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

source§

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

§

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

§

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

§

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.