[][src]Struct linfb::Compositor

pub struct Compositor {
    pub width: usize,
    pub height: usize,
    pub background: Color,
    // some fields omitted
}

Shape that can contain other shapes. Can deal with transparency and overlaps.

Fields

width: usize

Width of compositor in pixels

height: usize

Height of compositor in pixels

background: Color

Background color. Transparent backgrounds will be treated as if they're placed over black background

Methods

impl Compositor[src]

pub fn new(width: usize, height: usize, background: Color) -> Self[src]

Create empty compositor with given size and background

pub fn builder() -> CompositorBuilder[src]

Create a default CompositorBuilder

pub fn add(&mut self, name: &str, shape: PositionedShape) -> &mut Self[src]

Add a PositionedShape with given name. Later you can get a reference to shape by it's name.

Uniqueness of names is not enforced, but recommended

pub fn get_positioned(&mut self, name: &str) -> Option<&mut PositionedShape>[src]

Get a previously added PositionedShape by it's name. Will return None if shape with such name was never added.

pub fn get<T: Shape>(&mut self, name: &str) -> Option<&mut T>[src]

Get inner shape of previously added PositionedShape by it's name. Will return None if shape with such name was never added or has a different type. Use it like this:

let rect: &mut Rectangle = compositor.get("rectangle_name").unwrap();

Trait Implementations

impl Shape for Compositor[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T

impl<T> Downcast for T where
    T: Any
[src]