pub struct Matrix {
pub a: f64,
pub b: f64,
pub c: f64,
pub d: f64,
pub e: f64,
pub f: f64,
}Expand description
3x2 affine transformation matrix.
PDF uses the representation [a b c d e f] which maps:
x’ = ax + cy + e
y’ = bx + dy + f
Fields§
§a: f64§b: f64§c: f64§d: f64§e: f64§f: f64Implementations§
Source§impl Matrix
impl Matrix
pub fn identity() -> Self
pub fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Self
pub fn translate(tx: f64, ty: f64) -> Self
pub fn scale(sx: f64, sy: f64) -> Self
Sourcepub fn concat(&self, other: &Matrix) -> Self
pub fn concat(&self, other: &Matrix) -> Self
Matrix multiply: self * other.
Represents applying other first, then self.
PDF cm semantics: new_CTM = old_CTM.concat(cm_matrix).
pub fn determinant(&self) -> f64
pub fn inverse(&self) -> Option<Self>
Trait Implementations§
impl Copy for Matrix
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnsafeUnpin for Matrix
impl UnwindSafe for Matrix
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