Struct pdfpdf::Matrix
[−]
[src]
pub struct Matrix { /* fields omitted */ }
A transformation matrix for the pdf graphics state.
Matrices can be created with numerous named constructors and combined by multiplication.
Examples
Pdf::new() .add_page(180.0, 240.0) .transform(Matrix::translate(10.0, 24.0)) // Matrixes can be combined by multiplication: .transform(Matrix::translate(7.0, 0.0) * Matrix::rotate_deg(45.0)) // ... will be visualy identical to: .transform(Matrix::translate(7.0, 0.0)) .transform(Matrix::rotate_deg(45.0)) .write_to("foo.pdf").unwrap();
Methods
impl Matrix
[src]
fn translate(dx: f32, dy: f32) -> Self
[src]
Construct a matrix for translation
fn rotate(a: f32) -> Self
[src]
Construct a matrix for rotating by a
radians.
fn rotate_deg(a: f32) -> Self
[src]
Construct a matrix for rotating by a
degrees.
fn scale(sx: f32, sy: f32) -> Self
[src]
Construct a matrix for scaling by factor sx
in x-direction
and by sy
in y-direction.
fn uniform_scale(s: f32) -> Self
[src]
Construct a matrix for scaling by the same factor, s
in both
directions.
fn skew(a: f32, b: f32) -> Self
[src]
Construct a matrix for skewing.
Trait Implementations
impl Display for Matrix
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more