Struct rasterize::Transform[][src]

pub struct Transform(_);

2D affine transformation

Stored as an array [m00, m01, m02, m10, m11, m12], semantically corresponds to a matrix: ┌ ┐ │ m00 m01 m02 │ │ m11 m11 m12 │ │ 0 0 1 │ └ ┘

Implementations

impl Transform[src]

pub fn new(
    m00: Scalar,
    m01: Scalar,
    m02: Scalar,
    m10: Scalar,
    m11: Scalar,
    m12: Scalar
) -> Self
[src]

pub fn identity() -> Self[src]

pub fn apply(&self, point: Point) -> Point[src]

Apply this transformation to a point

pub fn invert(&self) -> Option<Self>[src]

Find the inverse transformation

pub fn pre_translate(&self, tx: Scalar, ty: Scalar) -> Self[src]

Apply translation by [tx, ty] before self

pub fn new_translate(tx: Scalar, ty: Scalar) -> Self[src]

pub fn pre_scale(&self, sx: Scalar, sy: Scalar) -> Self[src]

Apply scale transformatoin by [sx, sy] before self

pub fn new_scale(sx: Scalar, sy: Scalar) -> Self[src]

pub fn pre_rotate(&self, a: Scalar) -> Self[src]

Apply rotation by a angle around the origin before self

pub fn new_rotate(a: Scalar) -> Self[src]

pub fn pre_rotate_around(&self, a: Scalar, p: impl Into<Point>) -> Self[src]

Apply rotation around point p by angle a before self

pub fn pre_skew(&self, ax: Scalar, ay: Scalar) -> Self[src]

Apply scew transformation by [ax, ay] before self

pub fn new_skew(ax: Scalar, ay: Scalar) -> Self[src]

pub fn pre_concat(&self, other: Self) -> Self[src]

Apply other transformation before the current one

pub fn post_concat(&self, other: Self) -> Self[src]

Apply other transformation after the curent one

pub fn line_to_line(src: Line, dst: Line) -> Option<Self>[src]

Create transformation which converts src line segment to dst line segment

pub fn make_horizontal(line: Line) -> Transform[src]

Create transformation which makes line horizontal with origin at (0, 0).

pub fn fit_bbox(src: BBox, dst: BBox, align: Align) -> Transform[src]

Create transformation that is requred to fit src box into dst.

pub fn fit_size(src: BBox, size: Size, align: Align) -> Transform[src]

Create transformation needed to fit source bounding box to provided size image

Trait Implementations

impl Clone for Transform[src]

impl Copy for Transform[src]

impl Debug for Transform[src]

impl Default for Transform[src]

impl Mul<Transform> for Transform[src]

type Output = Transform

The resulting type after applying the * operator.

fn mul(self, other: Transform) -> Self::Output[src]

Multiply matrices representing transformations

impl PartialEq<Transform> for Transform[src]

impl StructuralPartialEq for Transform[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.