pub struct Transform {
pub xx: f64,
pub xy: f64,
pub yx: f64,
pub yy: f64,
pub dx: f64,
pub dy: f64,
}Expand description
A 2×2 matrix plus an offset (Transform). Transforms are immutable: the
transforming methods return a new one.
Fields§
§xx: f64§xy: f64§yx: f64§yy: f64§dx: f64§dy: f64Implementations§
Source§impl Transform
impl Transform
Sourcepub const fn new(xx: f64, xy: f64, yx: f64, yy: f64, dx: f64, dy: f64) -> Self
pub const fn new(xx: f64, xy: f64, yx: f64, yy: f64, dx: f64, dy: f64) -> Self
Transform(xx, xy, yx, yy, dx, dy).
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Whether this is the identity (not transform).
Sourcepub fn transform_point(&self, (x, y): Point) -> Point
pub fn transform_point(&self, (x, y): Point) -> Point
transformPoint.
Sourcepub fn transform_points(&self, points: &[Point]) -> Vec<Point>
pub fn transform_points(&self, points: &[Point]) -> Vec<Point>
transformPoints.
Sourcepub fn transform_vector(&self, (dx, dy): Point) -> Point
pub fn transform_vector(&self, (dx, dy): Point) -> Point
transformVector: the point transformed without the offset.
Sourcepub fn transform_vectors(&self, vectors: &[Point]) -> Vec<Point>
pub fn transform_vectors(&self, vectors: &[Point]) -> Vec<Point>
transformVectors.
Sourcepub fn transform(&self, other: &Transform) -> Self
pub fn transform(&self, other: &Transform) -> Self
transform(other): other applied first, then self.
Sourcepub fn reverse_transform(&self, other: &Transform) -> Self
pub fn reverse_transform(&self, other: &Transform) -> Self
reverseTransform(other): self applied first, then other.
Sourcepub fn to_decomposed(&self) -> DecomposedTransform
pub fn to_decomposed(&self) -> DecomposedTransform
toDecomposed().
Trait Implementations§
impl Copy for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Forget for Transform
impl Freeze for Transform
impl Move for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more