#[repr(C)]pub struct Matrix { /* private fields */ }
Implementations§
Source§impl Matrix
impl Matrix
pub fn new_scale(scale: (scalar, scalar)) -> Self
👎Deprecated since 0.33.0: use Matrix::scale()
pub fn scale((sx, sy): (scalar, scalar)) -> Self
pub fn new_trans(d: impl Into<Vector>) -> Self
👎Deprecated since 0.33.0: use Matrix::translate()
pub fn translate(d: impl Into<Vector>) -> Self
pub fn rotate_deg(deg: scalar) -> Self
pub fn rotate_deg_pivot(deg: scalar, pivot: impl Into<Point>) -> Self
pub fn rotate_rad(rad: scalar) -> Self
pub fn skew((kx, ky): (scalar, scalar)) -> Self
pub fn rect_to_rect( src: impl AsRef<Rect>, dst: impl AsRef<Rect>, scale_to_fit: impl Into<Option<ScaleToFit>>, ) -> Option<Self>
pub fn new_all( scale_x: scalar, skew_x: scalar, trans_x: scalar, skew_y: scalar, scale_y: scalar, trans_y: scalar, pers_0: scalar, pers_1: scalar, pers_2: scalar, ) -> Self
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) -> scalar
pub fn scale_x(&self) -> scalar
pub fn scale_y(&self) -> scalar
pub fn skew_y(&self) -> scalar
pub fn skew_x(&self) -> scalar
pub fn translate_x(&self) -> scalar
pub fn translate_y(&self) -> scalar
pub fn persp_x(&self) -> scalar
pub fn persp_y(&self) -> scalar
pub fn set_scale_x(&mut self, v: scalar) -> &mut Self
pub fn set_scale_y(&mut self, v: scalar) -> &mut Self
pub fn set_skew_y(&mut self, v: scalar) -> &mut Self
pub fn set_skew_x(&mut self, v: scalar) -> &mut Self
pub fn set_translate_x(&mut self, v: scalar) -> &mut Self
pub fn set_translate_y(&mut self, v: scalar) -> &mut Self
pub fn set_persp_x(&mut self, v: scalar) -> &mut Self
pub fn set_persp_y(&mut self, v: scalar) -> &mut Self
pub fn set_all( &mut self, scale_x: scalar, skew_x: scalar, trans_x: scalar, skew_y: scalar, scale_y: scalar, trans_y: scalar, persp_0: scalar, persp_1: scalar, persp_2: scalar, ) -> &mut Self
pub fn get_9(&self, buffer: &mut [scalar; 9])
pub fn set_9(&mut self, buffer: &[scalar; 9]) -> &mut Self
pub fn reset(&mut self) -> &mut Self
pub fn set_identity(&mut self) -> &mut Self
pub fn set_translate(&mut self, v: impl Into<Vector>) -> &mut Self
pub fn set_scale( &mut self, (sx, sy): (scalar, scalar), pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn set_rotate( &mut self, degrees: scalar, pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn set_sin_cos( &mut self, (sin_value, cos_value): (scalar, scalar), pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn set_rsxform(&mut self, rsxform: &RSXform) -> &mut Self
pub fn set_skew( &mut self, (kx, ky): (scalar, scalar), pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn set_concat(&mut self, a: &Self, b: &Self) -> &mut Self
pub fn pre_translate(&mut self, delta: impl Into<Vector>) -> &mut Self
pub fn pre_scale( &mut self, (sx, sy): (scalar, scalar), pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn pre_rotate( &mut self, degrees: scalar, pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn pre_skew( &mut self, (kx, ky): (scalar, scalar), pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn pre_concat(&mut self, other: &Self) -> &mut Self
pub fn post_translate(&mut self, delta: impl Into<Vector>) -> &mut Self
pub fn post_scale( &mut self, (sx, sy): (scalar, scalar), pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn post_idiv(&mut self, (div_x, div_y): (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: scalar, pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn post_skew( &mut self, (kx, ky): (scalar, scalar), pivot: impl Into<Option<Point>>, ) -> &mut Self
pub fn post_concat(&mut self, other: &Matrix) -> &mut Self
pub fn set_rect_to_rect( &mut self, src: impl AsRef<Rect>, dst: impl AsRef<Rect>, stf: ScaleToFit, ) -> bool
pub fn from_rect_to_rect( src: impl AsRef<Rect>, dst: impl AsRef<Rect>, stf: ScaleToFit, ) -> Option<Self>
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 [scalar; 6])
pub fn to_affine(self) -> Option<[scalar; 6]>
pub fn set_affine(&mut self, affine: &[scalar; 6]) -> &mut Self
pub fn from_affine(affine: &[scalar; 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: scalar, y: scalar) -> Point
pub fn map_origin(&self) -> Point
pub fn map_vectors(&self, dst: &mut [Vector], src: &[Vector])
pub fn map_vectors_inplace(&self, vecs: &mut [Vector])
pub fn map_vector(&self, vec: impl Into<Vector>) -> Vector
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: ApplyPerspectiveClip, ) -> (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: scalar) -> Option<scalar>
pub fn is_fixed_step_in_x(&self) -> !
👎Deprecated since 0.27.0: removed without replacement
pub fn fixed_step_in_x(&self, _y: scalar) -> !
👎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) -> scalar
pub fn max_scale(&self) -> scalar
pub fn min_max_scales(&self) -> (scalar, scalar)
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, (sx, sy): (scalar, scalar), t: impl Into<Vector>, ) -> &mut Self
pub fn is_finite(&self) -> bool
pub const fn new_identity() -> Self
Trait Implementations§
Source§impl Index<AffineMember> for Matrix
impl Index<AffineMember> for Matrix
Source§impl IndexMut<AffineMember> for Matrix
impl IndexMut<AffineMember> for Matrix
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