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§

source

fn transform(&mut self, affine: &Affine) -> &mut Self

Apply a 2D affine transform

Provided Methods§

source

fn translate(&mut self, dx: impl Into<f64>, dy: impl Into<f64>) -> &mut Self

Translate the geometry by dx and dy.

source

fn scale(&mut self, s: impl Into<f64>) -> &mut Self

Scale the geometry by s around the origin.

source

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.

source

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).

source

fn rotate(&mut self, theta: f64) -> &mut Self

Rotate the geometry by theta radians around the origin.

source

fn rotate_deg(&mut self, theta: f64) -> &mut Self

Rotate the geometry by theta degrees around the origin.

source

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).

source

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).

source

fn skew(&mut self, kx: impl Into<f64>, ky: impl Into<f64>) -> &mut Self

Skew the geometry by kx and ky radians around the origin.

source

fn skew_around( &mut self, kx: impl Into<f64>, ky: impl Into<f64>, cx: impl Into<f64>, cy: impl Into<f64> ) -> &mut Self

Skew the geometry by kx and ky radians around the point (cx, cy).

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Transforms for BezPath

source§

fn transform(&mut self, affine: &Affine) -> &mut Self

Implementors§

source§

impl Transforms for Document

source§

impl Transforms for FlattenedDocument

source§

impl Transforms for FlattenedLayer

source§

impl Transforms for FlattenedPath

source§

impl Transforms for Layer

Implementing this trait allows applying affine transforms to the layer content.

source§

impl Transforms for Path

source§

impl Transforms for Polyline