Struct tiny_skia::Transform [−][src]
An affine transformation matrix.
Stores scale, skew and transform coordinates and a type of a transform.
Fields
sx: f32
kx: f32
ky: f32
sy: f32
tx: f32
ty: f32
Implementations
impl Transform
[src]
pub fn identity() -> Self
[src]
Creates an identity transform.
pub fn from_row(sx: f32, ky: f32, kx: f32, sy: f32, tx: f32, ty: f32) -> Self
[src]
Creates a new Transform
.
We are using column-major-column-vector matrix notation, therefore it’s ky-kx, not kx-ky.
pub fn from_translate(tx: f32, ty: f32) -> Self
[src]
Creates a new translating Transform
.
pub fn from_scale(sx: f32, sy: f32) -> Self
[src]
Creates a new scaling Transform
.
pub fn from_skew(kx: f32, ky: f32) -> Self
[src]
Creates a new skewing Transform
.
pub fn from_rotate(angle: f32) -> Self
[src]
Creates a new rotating Transform
.
pub fn from_rotate_at(angle: f32, tx: f32, ty: f32) -> Self
[src]
Creates a new rotating Transform
at the specified position.
pub fn is_identity(&self) -> bool
[src]
Checks that transform is identity.
The transform type is detected on creation, so this method is essentially free.
pub fn is_scale(&self) -> bool
[src]
Checks that transform is scale-only.
The transform type is detected on creation, so this method is essentially free.
pub fn is_skew(&self) -> bool
[src]
Checks that transform is skew-only.
The transform type is detected on creation, so this method is essentially free.
pub fn is_translate(&self) -> bool
[src]
Checks that transform is translate-only.
The transform type is detected on creation, so this method is essentially free.
pub fn is_scale_translate(&self) -> bool
[src]
Checks that transform contains only scale and translate.
The transform type is detected on creation, so this method is essentially free.
pub fn has_scale(&self) -> bool
[src]
Checks that transform contains a scale part.
The transform type is detected on creation, so this method is essentially free.
pub fn has_skew(&self) -> bool
[src]
Checks that transform contains a skew part.
The transform type is detected on creation, so this method is essentially free.
pub fn has_translate(&self) -> bool
[src]
Checks that transform contains a translate part.
The transform type is detected on creation, so this method is essentially free.
#[must_use]pub fn pre_scale(&self, sx: f32, sy: f32) -> Self
[src]
Pre-scales the current transform.
#[must_use]pub fn post_scale(&mut self, sx: f32, sy: f32) -> Self
[src]
Post-scales the current transform.
#[must_use]pub fn pre_translate(&self, tx: f32, ty: f32) -> Self
[src]
Pre-translates the current transform.
#[must_use]pub fn post_translate(&self, tx: f32, ty: f32) -> Self
[src]
Post-translates the current transform.
#[must_use]pub fn pre_concat(&self, other: Self) -> Self
[src]
Pre-concats the current transform.
#[must_use]pub fn post_concat(&self, other: Self) -> Self
[src]
Post-concats the current transform.
Trait Implementations
impl Clone for Transform
[src]
impl Copy for Transform
[src]
impl Debug for Transform
[src]
impl Default for Transform
[src]
impl PartialEq<Transform> for Transform
[src]
impl StructuralPartialEq for Transform
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,