Struct freya_engine::prelude::Matrix
#[repr(C)]pub struct Matrix { /* private fields */ }
Implementations§
§impl Matrix
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 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> 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