Trait floem::Renderer

source ·
pub trait Renderer {
    // Required methods
    fn begin(&mut self, capture: bool);
    fn 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>(
        &mut self,
        shape: &impl Shape,
        brush: impl Into<BrushRef<'b>>,
        width: f64
    );
    fn fill<'b>(
        &mut self,
        path: &impl Shape,
        brush: impl Into<BrushRef<'b>>,
        blur_radius: f64
    );
    fn draw_text(&mut self, layout: &TextLayout, pos: impl Into<Point>);
    fn draw_svg<'b>(
        &mut self,
        svg: Svg<'b>,
        rect: Rect,
        brush: Option<impl Into<BrushRef<'b>>>
    );
    fn draw_img(&mut self, img: Img<'_>, rect: Rect);
    fn finish(&mut self) -> Option<DynamicImage>;
}

Required Methods§

source

fn begin(&mut self, capture: bool)

source

fn 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>( &mut self, shape: &impl Shape, brush: impl Into<BrushRef<'b>>, width: f64 )

Stroke a Shape.

source

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

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

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 draw_svg<'b>( &mut self, svg: Svg<'b>, rect: Rect, brush: Option<impl Into<BrushRef<'b>>> )

source

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

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Renderer for TinySkiaRenderer

source§

fn begin(&mut self, _capture: bool)

source§

fn stroke<'b>( &mut self, shape: &impl Shape, brush: impl Into<BrushRef<'b>>, width: f64 )

source§

fn fill<'b>( &mut self, shape: &impl Shape, brush: impl Into<BrushRef<'b>>, _blur_radius: f64 )

source§

fn draw_text(&mut self, layout: &TextLayout, 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<BrushRef<'b>>> )

source§

fn 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<DynamicImage>

source§

impl Renderer for VgerRenderer

source§

fn begin(&mut self, capture: bool)

source§

fn stroke<'b>( &mut self, shape: &impl Shape, brush: impl Into<BrushRef<'b>>, width: f64 )

source§

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

source§

fn draw_text(&mut self, layout: &TextLayout, 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<BrushRef<'b>>> )

source§

fn 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<DynamicImage>

Implementors§