Trait cosmic::iced_runtime::core::image::Renderer

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

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

A Renderer that can render raster graphics.

Required Associated Types§

source

type Handle: Clone

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

Required Methods§

source

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

Returns the dimensions of an image for the given Handle.

source

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

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Renderer for ()

source§

type Handle = Handle

source§

fn measure_image(&self, _handle: &<() as Renderer>::Handle) -> Size<u32>

source§

fn draw_image( &mut self, _handle: <() as Renderer>::Handle, _filter_method: FilterMethod, _bounds: Rectangle, _rotation: Radians, _opacity: f32, _border_radius: [f32; 4], )

source§

impl Renderer for Renderer

source§

type Handle = Handle

source§

fn measure_image(&self, handle: &<Renderer as Renderer>::Handle) -> Size<u32>

source§

fn draw_image( &mut self, handle: <Renderer as Renderer>::Handle, filter_method: FilterMethod, bounds: Rectangle, rotation: Radians, opacity: f32, border_radius: [f32; 4], )

Implementors§

source§

impl<A, B> Renderer for cosmic::iced_widget::renderer::fallback::Renderer<A, B>
where A: Renderer, B: Renderer<Handle = <A as Renderer>::Handle>,