[][src]Struct pdf_create::common::Matrix

pub struct Matrix<P> {
    pub a: P,
    pub b: P,
    pub c: P,
    pub d: P,
    pub e: P,
    pub f: P,
}

A font matrix

⎛ a b 0 ⎞
⎜ c d 0 ⎟
⎝ e f 1 ⎠

Fields

a: P

M1,1

b: P

M1,2

c: P

M2,1

d: P

M2,2

e: P

M3,1

f: P

M3,2

Implementations

impl Matrix<f32>[src]

A matrix

pub fn identity() -> Self[src]

use pdf_create::common::Matrix;
let id = Matrix::<f32>::identity();
assert_eq!(id, id * id);

pub fn inverse_y() -> Self[src]

use pdf_create::common::Matrix;
let id = Matrix::<f32>::identity();
let ivy = Matrix::<f32>::inverse_y();
assert_eq!(ivy, ivy * id);
assert_eq!(id, ivy * ivy);

pub fn inverse_x() -> Self[src]

use pdf_create::common::Matrix;
let id = Matrix::<f32>::identity();
let ivx = Matrix::<f32>::inverse_x();
assert_eq!(ivx, ivx * id);
assert_eq!(id, ivx * ivx);

pub fn inverse_xy() -> Self[src]

Inverts both coordinates

pub fn translate(x: f32, y: f32) -> Self[src]

use pdf_create::common::Matrix;
let ty1 = Matrix::<f32>::translate(0.0, 3.0);
let ty2 = Matrix::<f32>::translate(0.0, 5.0);
let tx1 = Matrix::<f32>::translate(2.0, 0.0);
let tx2 = Matrix::<f32>::translate(7.0, 0.0);
let res = Matrix::<f32>::translate(9.0, 8.0);
assert_eq!(res, ty1 * ty2 * tx1 * tx2);
assert_eq!(res, ty1 * tx2 * ty2 * tx1);

pub fn scale(x: f32, y: f32) -> Self[src]

Create a scaling matrix

pub fn default_glyph() -> Self[src]

Create a default 1:1000 glyph matrix

Trait Implementations

impl<P: Clone> Clone for Matrix<P>[src]

impl<P: Copy> Copy for Matrix<P>[src]

impl<P: Debug> Debug for Matrix<P>[src]

impl<P: Eq> Eq for Matrix<P>[src]

impl<P> Mul<Matrix<P>> for Matrix<P> where
    P: Copy + Mul<Output = P> + Add<Output = P>, 
[src]

type Output = Self

The resulting type after applying the * operator.

impl<P: PartialEq> PartialEq<Matrix<P>> for Matrix<P>[src]

impl<P: Serialize> Serialize for Matrix<P>[src]

impl<P> StructuralEq for Matrix<P>[src]

impl<P> StructuralPartialEq for Matrix<P>[src]

Auto Trait Implementations

impl<P> RefUnwindSafe for Matrix<P> where
    P: RefUnwindSafe

impl<P> Send for Matrix<P> where
    P: Send

impl<P> Sync for Matrix<P> where
    P: Sync

impl<P> Unpin for Matrix<P> where
    P: Unpin

impl<P> UnwindSafe for Matrix<P> where
    P: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.