[−][src]Struct piano_keyboard::Keyboard2d
The returned 2d Keyboard with all calculated elements.
Fields
left_white_key: u8
right_white_key: u8
width: u16
height: u16
Methods
impl Keyboard2d
[src]
pub fn iter(&self) -> Iter<Element>
[src]
This function is the preferred way to iterate through all elements. The sequence is from left to right alternating keys in order: white,black,white,....,black,white
pub fn white_keys(&self, blind_as_white: bool) -> Vec<Rectangle>
[src]
This function allows to retrieve all white key rectangles - with or without blind.
pub fn black_keys(&self) -> Vec<Rectangle>
[src]
This function allows to retrieve all black key rectangles.
pub fn is_perfect(&self) -> bool
[src]
Is true for a keyboard without compromises on width/gaps. For example: cargo run --example make_png -- --width 811
Auto Trait Implementations
impl RefUnwindSafe for Keyboard2d
impl Send for Keyboard2d
impl Sync for Keyboard2d
impl Unpin for Keyboard2d
impl UnwindSafe for Keyboard2d
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,