pub struct Recorder<'a> {
recording: &'a mut Recording,
}
Expand description
Recorder context that captures commands.
Fields§
§recording: &'a mut Recording
The recording to capture commands into.
Implementations§
Source§impl<'a> Recorder<'a>
impl<'a> Recorder<'a>
Sourcepub fn new(recording: &'a mut Recording) -> Self
pub fn new(recording: &'a mut Recording) -> Self
Create a new recorder for the given recording.
Sourcepub fn stroke_path(&mut self, path: &BezPath)
pub fn stroke_path(&mut self, path: &BezPath)
Stroke a path with current paint and stroke settings.
Sourcepub fn stroke_rect(&mut self, rect: &Rect)
pub fn stroke_rect(&mut self, rect: &Rect)
Stroke a rectangle with current paint and stroke settings.
Sourcepub fn set_transform(&mut self, transform: Affine)
pub fn set_transform(&mut self, transform: Affine)
Set the transform for subsequent operations.
Sourcepub fn set_fill_rule(&mut self, fill_rule: Fill)
pub fn set_fill_rule(&mut self, fill_rule: Fill)
Set the fill rule for subsequent fill operations.
Sourcepub fn set_stroke(&mut self, stroke: Stroke)
pub fn set_stroke(&mut self, stroke: Stroke)
Set the stroke settings for subsequent stroke operations.
Sourcepub fn set_paint(&mut self, paint: impl Into<PaintType>)
pub fn set_paint(&mut self, paint: impl Into<PaintType>)
Set the paint for subsequent rendering operations.
Sourcepub fn set_paint_transform(&mut self, paint_transform: Affine)
pub fn set_paint_transform(&mut self, paint_transform: Affine)
Set the current paint transform.
Sourcepub fn reset_paint_transform(&mut self)
pub fn reset_paint_transform(&mut self)
Reset the current paint transform.
Sourcepub fn push_layer(
&mut self,
clip_path: Option<&BezPath>,
blend_mode: Option<BlendMode>,
opacity: Option<f32>,
mask: Option<Mask>,
)
pub fn push_layer( &mut self, clip_path: Option<&BezPath>, blend_mode: Option<BlendMode>, opacity: Option<f32>, mask: Option<Mask>, )
Push a new layer with the given properties.
Sourcepub fn push_clip_layer(&mut self, clip_path: &BezPath)
pub fn push_clip_layer(&mut self, clip_path: &BezPath)
Push a new clip layer.
Sourcepub fn glyph_run(&mut self, font: &Font) -> GlyphRunBuilder<'_, Self>
pub fn glyph_run(&mut self, font: &Font) -> GlyphRunBuilder<'_, Self>
Creates a builder for drawing a run of glyphs that have the same attributes.
Trait Implementations§
Source§impl<'a> GlyphRenderer for Recorder<'a>
impl<'a> GlyphRenderer for Recorder<'a>
Source§fn fill_glyph(&mut self, glyph: PreparedGlyph<'_>)
fn fill_glyph(&mut self, glyph: PreparedGlyph<'_>)
Fill glyphs with the current paint and fill rule.
Source§fn stroke_glyph(&mut self, glyph: PreparedGlyph<'_>)
fn stroke_glyph(&mut self, glyph: PreparedGlyph<'_>)
Stroke glyphs with the current paint and stroke settings.
Auto Trait Implementations§
impl<'a> Freeze for Recorder<'a>
impl<'a> RefUnwindSafe for Recorder<'a>
impl<'a> Send for Recorder<'a>
impl<'a> Sync for Recorder<'a>
impl<'a> Unpin for Recorder<'a>
impl<'a> !UnwindSafe for Recorder<'a>
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