pub struct PdfQuadPoints { /* private fields */ }Expand description
A set of four coordinates expressed in PdfPoints that outline the bounds of a four-sided quadrilateral. The coordinates specify the quadrilateral’s four vertices in counter-clockwise order:
(x4, y4) (x3, y3)
._____________________.
| |
| |
!_____________________!
(x1, y1) (x2, y2)More information on quad points can be found in Section 8.30 of the PDF Reference Manual, version 1.7, on page 634.
Implementations§
Source§impl PdfQuadPoints
impl PdfQuadPoints
Sourcepub const ZERO: PdfQuadPoints
pub const ZERO: PdfQuadPoints
A PdfQuadPoints object with the identity value (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0).
Sourcepub const fn new(
x1: PdfPoints,
y1: PdfPoints,
x2: PdfPoints,
y2: PdfPoints,
x3: PdfPoints,
y3: PdfPoints,
x4: PdfPoints,
y4: PdfPoints,
) -> Self
pub const fn new( x1: PdfPoints, y1: PdfPoints, x2: PdfPoints, y2: PdfPoints, x3: PdfPoints, y3: PdfPoints, x4: PdfPoints, y4: PdfPoints, ) -> Self
Creates a new PdfQuadPoints object from the given PdfPoints coordinate pairs.
The coordinate space of a PdfPage has its origin (0,0) at the bottom left of the page, with x values increasing as coordinates move horizontally to the right and y values increasing as coordinates move vertically up.
Sourcepub const fn new_from_values(
x1: f32,
y1: f32,
x2: f32,
y2: f32,
x3: f32,
y3: f32,
x4: f32,
y4: f32,
) -> Self
pub const fn new_from_values( x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, x4: f32, y4: f32, ) -> Self
Creates a new PdfQuadPoints object from the given raw points values.
The coordinate space of a PdfPage has its origin (0,0) at the bottom left of the page, with x values increasing as coordinates move horizontally to the right and y values increasing as coordinates move vertically up.
Sourcepub const fn zero() -> Self
pub const fn zero() -> Self
Creates a new PdfQuadPoints object with all values set to 0.0.
Consider using the compile-time constant value PdfQuadPoints::ZERO rather than calling this function directly.
Sourcepub fn from_rect(rect: &PdfRect) -> Self
pub fn from_rect(rect: &PdfRect) -> Self
Creates a new PdfQuadPoints from the given PdfRect.
Sourcepub fn x1(&self) -> PdfPoints
pub fn x1(&self) -> PdfPoints
Returns the x1 point of this PdfQuadPoints.
Sourcepub fn y1(&self) -> PdfPoints
pub fn y1(&self) -> PdfPoints
Returns the y1 point of this PdfQuadPoints.
Sourcepub fn x2(&self) -> PdfPoints
pub fn x2(&self) -> PdfPoints
Returns the x2 point of this PdfQuadPoints.
Sourcepub fn y2(&self) -> PdfPoints
pub fn y2(&self) -> PdfPoints
Returns the y2 point of this PdfQuadPoints.
Sourcepub fn x3(&self) -> PdfPoints
pub fn x3(&self) -> PdfPoints
Returns the x3 point of this PdfQuadPoints.
Sourcepub fn y3(&self) -> PdfPoints
pub fn y3(&self) -> PdfPoints
Returns the y3 point of this PdfQuadPoints.
Sourcepub fn x4(&self) -> PdfPoints
pub fn x4(&self) -> PdfPoints
Returns the x4 point of this PdfQuadPoints.
Sourcepub fn y4(&self) -> PdfPoints
pub fn y4(&self) -> PdfPoints
Returns the y4 point of this PdfQuadPoints.
Sourcepub fn left(&self) -> PdfPoints
pub fn left(&self) -> PdfPoints
Returns the left-most extent of this PdfQuadPoints.
Sourcepub fn right(&self) -> PdfPoints
pub fn right(&self) -> PdfPoints
Returns the right-most extent of this PdfQuadPoints.
Sourcepub fn bottom(&self) -> PdfPoints
pub fn bottom(&self) -> PdfPoints
Returns the bottom-most extent of this PdfQuadPoints.
Sourcepub fn top(&self) -> PdfPoints
pub fn top(&self) -> PdfPoints
Returns the top-most extent of this PdfQuadPoints.
Sourcepub fn width(&self) -> PdfPoints
pub fn width(&self) -> PdfPoints
Returns the width of this PdfQuadPoints.
Sourcepub fn height(&self) -> PdfPoints
pub fn height(&self) -> PdfPoints
Returns the height of this PdfQuadPoints.
Sourcepub fn transform(&self, matrix: PdfMatrix) -> PdfQuadPoints
pub fn transform(&self, matrix: PdfMatrix) -> PdfQuadPoints
Returns the result of applying the given PdfMatrix to each corner point
Sourcepub fn to_rect(&self) -> PdfRect
pub fn to_rect(&self) -> PdfRect
Returns the smallest PdfRect that can completely enclose the quadrilateral outlined by this PdfQuadPoints.
Trait Implementations§
Source§impl Clone for PdfQuadPoints
impl Clone for PdfQuadPoints
Source§fn clone(&self) -> PdfQuadPoints
fn clone(&self) -> PdfQuadPoints
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PdfQuadPoints
Source§impl Debug for PdfQuadPoints
impl Debug for PdfQuadPoints
Source§impl Display for PdfQuadPoints
impl Display for PdfQuadPoints
impl Eq for PdfQuadPoints
Source§impl Hash for PdfQuadPoints
impl Hash for PdfQuadPoints
Source§impl PartialEq for PdfQuadPoints
impl PartialEq for PdfQuadPoints
Auto Trait Implementations§
impl Freeze for PdfQuadPoints
impl RefUnwindSafe for PdfQuadPoints
impl Send for PdfQuadPoints
impl Sync for PdfQuadPoints
impl Unpin for PdfQuadPoints
impl UnsafeUnpin for PdfQuadPoints
impl UnwindSafe for PdfQuadPoints
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more