[−][src]Struct pdf_create::common::Matrix
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]
P: Copy + Mul<Output = P> + Add<Output = P>,
type Output = Self
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Self) -> Self::Output
[src]
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,
P: RefUnwindSafe,
impl<P> Send for Matrix<P> where
P: Send,
P: Send,
impl<P> Sync for Matrix<P> where
P: Sync,
P: Sync,
impl<P> Unpin for Matrix<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for Matrix<P> where
P: UnwindSafe,
P: UnwindSafe,
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,