pub struct ShadingPattern {
pub name: String,
pub shading: ShadingDefinition,
pub matrix: Option<[f64; 6]>,
}Expand description
Shading pattern that combines a shading with pattern properties
Fields§
§name: StringPattern name for referencing
shading: ShadingDefinitionThe underlying shading
matrix: Option<[f64; 6]>Pattern transformation matrix
Implementations§
Source§impl ShadingPattern
impl ShadingPattern
Sourcepub fn new(name: String, shading: ShadingDefinition) -> Self
pub fn new(name: String, shading: ShadingDefinition) -> Self
Create a new shading pattern
Sourcepub fn with_matrix(self, matrix: [f64; 6]) -> Self
pub fn with_matrix(self, matrix: [f64; 6]) -> Self
Set pattern transformation matrix
Sourcepub fn to_pdf_pattern_dictionary(&self) -> Result<Dictionary>
pub fn to_pdf_pattern_dictionary(&self) -> Result<Dictionary>
Generate PDF pattern dictionary for shading pattern.
NOTE: ShadingPattern is not yet wired through Page → writer (there
is no Page::add_shading_pattern and the writer iterates only
page.shadings()), so this method is not exercised by the
serialisation pipeline today. The sh direct-paint path
([GraphicsContext::paint_shading] over [Page::add_shading]) is the
wired, end-to-end gradient path. Because the inlined /Shading here
carries its /Function inline (the writer’s indirect-hoist only
applies to page.shadings()), full PatternType-2 fill support remains
a follow-up.
Trait Implementations§
Source§impl Clone for ShadingPattern
impl Clone for ShadingPattern
Source§fn clone(&self) -> ShadingPattern
fn clone(&self) -> ShadingPattern
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more