Trait avrox_display::gfx::Renderable

source ·
pub trait Renderable {
    type PIXEL;

    // Required method
    fn get_pixel_at<P: RenderPlane>(
        &self,
        coord: Point
    ) -> GfxResult<Self::PIXEL>;

    // Provided methods
    fn get_dimensions<P: RenderPlane>(&self) -> GfxResult<(XCoord, YCoord)> { ... }
    fn has_changes<P: RenderPlane>(&self) -> bool { ... }
    fn get_change_area<P: RenderPlane>(&self) -> GfxResult<Option<Area>> { ... }
}
Expand description

Trait implemented by any graphics command that is capable of being rendered onto a 2d plane

Required Associated Types§

Required Methods§

source

fn get_pixel_at<P: RenderPlane>(&self, coord: Point) -> GfxResult<Self::PIXEL>

Return the value of the pixel at the given X-Y coordinate

Provided Methods§

source

fn get_dimensions<P: RenderPlane>(&self) -> GfxResult<(XCoord, YCoord)>

Return the dimensions of this primitive. Other container types may use this to aid in optimisation or layout.

source

fn has_changes<P: RenderPlane>(&self) -> bool

Indicate if any of the content of this renderable has (or may have) changed.

source

fn get_change_area<P: RenderPlane>(&self) -> GfxResult<Option<Area>>

Return the area of this renderable that has (or may have) changed.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<FILE> Renderable for GreyscaleImage<FILE>
where FILE: Read + Seek,

§

type PIXEL = Grey

source§

impl<FILE> Renderable for MonochromeImage<FILE>
where FILE: Read + Seek,

source§

impl<LAYER1, LAYER2> Renderable for Overlay<LAYER1, LAYER2>
where LAYER1: Renderable, LAYER2: Renderable, LAYER2::PIXEL: Into<LAYER1::PIXEL>,

§

type PIXEL = <LAYER1 as Renderable>::PIXEL

source§

impl<LEFT, RIGHT, POSITION> Renderable for HorizontalPair<LEFT, RIGHT, POSITION>
where LEFT: Renderable, RIGHT: Renderable, RIGHT::PIXEL: Into<LEFT::PIXEL>, POSITION: Position,

§

type PIXEL = <LEFT as Renderable>::PIXEL

source§

impl<PIX> Renderable for FunctionFill<PIX>

§

type PIXEL = PIX

source§

impl<PIX> Renderable for SolidFill<PIX>
where PIX: Clone,

§

type PIXEL = PIX

source§

impl<PIX> Renderable for SevenSegmentHexDigit<PIX>
where PIX: Clone,

§

type PIXEL = PIX

source§

impl<PIX, FILL> Renderable for Rectangle<PIX, FILL>
where PIX: Clone, FILL: Renderable, FILL::PIXEL: Into<PIX>,

§

type PIXEL = PIX

source§

impl<const DIGITS: usize, const RADIX: u8, PIX, VALUE> Renderable for SevenSegmentDisplay<DIGITS, RADIX, PIX, VALUE>
where PIX: Clone, VALUE: OptionalDisplayAs<u32> + Clone,

§

type PIXEL = PIX

source§

impl<const X: XCoord, const Y: YCoord, R: Renderable> Renderable for ConstTranslate<X, Y, R>

§

type PIXEL = <R as Renderable>::PIXEL

source§

impl<const XF: XCoord, const YF: YCoord, R: Renderable> Renderable for ConstScaleUp<XF, YF, R>

§

type PIXEL = <R as Renderable>::PIXEL