pub struct Affine(/* private fields */);Expand description
A 2D affine transform stored as six coefficients [a, b, c, d, e, f],
row-major, mapping a point (x, y) to:
x' = a·x + c·y + e
y' = b·x + d·y + fThis matches the column convention used by SVG/PostScript matrix(...)
and by oxideav-core’s Transform2D; stipple-render converts between the
two at the render boundary.
Implementations§
Source§impl Affine
impl Affine
pub const IDENTITY: Self
pub const fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Self
pub const fn translate(v: Vec2) -> Self
pub const fn scale(sx: f64, sy: f64) -> Self
pub fn rotate(radians: f64) -> Self
pub const fn as_array(self) -> [f64; 6]
Sourcepub fn then(self, outer: Affine) -> Affine
pub fn then(self, outer: Affine) -> Affine
Compose so that self is applied after inner
(result(p) = self(inner(p))).
Sourcepub fn determinant(self) -> f64
pub fn determinant(self) -> f64
The determinant of the linear (2×2) part.
Trait Implementations§
impl Copy for Affine
impl StructuralPartialEq for Affine
Auto Trait Implementations§
impl Freeze for Affine
impl RefUnwindSafe for Affine
impl Send for Affine
impl Sync for Affine
impl Unpin for Affine
impl UnsafeUnpin for Affine
impl UnwindSafe for Affine
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