[][src]Trait linfb::shape::Shape

pub trait Shape: Downcast {
    fn render(&self) -> Vec<Vec<Option<Color>>>;

    fn at(self, x: usize, y: usize) -> PositionedShape
    where
        Self: Sized + 'static
, { ... } }

Something you can draw on framebuffer

Required methods

fn render(&self) -> Vec<Vec<Option<Color>>>

Create a two-dimensional array of pixels. Every row must have the same length.

None means "no pixel at all" and semantically equivalent to (0, 0, 0, 0).into(), but can have better performance.

Loading content...

Provided methods

fn at(self, x: usize, y: usize) -> PositionedShape where
    Self: Sized + 'static, 

Convert self into PositionedShape, saving position info. Needed for Compositor.

Loading content...

Methods

impl dyn Shape

pub fn is<__T: Shape>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: Shape>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn't.

pub fn downcast_ref<__T: Shape>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn't.

pub fn downcast_mut<__T: Shape>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn't.

Implementors

impl Shape for Caption[src]

impl Shape for Image[src]

impl Shape for Rectangle[src]

impl Shape for Compositor[src]

Loading content...