Struct Recorder

Source
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>

Source

pub fn new(recording: &'a mut Recording) -> Self

Create a new recorder for the given recording.

Source

pub fn fill_path(&mut self, path: &BezPath)

Fill a path with current paint and fill rule.

Source

pub fn stroke_path(&mut self, path: &BezPath)

Stroke a path with current paint and stroke settings.

Source

pub fn fill_rect(&mut self, rect: &Rect)

Fill a rectangle with current paint and fill rule.

Source

pub fn stroke_rect(&mut self, rect: &Rect)

Stroke a rectangle with current paint and stroke settings.

Source

pub fn set_transform(&mut self, transform: Affine)

Set the transform for subsequent operations.

Source

pub fn set_fill_rule(&mut self, fill_rule: Fill)

Set the fill rule for subsequent fill operations.

Source

pub fn set_stroke(&mut self, stroke: Stroke)

Set the stroke settings for subsequent stroke operations.

Source

pub fn set_paint(&mut self, paint: impl Into<PaintType>)

Set the paint for subsequent rendering operations.

Source

pub fn set_paint_transform(&mut self, paint_transform: Affine)

Set the current paint transform.

Source

pub fn reset_paint_transform(&mut self)

Reset the current paint transform.

Source

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.

Source

pub fn push_clip_layer(&mut self, clip_path: &BezPath)

Push a new clip layer.

Source

pub fn pop_layer(&mut self)

Pop the last pushed layer.

Source

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> Debug for Recorder<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> GlyphRenderer for Recorder<'a>

Source§

fn fill_glyph(&mut self, glyph: PreparedGlyph<'_>)

Fill glyphs with the current paint and fill rule.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.