[−][src]Struct mvt::Transform
An affine transform can translate, scale, rotate and skew 2D points.
A series of transforms can be combined into a single Transform struct.
Example
use mvt::Transform; const PI: f64 = std::f64::consts::PI; let t = Transform::new_translate(-50.0, -50.0) .rotate(PI) .translate(50.0, 50.0) .scale(2.0, 2.0);
Implementations
impl Transform[src]
pub fn new() -> Self[src]
Create a new identity transform.
pub fn new_translate(tx: f64, ty: f64) -> Self[src]
Create a new translation transform.
txAmount to translate X.tyAmount to translate Y.
pub fn new_scale(sx: f64, sy: f64) -> Self[src]
Create a new scale transform.
sxScale factor for X dimension.syScale factor for Y dimension.
pub fn new_rotate(th: f64) -> Self[src]
Create a new rotation transform.
thAngle to rotate coordinates (radians).
pub fn new_skew(ax: f64, ay: f64) -> Self[src]
Create a new skew transform.
axAngle to skew X-axis (radians).ayAngle to skew Y-axis (radians).
pub fn translate(self, tx: f64, ty: f64) -> Self[src]
Apply translation to a transform.
txAmount to translate X.tyAmount to translate Y.
pub fn scale(self, sx: f64, sy: f64) -> Self[src]
Apply scaling to a transform.
sxScale factor for X dimension.syScale factor for Y dimension.
pub fn rotate(self, th: f64) -> Self[src]
Apply rotation to a transform.
thAngle to rotate coordinates (radians).
pub fn skew(self, ax: f64, ay: f64) -> Self[src]
Apply skew to a transform.
axAngle to skew X-axis (radians).ayAngle to skew Y-axis (radians).
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 = Self
The resulting type after applying the * operator.
fn mul(self, other: Self) -> Self[src]
impl Mul<Vec2> for Transform[src]
type Output = Vec2
The resulting type after applying the * operator.
fn mul(self, s: Vec2) -> Vec2[src]
impl MulAssign<Transform> for Transform[src]
fn mul_assign(&mut self, other: Self)[src]
impl PartialEq<Transform> for Transform[src]
impl StructuralPartialEq for Transform[src]
Auto Trait Implementations
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,