pub trait Device {
// Provided methods
fn fill_path(
&mut self,
path: &[PathSegment],
rule: FillRule,
state: &GraphicsState,
) { ... }
fn stroke_path(&mut self, path: &[PathSegment], state: &GraphicsState) { ... }
fn clip(
&mut self,
path: &[PathSegment],
rule: FillRule,
state: &GraphicsState,
) { ... }
fn draw_glyph(&mut self, glyph: &Glyph, state: &GraphicsState) { ... }
fn draw_image(&mut self, image: &Image, state: &GraphicsState) { ... }
fn begin_marked_content(&mut self, tag: &Name, properties: Option<&Dict>) { ... }
fn end_marked_content(&mut self) { ... }
fn begin_group(
&mut self,
form: Option<ObjId>,
dict: &Dict,
state: &GraphicsState,
) { ... }
fn end_group(&mut self) { ... }
}Expand description
Receives what a content stream draws. Every method has an empty default, so a device implements only what it needs: text extraction takes glyphs and marked content; a renderer takes everything.
Provided Methods§
Sourcefn fill_path(
&mut self,
path: &[PathSegment],
rule: FillRule,
state: &GraphicsState,
)
fn fill_path( &mut self, path: &[PathSegment], rule: FillRule, state: &GraphicsState, )
Fills path (user space) with the current fill colour.
Sourcefn stroke_path(&mut self, path: &[PathSegment], state: &GraphicsState)
fn stroke_path(&mut self, path: &[PathSegment], state: &GraphicsState)
Strokes path (user space).
Sourcefn clip(&mut self, path: &[PathSegment], rule: FillRule, state: &GraphicsState)
fn clip(&mut self, path: &[PathSegment], rule: FillRule, state: &GraphicsState)
Intersects the clip with path.
Sourcefn draw_glyph(&mut self, glyph: &Glyph, state: &GraphicsState)
fn draw_glyph(&mut self, glyph: &Glyph, state: &GraphicsState)
Draws one glyph.
Sourcefn draw_image(&mut self, image: &Image, state: &GraphicsState)
fn draw_image(&mut self, image: &Image, state: &GraphicsState)
Draws an image into the unit square of state.ctm.
Sourcefn begin_marked_content(&mut self, tag: &Name, properties: Option<&Dict>)
fn begin_marked_content(&mut self, tag: &Name, properties: Option<&Dict>)
Starts a marked-content sequence (BMC/BDC).
Sourcefn end_marked_content(&mut self)
fn end_marked_content(&mut self)
Ends the innermost marked-content sequence (EMC).
Sourcefn begin_group(
&mut self,
form: Option<ObjId>,
dict: &Dict,
state: &GraphicsState,
)
fn begin_group( &mut self, form: Option<ObjId>, dict: &Dict, state: &GraphicsState, )
Starts a Form XObject (a group when it has /Group).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".