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: impl Into<f64>) -> &mut Self { ... }
fn rotate_around(
&mut self,
theta: impl Into<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: impl Into<f64>) -> &mut Self
fn rotate(&mut self, theta: impl Into<f64>) -> &mut Self
Rotate the geometry by theta radians around the origin.
Sourcefn rotate_around(
&mut self,
theta: impl Into<f64>,
cx: impl Into<f64>,
cy: impl Into<f64>,
) -> &mut Self
fn rotate_around( &mut self, theta: impl Into<f64>, cx: impl Into<f64>, cy: impl Into<f64>, ) -> &mut Self
Rotate the geometry by theta radians around the point (cx, cy).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so 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.