pub trait Background<R: Renderer>: Sized {
    // Required methods
    fn width(&self) -> Length;
    fn height(&self) -> Length;
    fn aspect_ratio_fixed(&self) -> bool;
    fn pixel_dims(&self, renderer: &R) -> (u16, u16);
    fn draw(
        &self,
        renderer: &mut R,
        defaults: &R::Defaults,
        layout: Layout<'_>,
        cursor_position: Point,
        viewport: &Rectangle,
    ) -> R::Output;
}

Required Methods§

source

fn width(&self) -> Length

source

fn height(&self) -> Length

source

fn aspect_ratio_fixed(&self) -> bool

source

fn pixel_dims(&self, renderer: &R) -> (u16, u16)

source

fn draw( &self, renderer: &mut R, defaults: &R::Defaults, layout: Layout<'_>, cursor_position: Point, viewport: &Rectangle, ) -> R::Output

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<R> Background<R> for CompoundGraphic
where R: Renderer,

source§

impl<R> Background<R> for Image
where R: Renderer,