pub struct TilingPattern {
pub name: String,
pub paint_type: PaintType,
pub tiling_type: TilingType,
pub bbox: [f64; 4],
pub x_step: f64,
pub y_step: f64,
pub matrix: PatternMatrix,
pub content_stream: Vec<u8>,
pub resources: Option<Dictionary>,
}Expand description
Tiling pattern definition according to ISO 32000-1
Fields§
§name: StringPattern name for referencing
paint_type: PaintTypePaint type (colored or uncolored)
tiling_type: TilingTypeTiling type
bbox: [f64; 4]Bounding box [xmin, ymin, xmax, ymax]
x_step: f64Horizontal spacing between pattern cells
y_step: f64Vertical spacing between pattern cells
matrix: PatternMatrixPattern transformation matrix
content_stream: Vec<u8>Pattern content stream (drawing commands)
resources: Option<Dictionary>Resources dictionary for pattern content
Implementations§
Source§impl TilingPattern
impl TilingPattern
Sourcepub fn new(
name: String,
paint_type: PaintType,
tiling_type: TilingType,
bbox: [f64; 4],
x_step: f64,
y_step: f64,
) -> Self
pub fn new( name: String, paint_type: PaintType, tiling_type: TilingType, bbox: [f64; 4], x_step: f64, y_step: f64, ) -> Self
Create a new tiling pattern
Sourcepub fn with_matrix(self, matrix: PatternMatrix) -> Self
pub fn with_matrix(self, matrix: PatternMatrix) -> Self
Set pattern transformation matrix
Sourcepub fn with_content_stream(self, content: Vec<u8>) -> Self
pub fn with_content_stream(self, content: Vec<u8>) -> Self
Set pattern content stream
Sourcepub fn with_resources(self, resources: Dictionary) -> Self
pub fn with_resources(self, resources: Dictionary) -> Self
Set pattern resources
Sourcepub fn add_command(&mut self, command: &str)
pub fn add_command(&mut self, command: &str)
Add drawing command to content stream
Sourcepub fn add_rectangle(&mut self, x: f64, y: f64, width: f64, height: f64)
pub fn add_rectangle(&mut self, x: f64, y: f64, width: f64, height: f64)
Add rectangle to pattern
Sourcepub fn add_circle(&mut self, cx: f64, cy: f64, radius: f64)
pub fn add_circle(&mut self, cx: f64, cy: f64, radius: f64)
Add circle to pattern (using Bézier curves)
Sourcepub fn fill_and_stroke(&mut self)
pub fn fill_and_stroke(&mut self)
Set fill and stroke operation
Sourcepub fn to_pdf_dictionary(&self) -> Result<Dictionary>
pub fn to_pdf_dictionary(&self) -> Result<Dictionary>
Generate PDF pattern dictionary
Trait Implementations§
Source§impl Clone for TilingPattern
impl Clone for TilingPattern
Source§fn clone(&self) -> TilingPattern
fn clone(&self) -> TilingPattern
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 moreAuto Trait Implementations§
impl Freeze for TilingPattern
impl RefUnwindSafe for TilingPattern
impl Send for TilingPattern
impl Sync for TilingPattern
impl Unpin for TilingPattern
impl UnwindSafe for TilingPattern
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 more