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]
impl Transform
[src]pub fn new(
m00: Scalar,
m01: Scalar,
m02: Scalar,
m10: Scalar,
m11: Scalar,
m12: Scalar
) -> Self
[src]
m00: Scalar,
m01: Scalar,
m02: Scalar,
m10: Scalar,
m11: Scalar,
m12: Scalar
) -> Self
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 StructuralPartialEq for Transform
[src]
impl StructuralPartialEq for Transform
[src]Auto Trait Implementations
impl RefUnwindSafe for Transform
impl RefUnwindSafe for Transform
impl UnwindSafe for Transform
impl UnwindSafe for Transform