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]

[src]

Construct a matrix for translation

[src]

Construct a matrix for rotating by a radians.

[src]

Construct a matrix for rotating by a degrees.

[src]

Construct a matrix for scaling by factor sx in x-direction and by sy in y-direction.

[src]

Construct a matrix for scaling by the same factor, s in both directions.

[src]

Construct a matrix for skewing.

Trait Implementations

impl Display for Matrix
[src]

[src]

Formats the value using the given formatter. Read more

impl Mul for Matrix
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.