Struct pdf_canvas::graphicsstate::Matrix
[−]
[src]
pub struct Matrix { /* fields omitted */ }
A transformation matrix for the pdf graphics state.
Matrixes can be created with numerous named constructors and combined by multiplication.
Examples
try!(canvas.concat(Matrix::translate(10.0, 24.0))); // Matrixes can be combined by multiplication: try!(canvas.concat(Matrix::translate(7.0, 0.0) * Matrix::rotate_deg(45.0))); // ... will be visualy identical to: try!(canvas.concat(Matrix::translate(7.0, 0.0))); try!(canvas.concat(Matrix::rotate_deg(45.0)));
Methods
impl Matrix
[src]
fn translate(dx: f32, dy: f32) -> Self
Construct a matrix for translation
fn rotate(a: f32) -> Self
Construct a matrix for rotating by a
radians.
fn rotate_deg(a: f32) -> Self
Construct a matrix for rotating by a
degrees.
fn scale(sx: f32, sy: f32) -> Self
Construct a matrix for scaling by factor sx
in x-direction
and by sy
in y-direction.
fn uniform_scale(s: f32) -> Self
Construct a matrix for scaling by the same factor, s
in both
directions.
fn skew(a: f32, b: f32) -> Self
Construct a matrix for skewing.