[][src]Struct usvg::Transform

pub struct Transform {
    pub a: f64,
    pub b: f64,
    pub c: f64,
    pub d: f64,
    pub e: f64,
    pub f: f64,
}

Representation of the <transform> type.

Fields

a: f64b: f64c: f64d: f64e: f64f: f64

Methods

impl Transform[src]

pub fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Transform[src]

Constructs a new transform.

pub fn new_translate(x: f64, y: f64) -> Transform[src]

Constructs a new translate transform.

pub fn new_scale(sx: f64, sy: f64) -> Transform[src]

Constructs a new scale transform.

pub fn new_rotate(angle: f64) -> Transform[src]

Constructs a new rotate transform.

pub fn new_rotate_at(angle: f64, x: f64, y: f64) -> Transform[src]

Constructs a new rotate transform at the specified position.

pub fn new_skew_x(angle: f64) -> Transform[src]

Constructs a new skew transform along then X axis.

pub fn new_skew_y(angle: f64) -> Transform[src]

Constructs a new skew transform along then Y axis.

pub fn translate(&mut self, x: f64, y: f64)[src]

Translates the current transform.

pub fn scale(&mut self, sx: f64, sy: f64)[src]

Scales the current transform.

pub fn rotate(&mut self, angle: f64)[src]

Rotates the current transform.

pub fn rotate_at(&mut self, angle: f64, x: f64, y: f64)[src]

Rotates the current transform at the specified position.

pub fn skew_x(&mut self, angle: f64)[src]

Skews the current transform along the X axis.

pub fn skew_y(&mut self, angle: f64)[src]

Skews the current transform along the Y axis.

pub fn append(&mut self, other: &Transform)[src]

Appends transform to the current transform.

pub fn prepend(&mut self, other: &Transform)[src]

Prepends transform to the current transform.

pub fn is_default(&self) -> bool[src]

Returns true if the transform is default, aka (1 0 0 1 0 0).

pub fn is_translate(&self) -> bool[src]

Returns true if the transform contains only translate part, aka (1 0 0 1 x y).

pub fn is_scale(&self) -> bool[src]

Returns true if the transform contains only scale part, aka (sx 0 0 sy 0 0).

pub fn has_translate(&self) -> bool[src]

Returns true if the transform contains translate part.

pub fn has_scale(&self) -> bool[src]

Returns true if the transform contains scale part.

pub fn has_proportional_scale(&self) -> bool[src]

Returns true if the transform scale is proportional.

The proportional scale is when <sx> equal to <sy>.

pub fn has_skew(&self) -> bool[src]

Returns true if the transform contains skew part.

pub fn has_rotate(&self) -> bool[src]

Returns true if the transform contains rotate part.

pub fn get_translate(&self) -> (f64, f64)[src]

Returns transform's translate part.

pub fn get_scale(&self) -> (f64, f64)[src]

Returns transform's scale part.

pub fn get_skew(&self) -> (f64, f64)[src]

Returns transform's skew part.

pub fn get_rotate(&self) -> f64[src]

Returns transform's rotate part.

pub fn apply(&self, x: f64, y: f64) -> (f64, f64)[src]

Applies transform to selected coordinates.

pub fn apply_to(&self, x: &mut f64, y: &mut f64)[src]

Applies transform to selected coordinates.

Trait Implementations

impl Clone for Transform[src]

impl Copy for Transform[src]

impl Debug for Transform[src]

impl Default for Transform[src]

impl Display for Transform[src]

impl FromStr for Transform[src]

type Err = Error

The associated error which can be returned from parsing.

impl FuzzyEq<Transform> for Transform[src]

impl PartialEq<Transform> for Transform[src]

impl StructuralPartialEq for Transform[src]

impl TransformFromBBox for Transform[src]

impl WriteBuffer for Transform[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IsDefault for T where
    T: PartialEq<T> + Default + Copy
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.