VelloScenePainter

Struct VelloScenePainter 

Source
pub struct VelloScenePainter<'r, 's> { /* private fields */ }

Implementations§

Source§

impl VelloScenePainter<'_, '_>

Source

pub fn new<'s>(scene: &'s mut Scene) -> VelloScenePainter<'static, 's>

Trait Implementations§

Source§

impl PaintScene for VelloScenePainter<'_, '_>

Source§

fn reset(&mut self)

Removes all content from the scene
Source§

fn push_layer( &mut self, blend: impl Into<BlendMode>, alpha: f32, transform: Affine, clip: &impl Shape, )

Pushes a new layer clipped by the specified shape and composed with previous layers using the specified blend mode. Every drawing command after this call will be clipped by the shape until the layer is popped. However, the transforms are not saved or modified by the layer stack.
Source§

fn push_clip_layer(&mut self, transform: Affine, clip: &impl Shape)

Pushes a new clip layer clipped by the specified shape. Every drawing command after this call will be clipped by the shape until the layer is popped. However, the transforms are not saved or modified by the layer stack.
Source§

fn pop_layer(&mut self)

Pops the current layer.
Source§

fn stroke<'a>( &mut self, style: &Stroke, transform: Affine, paint_ref: impl Into<PaintRef<'a>>, brush_transform: Option<Affine>, shape: &impl Shape, )

Strokes a shape using the specified style and brush.
Source§

fn fill<'a>( &mut self, style: Fill, transform: Affine, paint: impl Into<PaintRef<'a>>, brush_transform: Option<Affine>, shape: &impl Shape, )

Fills a shape using the specified style and brush.
Source§

fn draw_glyphs<'a, 's: 'a>( &'a mut self, font: &'a FontData, font_size: f32, hint: bool, normalized_coords: &'a [NormalizedCoord], style: impl Into<StyleRef<'a>>, paint: impl Into<PaintRef<'a>>, brush_alpha: f32, transform: Affine, glyph_transform: Option<Affine>, glyphs: impl Iterator<Item = Glyph>, )

Returns a builder for encoding a glyph run.
Source§

fn draw_box_shadow( &mut self, transform: Affine, rect: Rect, brush: Color, radius: f64, std_dev: f64, )

Draw a rounded rectangle blurred with a gaussian filter.
Source§

fn draw_image(&mut self, image: ImageBrush<&ImageData>, transform: Affine)

Utility method to draw an image at it’s natural size. For more advanced image drawing use the fill method

Auto Trait Implementations§

§

impl<'r, 's> Freeze for VelloScenePainter<'r, 's>

§

impl<'r, 's> !RefUnwindSafe for VelloScenePainter<'r, 's>

§

impl<'r, 's> !Send for VelloScenePainter<'r, 's>

§

impl<'r, 's> !Sync for VelloScenePainter<'r, 's>

§

impl<'r, 's> Unpin for VelloScenePainter<'r, 's>

§

impl<'r, 's> !UnwindSafe for VelloScenePainter<'r, 's>

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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, 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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>