Renderer

Trait Renderer 

Source
pub trait Renderer {
Show 15 methods // Required methods fn begin(&mut self, capture: bool); fn set_transform(&mut self, transform: Affine); fn set_z_index(&mut self, z_index: i32); fn clip(&mut self, shape: &impl Shape); fn clear_clip(&mut self); fn stroke<'b, 's>( &mut self, shape: &impl Shape, brush: impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>, stroke: &'s Stroke, ); fn fill<'b>( &mut self, path: &impl Shape, brush: impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>, blur_radius: f64, ); fn push_layer( &mut self, blend: impl Into<BlendMode>, alpha: f32, transform: Affine, clip: &impl Shape, ); fn pop_layer(&mut self); fn draw_text_with_layout<'b>( &mut self, layout: impl Iterator<Item = LayoutRun<'b>>, pos: impl Into<Point>, ); fn draw_svg<'b>( &mut self, svg: Svg<'b>, rect: Rect, brush: Option<impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>>, ); fn draw_img(&mut self, img: Img<'_>, rect: Rect); fn finish(&mut self) -> Option<ImageBrush>; // Provided methods fn draw_text(&mut self, layout: &TextLayout, pos: impl Into<Point>) { ... } fn debug_info(&self) -> String { ... }
}

Required Methods§

Source

fn begin(&mut self, capture: bool)

Source

fn set_transform(&mut self, transform: Affine)

Source

fn set_z_index(&mut self, z_index: i32)

Source

fn clip(&mut self, shape: &impl Shape)

Clip to a Shape.

Source

fn clear_clip(&mut self)

Source

fn stroke<'b, 's>( &mut self, shape: &impl Shape, brush: impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>, stroke: &'s Stroke, )

Stroke a Shape.

Source

fn fill<'b>( &mut self, path: &impl Shape, brush: impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>, blur_radius: f64, )

Fill a Shape, using the non-zero fill rule.

Source

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

Push a layer (This is not supported with Vger)

Source

fn pop_layer(&mut self)

Pop a layer (This is not supported with Vger)

Source

fn draw_text_with_layout<'b>( &mut self, layout: impl Iterator<Item = LayoutRun<'b>>, pos: impl Into<Point>, )

Source

fn draw_svg<'b>( &mut self, svg: Svg<'b>, rect: Rect, brush: Option<impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>>, )

Source

fn draw_img(&mut self, img: Img<'_>, rect: Rect)

Source

fn finish(&mut self) -> Option<ImageBrush>

Provided Methods§

Source

fn draw_text(&mut self, layout: &TextLayout, pos: impl Into<Point>)

Draw a TextLayout.

The pos parameter specifies the upper-left corner of the layout object (even for right-to-left text).

Source

fn debug_info(&self) -> String

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Renderer for VgerRenderer

Source§

fn begin(&mut self, capture: bool)

Source§

fn stroke<'b, 's>( &mut self, shape: &impl Shape, brush: impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>, stroke: &'s Stroke, )

Source§

fn fill<'b>( &mut self, path: &impl Shape, brush: impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>, blur_radius: f64, )

Source§

fn draw_text_with_layout<'b>( &mut self, layout: impl Iterator<Item = LayoutRun<'b>>, pos: impl Into<Point>, )

Source§

fn draw_img(&mut self, img: Img<'_>, rect: Rect)

Source§

fn draw_svg<'b>( &mut self, svg: Svg<'b>, rect: Rect, brush: Option<impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>>, )

Source§

fn set_transform(&mut self, transform: Affine)

Source§

fn set_z_index(&mut self, z_index: i32)

Source§

fn clip(&mut self, shape: &impl Shape)

Source§

fn clear_clip(&mut self)

Source§

fn finish(&mut self) -> Option<ImageBrush>

Source§

fn push_layer( &mut self, _blend: impl Into<BlendMode>, _alpha: f32, _transform: Affine, _clip: &impl Shape, )

Source§

fn pop_layer(&mut self)

Source§

fn debug_info(&self) -> String

Source§

impl<W> Renderer for TinySkiaRenderer<W>

Source§

fn begin(&mut self, _capture: bool)

Source§

fn stroke<'b, 's>( &mut self, shape: &impl Shape, brush: impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>, stroke: &'s Stroke, )

Source§

fn fill<'b>( &mut self, shape: &impl Shape, brush: impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>, blur_radius: f64, )

Source§

fn draw_text_with_layout<'b>( &mut self, layout: impl Iterator<Item = LayoutRun<'b>>, pos: impl Into<Point>, )

Source§

fn draw_img(&mut self, img: Img<'_>, rect: Rect)

Source§

fn draw_svg<'b>( &mut self, svg: Svg<'b>, rect: Rect, brush: Option<impl Into<Brush<ImageBrush<&'b ImageData>, &'b Gradient>>>, )

Source§

fn set_transform(&mut self, cumulative_transform: Affine)

Source§

fn set_z_index(&mut self, _z_index: i32)

Source§

fn clip(&mut self, shape: &impl Shape)

Source§

fn clear_clip(&mut self)

Source§

fn finish(&mut self) -> Option<ImageBrush>

Source§

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

Source§

fn pop_layer(&mut self)

Source§

fn debug_info(&self) -> String

Implementors§