[−][src]Trait linfb::shape::Shape
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.
Provided methods
fn at(self, x: usize, y: usize) -> PositionedShape where
Self: Sized + 'static,
Self: Sized + 'static,
Convert self into PositionedShape
, saving position info. Needed for
Compositor
.
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.