pub struct PolygonAnnotation {
pub vertices: Vec<Point>,
pub line_color: Option<Color>,
pub fill_color: Option<Color>,
pub line_width: f64,
pub border_style: BorderStyle,
pub opacity: f64,
}Expand description
Polygon annotation - displays a closed polygon on the page
Fields§
§vertices: Vec<Point>Vertices of the polygon
line_color: Option<Color>Line color
fill_color: Option<Color>Fill color
line_width: f64Line width in points
border_style: BorderStyleBorder style
opacity: f64Opacity (0.0 to 1.0)
Implementations§
Source§impl PolygonAnnotation
impl PolygonAnnotation
Sourcepub fn with_line_color(self, color: Option<Color>) -> Self
pub fn with_line_color(self, color: Option<Color>) -> Self
Set line color
Sourcepub fn with_fill_color(self, color: Option<Color>) -> Self
pub fn with_fill_color(self, color: Option<Color>) -> Self
Set fill color
Sourcepub fn with_line_width(self, width: f64) -> Self
pub fn with_line_width(self, width: f64) -> Self
Set line width
Sourcepub fn with_border_style(self, style: BorderStyle) -> Self
pub fn with_border_style(self, style: BorderStyle) -> Self
Set border style
Sourcepub fn with_opacity(self, opacity: f64) -> Self
pub fn with_opacity(self, opacity: f64) -> Self
Set opacity
Sourcepub fn calculate_rect(&self) -> Rectangle
pub fn calculate_rect(&self) -> Rectangle
Calculate bounding rectangle
Sourcepub fn to_annotation(&self) -> Result<Annotation>
pub fn to_annotation(&self) -> Result<Annotation>
Convert to PDF annotation
Trait Implementations§
Source§impl Clone for PolygonAnnotation
impl Clone for PolygonAnnotation
Source§fn clone(&self) -> PolygonAnnotation
fn clone(&self) -> PolygonAnnotation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolygonAnnotation
impl Debug for PolygonAnnotation
Auto Trait Implementations§
impl Freeze for PolygonAnnotation
impl RefUnwindSafe for PolygonAnnotation
impl Send for PolygonAnnotation
impl Sync for PolygonAnnotation
impl Unpin for PolygonAnnotation
impl UnwindSafe for PolygonAnnotation
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().