pub struct PdfQuadPoints {
pub x1: PdfPoints,
pub y1: PdfPoints,
pub x2: PdfPoints,
pub y2: PdfPoints,
pub x3: PdfPoints,
pub y3: PdfPoints,
pub x4: PdfPoints,
pub y4: PdfPoints,
pub bottom: PdfPoints,
pub left: PdfPoints,
pub top: PdfPoints,
pub right: PdfPoints,
}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.
Fields§
§x1: PdfPoints§y1: PdfPoints§x2: PdfPoints§y2: PdfPoints§x3: PdfPoints§y3: PdfPoints§x4: PdfPoints§y4: PdfPoints§bottom: PdfPointsleft: PdfPointstop: PdfPointsright: PdfPointsImplementations§
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 fn new(
x1: PdfPoints,
y1: PdfPoints,
x2: PdfPoints,
y2: PdfPoints,
x3: PdfPoints,
y3: PdfPoints,
x4: PdfPoints,
y4: PdfPoints,
) -> Self
pub fn new( x1: PdfPoints, y1: PdfPoints, x2: PdfPoints, y2: PdfPoints, x3: PdfPoints, y3: PdfPoints, x4: PdfPoints, y4: PdfPoints, ) -> Self
Creates a new PdfQuadPoints 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 fn new_from_values(
x1: f32,
y1: f32,
x2: f32,
y2: f32,
x3: f32,
y3: f32,
x4: f32,
y4: f32,
) -> Self
pub 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 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 fn zero() -> Self
pub 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 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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PdfQuadPoints
impl Debug for PdfQuadPoints
Source§impl Display for PdfQuadPoints
impl Display for PdfQuadPoints
Source§impl Hash for PdfQuadPoints
impl Hash for PdfQuadPoints
Source§impl PartialEq for PdfQuadPoints
impl PartialEq for PdfQuadPoints
impl Copy for PdfQuadPoints
impl Eq 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 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