Struct usvg::tree::Transform
[−]
[src]
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: f64
b: f64
c: f64
d: f64
e: f64
f: 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 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 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, t: &Transform)
[src]
Appends 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 From<Transform> for AttributeValue
[src]
fn from(value: Transform) -> AttributeValue
[src]
Performs the conversion.
impl Display for Transform
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl WriteBuffer for Transform
[src]
fn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8>)
[src]
Writes data to the Vec<u8>
buffer using specified WriteOptions
.
fn write_buf(&self, buf: &mut Vec<u8>)
[src]
Writes data to the Vec<u8>
buffer using default WriteOptions
.
fn with_write_opt(&'a self, opt: &'a WriteOptions) -> DisplaySvg<'a, Self>
[src]
Returns an object that implements fmt::Display
using provided write options.
impl FuzzyEq<Transform> for Transform
[src]
fn fuzzy_eq(&self, other: &Transform) -> bool
[src]
Returns true
if values are approximately equal.
fn fuzzy_ne(&self, other: &Rhs) -> bool
[src]
Returns true
if values are not approximately equal.
impl FromSpan for Transform
[src]
impl Copy for Transform
[src]
impl FromStr for Transform
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Transform, <Transform as FromStr>::Err>
[src]
Parses a string s
to return a value of this type. Read more
impl PartialEq<Transform> for Transform
[src]
fn eq(&self, __arg_0: &Transform) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Transform) -> bool
[src]
This method tests for !=
.
impl Clone for Transform
[src]
fn clone(&self) -> Transform
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Transform
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more