[−][src]Struct tiny_skia::Transform
An affine transformation matrix.
Stores scale, skew and transform coordinates and a type of a transform.
Guarantees
- All values are finite.
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
) -> Option<Self>
[src]
sx: f32,
ky: f32,
kx: f32,
sy: f32,
tx: f32,
ty: f32
) -> Option<Self>
Creates a new Transform
.
We are using column-major-column-vector matrix notation, therefore it's ky-kx, not kx-ky.
Checks
- All values must be finite.
sx
andsy
must not be zero.
pub fn from_translate(tx: f32, ty: f32) -> Option<Self>
[src]
pub fn from_scale(sx: f32, sy: f32) -> Option<Self>
[src]
pub fn from_skew(kx: f32, ky: f32) -> Option<Self>
[src]
pub fn get_scale(&self) -> (f32, f32)
[src]
Returns scale pair.
pub fn get_skew(&self) -> (f32, f32)
[src]
Returns skew pair.
pub fn get_translate(&self) -> (f32, f32)
[src]
Returns translate pair.
pub fn get_row(&self) -> (f32, f32, f32, f32, f32, f32)
[src]
Returns all values.
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) -> Option<Self>
[src]
Pre-scales the current transform.
#[must_use]pub fn post_scale(&mut self, sx: f32, sy: f32) -> Option<Self>
[src]
Post-scales the current transform.
#[must_use]pub fn pre_translate(&self, tx: f32, ty: f32) -> Option<Self>
[src]
Pre-translates the current transform.
#[must_use]pub fn post_translate(&self, tx: f32, ty: f32) -> Option<Self>
[src]
Post-translates the current transform.
#[must_use]pub fn pre_concat(&self, other: &Self) -> Option<Self>
[src]
Pre-concats the current transform.
#[must_use]pub fn post_concat(&self, other: &Self) -> Option<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]
Auto Trait Implementations
impl RefUnwindSafe for Transform
[src]
impl Send for Transform
[src]
impl Sync for Transform
[src]
impl Unpin for Transform
[src]
impl UnwindSafe for Transform
[src]
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>,