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
canvas.concat(Matrix::translate(10.0, 24.0))?; // Matrixes can be combined by multiplication: canvas.concat(Matrix::translate(7.0, 0.0) * Matrix::rotate_deg(45.0))?; // ... will be visualy identical to: canvas.concat(Matrix::translate(7.0, 0.0))?; canvas.concat(Matrix::rotate_deg(45.0))?;
Methods
impl Matrix
[src]
impl Matrix
pub fn translate(dx: f32, dy: f32) -> Self
[src]
pub fn translate(dx: f32, dy: f32) -> Self
Construct a matrix for translation
pub fn rotate(a: f32) -> Self
[src]
pub fn rotate(a: f32) -> Self
Construct a matrix for rotating by a
radians.
pub fn rotate_deg(a: f32) -> Self
[src]
pub fn rotate_deg(a: f32) -> Self
Construct a matrix for rotating by a
degrees.
pub fn scale(sx: f32, sy: f32) -> Self
[src]
pub fn scale(sx: f32, sy: f32) -> Self
Construct a matrix for scaling by factor sx
in x-direction
and by sy
in y-direction.
pub fn uniform_scale(s: f32) -> Self
[src]
pub fn uniform_scale(s: f32) -> Self
Construct a matrix for scaling by the same factor, s
in both
directions.
pub fn skew(a: f32, b: f32) -> Self
[src]
pub fn skew(a: f32, b: f32) -> Self
Construct a matrix for skewing.
Trait Implementations
impl Display for Matrix
[src]
impl Display for Matrix
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Mul for Matrix
[src]
impl Mul for Matrix