Struct usvg::Transform [−][src]
Representation of the <transform>
type.
Fields
a: f64
b: f64
c: f64
d: f64
e: f64
f: f64
Implementations
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.
pub fn from_str(text: &str) -> Result<Transform, Error>
[src]
impl FuzzyEq<Transform> for Transform
[src]
pub fn fuzzy_eq(&self, other: &Transform) -> bool
[src]
pub fn fuzzy_ne(&self, other: &Rhs) -> bool
[src]
impl PartialEq<Transform> for Transform
[src]
impl StructuralPartialEq for Transform
[src]
impl TransformFromBBox for Transform
[src]
impl WriteBuffer for Transform
[src]
pub fn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8, Global>)
[src]
pub fn write_buf(&self, buf: &mut Vec<u8, Global>)
[src]
pub fn with_write_opt(&'a self, opt: &'a WriteOptions) -> DisplaySvg<'a, Self>
[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> IsDefault for T where
T: PartialEq<T> + Default + Copy,
[src]
T: PartialEq<T> + Default + Copy,
pub fn is_default(&Self) -> bool
[src]
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,