Trait avrox_display::DisplayDevice

source ·
pub trait DisplayDevice: Send + Sync {
    type PIXEL;

    // Required methods
    fn reset(&self) -> GfxResult<()>;
    fn request_power_level(&self, level: PowerLevel) -> GfxResult<()>;
    fn render<RPIXEL, RENDERABLE>(&self, scene: &RENDERABLE) -> GfxResult<()>
       where RPIXEL: Into<Self::PIXEL>,
             RENDERABLE: Renderable<PIXEL = RPIXEL>;

    // Provided method
    fn render_changed<RPIXEL, RENDERABLE>(
        &self,
        scene: &RENDERABLE
    ) -> GfxResult<()>
       where RPIXEL: Into<Self::PIXEL>,
             RENDERABLE: Renderable<PIXEL = RPIXEL> { ... }
}

Required Associated Types§

source

type PIXEL

The type of pixel data this display renders

Required Methods§

source

fn reset(&self) -> GfxResult<()>

Reset the device to ‘power on’ configuration

source

fn request_power_level(&self, level: PowerLevel) -> GfxResult<()>

Request the display device moves to the indicated power level.

source

fn render<RPIXEL, RENDERABLE>(&self, scene: &RENDERABLE) -> GfxResult<()>
where RPIXEL: Into<Self::PIXEL>, RENDERABLE: Renderable<PIXEL = RPIXEL>,

Render the given scene in its entirety, replacing whatever is on the screen already

Provided Methods§

source

fn render_changed<RPIXEL, RENDERABLE>( &self, scene: &RENDERABLE ) -> GfxResult<()>
where RPIXEL: Into<Self::PIXEL>, RENDERABLE: Renderable<PIXEL = RPIXEL>,

Render only the parts of the display that have - or may have - changed since the last time it was rendered. The worst-case, always correct, implementation of this method will just redraw the entire display - however the driver may be able to make more efficient choices than that.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<CONFIG, CLIENT, DPIXEL> DisplayDevice for SolomonDisplay<CONFIG, CLIENT, DPIXEL>
where CONFIG: GenericConfig, CLIENT: SerialBusClient, DPIXEL: SolomonPixelConversion,

§

type PIXEL = DPIXEL