Trait cosmic::iced_futures::core::image::Renderer

source ·
pub trait Renderer: Renderer {
    type Handle: Clone + Hash;

    // Required methods
    fn dimensions(&self, handle: &Self::Handle) -> Size<u32>;
    fn draw(
        &mut self,
        handle: Self::Handle,
        filter_method: FilterMethod,
        bounds: Rectangle,
        border_radius: [f32; 4],
    );
}
Expand description

A Renderer that can render raster graphics.

Required Associated Types§

source

type Handle: Clone + Hash

The image Handle to be displayed. Iced exposes its own default implementation of a Handle

Required Methods§

source

fn dimensions(&self, handle: &Self::Handle) -> Size<u32>

Returns the dimensions of an image for the given Handle.

source

fn draw( &mut self, handle: Self::Handle, filter_method: FilterMethod, bounds: Rectangle, border_radius: [f32; 4], )

Draws an image with the given Handle and inside the provided bounds.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Renderer for cosmic::iced_widget::Renderer

source§

impl<B> Renderer for cosmic::iced_winit::graphics::Renderer<B>
where B: Backend + Image,