[−][src]Struct linfb::Compositor
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
impl !Send for Compositor
impl !Sync for Compositor
impl Unpin for Compositor
impl !UnwindSafe for Compositor
impl !RefUnwindSafe for Compositor
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> Downcast for T where
T: Any,
[src]
T: Any,