Struct svgtypes::Transform [−][src]
Representation of the <transform> type.
Fields
a: f64
b: f64
c: f64
d: f64
e: f64
f: f64
Methods
impl Transform[src]
impl Transformpub fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Self[src]
pub fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> SelfConstructs a new transform.
pub fn new_translate(x: f64, y: f64) -> Self[src]
pub fn new_translate(x: f64, y: f64) -> SelfConstructs a new translate transform.
pub fn new_scale(sx: f64, sy: f64) -> Self[src]
pub fn new_scale(sx: f64, sy: f64) -> SelfConstructs a new scale transform.
pub fn new_rotate(angle: f64) -> Self[src]
pub fn new_rotate(angle: f64) -> SelfConstructs a new rotate transform.
pub fn new_rotate_at(angle: f64, x: f64, y: f64) -> Self[src]
pub fn new_rotate_at(angle: f64, x: f64, y: f64) -> SelfConstructs a new rotate transform at the specified position.
pub fn new_skew_x(angle: f64) -> Self[src]
pub fn new_skew_x(angle: f64) -> SelfConstructs a new skew transform along then X axis.
pub fn new_skew_y(angle: f64) -> Self[src]
pub fn new_skew_y(angle: f64) -> SelfConstructs a new skew transform along then Y axis.
pub fn translate(&mut self, x: f64, y: f64)[src]
pub fn translate(&mut self, x: f64, y: f64)Translates the current transform.
pub fn scale(&mut self, sx: f64, sy: f64)[src]
pub fn scale(&mut self, sx: f64, sy: f64)Scales the current transform.
pub fn rotate(&mut self, angle: f64)[src]
pub fn rotate(&mut self, angle: f64)Rotates the current transform.
pub fn rotate_at(&mut self, angle: f64, x: f64, y: f64)[src]
pub fn rotate_at(&mut self, angle: f64, x: f64, y: f64)Rotates the current transform at the specified position.
pub fn skew_x(&mut self, angle: f64)[src]
pub fn skew_x(&mut self, angle: f64)Skews the current transform along the X axis.
pub fn skew_y(&mut self, angle: f64)[src]
pub fn skew_y(&mut self, angle: f64)Skews the current transform along the Y axis.
pub fn append(&mut self, t: &Transform)[src]
pub fn append(&mut self, t: &Transform)Appends transform to the current transform.
pub fn is_default(&self) -> bool[src]
pub fn is_default(&self) -> boolReturns true if the transform is default, aka (1 0 0 1 0 0).
pub fn is_translate(&self) -> bool[src]
pub fn is_translate(&self) -> boolReturns true if the transform contains only translate part, aka (1 0 0 1 x y).
pub fn is_scale(&self) -> bool[src]
pub fn is_scale(&self) -> boolReturns true if the transform contains only scale part, aka (sx 0 0 sy 0 0).
pub fn has_translate(&self) -> bool[src]
pub fn has_translate(&self) -> boolReturns true if the transform contains translate part.
pub fn has_scale(&self) -> bool[src]
pub fn has_scale(&self) -> boolReturns true if the transform contains scale part.
pub fn has_proportional_scale(&self) -> bool[src]
pub fn has_proportional_scale(&self) -> boolReturns true if the transform scale is proportional.
The proportional scale is when <sx> equal to <sy>.
pub fn has_skew(&self) -> bool[src]
pub fn has_skew(&self) -> boolReturns true if the transform contains skew part.
pub fn has_rotate(&self) -> bool[src]
pub fn has_rotate(&self) -> boolReturns true if the transform contains rotate part.
pub fn get_translate(&self) -> (f64, f64)[src]
pub fn get_translate(&self) -> (f64, f64)Returns transform's translate part.
pub fn get_scale(&self) -> (f64, f64)[src]
pub fn get_scale(&self) -> (f64, f64)Returns transform's scale part.
pub fn get_skew(&self) -> (f64, f64)[src]
pub fn get_skew(&self) -> (f64, f64)Returns transform's skew part.
pub fn get_rotate(&self) -> f64[src]
pub fn get_rotate(&self) -> f64Returns transform's rotate part.
pub fn apply(&self, x: f64, y: f64) -> (f64, f64)[src]
pub fn apply(&self, x: f64, y: f64) -> (f64, f64)Applies transform to selected coordinates.
pub fn apply_to(&self, x: &mut f64, y: &mut f64)[src]
pub fn apply_to(&self, x: &mut f64, y: &mut f64)Applies transform to selected coordinates.
Trait Implementations
impl FromStr for Transform[src]
impl FromStr for Transformtype Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Transform, Self::Err>[src]
fn from_str(s: &str) -> Result<Transform, Self::Err>Parses a string s to return a value of this type. Read more
impl FromSpan for Transform[src]
impl FromSpan for Transformimpl WriteBuffer for Transform[src]
impl WriteBuffer for Transformfn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8>)[src]
fn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8>)Writes data to the Vec<u8> buffer using specified WriteOptions.
fn write_buf(&self, buf: &mut Vec<u8>)[src]
fn write_buf(&self, buf: &mut Vec<u8>)Writes data to the Vec<u8> buffer using default WriteOptions.
fn with_write_opt<'a>(&'a self, opt: &'a WriteOptions) -> DisplaySvg<'a, Self> where
Self: Sized, [src]
fn with_write_opt<'a>(&'a self, opt: &'a WriteOptions) -> DisplaySvg<'a, Self> where
Self: Sized, Returns an object that implements fmt::Display using provided write options.
impl Display for Transform[src]
impl Display for Transformfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Transform[src]
impl Clone for Transformfn clone(&self) -> Transform[src]
fn clone(&self) -> TransformReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for Transform[src]
impl Copy for Transformimpl PartialEq for Transform[src]
impl PartialEq for Transformfn eq(&self, other: &Transform) -> bool[src]
fn eq(&self, other: &Transform) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Transform) -> bool[src]
fn ne(&self, other: &Transform) -> boolThis method tests for !=.
impl Debug for Transform[src]
impl Debug for Transformfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Default for Transform[src]
impl Default for Transformimpl FuzzyEq for Transform[src]
impl FuzzyEq for Transform