Trait vsvg::Transforms
source · pub trait Transforms: Sized {
// Required method
fn transform(&mut self, affine: &Affine) -> &mut Self;
// Provided methods
fn translate(&mut self, dx: impl Into<f64>, dy: impl Into<f64>) -> &mut Self { ... }
fn scale(&mut self, s: impl Into<f64>) -> &mut Self { ... }
fn scale_non_uniform(
&mut self,
sx: impl Into<f64>,
sy: impl Into<f64>
) -> &mut Self { ... }
fn scale_around(
&mut self,
sx: impl Into<f64>,
sy: impl Into<f64>,
cx: impl Into<f64>,
cy: impl Into<f64>
) -> &mut Self { ... }
fn rotate(&mut self, theta: f64) -> &mut Self { ... }
fn rotate_deg(&mut self, theta: f64) -> &mut Self { ... }
fn rotate_around(
&mut self,
theta: f64,
cx: impl Into<f64>,
cy: impl Into<f64>
) -> &mut Self { ... }
fn rotate_around_deg(
&mut self,
theta: f64,
cx: impl Into<f64>,
cy: impl Into<f64>
) -> &mut Self { ... }
fn skew(&mut self, kx: impl Into<f64>, ky: impl Into<f64>) -> &mut Self { ... }
fn skew_around(
&mut self,
kx: impl Into<f64>,
ky: impl Into<f64>,
cx: impl Into<f64>,
cy: impl Into<f64>
) -> &mut Self { ... }
}
Required Methods§
Provided Methods§
sourcefn translate(&mut self, dx: impl Into<f64>, dy: impl Into<f64>) -> &mut Self
fn translate(&mut self, dx: impl Into<f64>, dy: impl Into<f64>) -> &mut Self
Translate the geometry by dx
and dy
.
sourcefn scale_non_uniform(
&mut self,
sx: impl Into<f64>,
sy: impl Into<f64>
) -> &mut Self
fn scale_non_uniform( &mut self, sx: impl Into<f64>, sy: impl Into<f64> ) -> &mut Self
Scale the geometry by sx
and sy
around the origin.
sourcefn scale_around(
&mut self,
sx: impl Into<f64>,
sy: impl Into<f64>,
cx: impl Into<f64>,
cy: impl Into<f64>
) -> &mut Self
fn scale_around( &mut self, sx: impl Into<f64>, sy: impl Into<f64>, cx: impl Into<f64>, cy: impl Into<f64> ) -> &mut Self
Scale the geometry by sx
and sy
around the point (cx, cy)
.
sourcefn rotate(&mut self, theta: f64) -> &mut Self
fn rotate(&mut self, theta: f64) -> &mut Self
Rotate the geometry by theta
radians around the origin.
sourcefn rotate_deg(&mut self, theta: f64) -> &mut Self
fn rotate_deg(&mut self, theta: f64) -> &mut Self
Rotate the geometry by theta
degrees around the origin.
sourcefn rotate_around(
&mut self,
theta: f64,
cx: impl Into<f64>,
cy: impl Into<f64>
) -> &mut Self
fn rotate_around( &mut self, theta: f64, cx: impl Into<f64>, cy: impl Into<f64> ) -> &mut Self
Rotate the geometry by theta
radians around the point (cx, cy)
.
sourcefn rotate_around_deg(
&mut self,
theta: f64,
cx: impl Into<f64>,
cy: impl Into<f64>
) -> &mut Self
fn rotate_around_deg( &mut self, theta: f64, cx: impl Into<f64>, cy: impl Into<f64> ) -> &mut Self
Rotate the geometry by theta
degrees around the point (cx, cy)
.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
Implementors§
impl Transforms for Document
impl Transforms for FlattenedDocument
impl Transforms for FlattenedLayer
impl Transforms for FlattenedPath
impl Transforms for Layer
Implementing this trait allows applying affine transforms to the layer content.