Struct pdfium_render::transform::PdfMatrix
source · pub struct PdfMatrix {
pub a: PdfMatrixValue,
pub b: PdfMatrixValue,
pub c: PdfMatrixValue,
pub d: PdfMatrixValue,
pub e: PdfMatrixValue,
pub f: PdfMatrixValue,
}Expand description
Six floating-point values that represent the six configurable elements of a nine-element 3x3 PDF transformation matrix.
Applying the matrix to a page, individual page object, or page object group effects a transformation to that object. Depending on the values specified in the matrix, the object can be moved, scaled, rotated, or skewed.
It is rare that a matrix needs to be used directly. The functions in the Transformable trait provide convenient and expressive access to the most commonly used transformation operations without requiring a matrix.
An overview of PDF transformation matrices can be found in the PDF Reference Manual version 1.7 on page 204; a detailed description can be founded in section 4.2.3 on page 207.
Fields§
§a: PdfMatrixValue§b: PdfMatrixValue§c: PdfMatrixValue§d: PdfMatrixValue§e: PdfMatrixValue§f: PdfMatrixValueImplementations§
source§impl PdfMatrix
impl PdfMatrix
sourcepub const IDENTITY: PdfMatrix = _
pub const IDENTITY: PdfMatrix = _
A PdfMatrix object with matrix values a and d set to 1.0 and all other values set to 0.0.
sourcepub const fn new(
a: PdfMatrixValue,
b: PdfMatrixValue,
c: PdfMatrixValue,
d: PdfMatrixValue,
e: PdfMatrixValue,
f: PdfMatrixValue
) -> Self
pub const fn new(
a: PdfMatrixValue,
b: PdfMatrixValue,
c: PdfMatrixValue,
d: PdfMatrixValue,
e: PdfMatrixValue,
f: PdfMatrixValue
) -> Self
Creates a new PdfMatrix with the given matrix values.
sourcepub const fn zero() -> Self
pub const fn zero() -> Self
Creates a new PdfMatrix object with all matrix values set to 0.0.
Consider using the compile-time constant value PdfMatrix::ZERO rather than calling this function directly.
sourcepub const fn identity() -> Self
pub const fn identity() -> Self
Creates a new PdfMatrix object with all matrix values set to 0.0.
Consider using the compile-time constant value PdfMatrix::ZERO rather than calling this function directly.
sourcepub fn apply(
&self,
transformable: &mut impl Transformable
) -> Result<(), PdfiumError>
pub fn apply(
&self,
transformable: &mut impl Transformable
) -> Result<(), PdfiumError>
Applies the values in this PdfMatrix to the given transformable object.