#[repr(C)]pub struct CGAffineTransform {
pub a: f64,
pub b: f64,
pub c: f64,
pub d: f64,
pub tx: f64,
pub ty: f64,
}Available on crate feature
cg only.Expand description
Affine transformation matrix.
Fields§
§a: f64§b: f64§c: f64§d: f64§tx: f64§ty: f64Implementations§
Source§impl CGAffineTransform
impl CGAffineTransform
Sourcepub const fn new(a: f64, b: f64, c: f64, d: f64, tx: f64, ty: f64) -> Self
pub const fn new(a: f64, b: f64, c: f64, d: f64, tx: f64, ty: f64) -> Self
Raw constructor; component values match Apple’s
CGAffineTransformMake(a, b, c, d, tx, ty).
Sourcepub fn translation(tx: f64, ty: f64) -> Self
pub fn translation(tx: f64, ty: f64) -> Self
Translation-only transform — wraps CGAffineTransformMakeTranslation.
Sourcepub fn scale(sx: f64, sy: f64) -> Self
pub fn scale(sx: f64, sy: f64) -> Self
Scale-only transform — wraps CGAffineTransformMakeScale.
Sourcepub fn rotation(radians: f64) -> Self
pub fn rotation(radians: f64) -> Self
Rotation-only transform (radians) — wraps CGAffineTransformMakeRotation.
Sourcepub fn concat(self, other: Self) -> Self
pub fn concat(self, other: Self) -> Self
self then other (Apple’s matrix-multiply order). Wraps
CGAffineTransformConcat.
Sourcepub fn invert(self) -> Self
pub fn invert(self) -> Self
Inverse transform. Wraps CGAffineTransformInvert. Returns
the identity if self is non-invertible.
Sourcepub fn is_identity(self) -> bool
pub fn is_identity(self) -> bool
True if this is the identity transform. Wraps
CGAffineTransformIsIdentity.
Trait Implementations§
Source§impl Clone for CGAffineTransform
impl Clone for CGAffineTransform
Source§fn clone(&self) -> CGAffineTransform
fn clone(&self) -> CGAffineTransform
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CGAffineTransform
impl Debug for CGAffineTransform
Source§impl Default for CGAffineTransform
impl Default for CGAffineTransform
Source§impl PartialEq for CGAffineTransform
impl PartialEq for CGAffineTransform
Source§fn eq(&self, other: &CGAffineTransform) -> bool
fn eq(&self, other: &CGAffineTransform) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CGAffineTransform
impl StructuralPartialEq for CGAffineTransform
Auto Trait Implementations§
impl Freeze for CGAffineTransform
impl RefUnwindSafe for CGAffineTransform
impl Send for CGAffineTransform
impl Sync for CGAffineTransform
impl Unpin for CGAffineTransform
impl UnsafeUnpin for CGAffineTransform
impl UnwindSafe for CGAffineTransform
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