pub struct Screen { /* private fields */ }Implementations§
Source§impl Screen
impl Screen
Source§impl Screen
impl Screen
Sourcepub fn orientation(
&mut self,
orientation: Orientation,
) -> Result<(), ScreenError>
pub fn orientation( &mut self, orientation: Orientation, ) -> Result<(), ScreenError>
Sets the screens orientation
Sourcepub fn clear(&mut self) -> Result<(), ScreenError>
pub fn clear(&mut self) -> Result<(), ScreenError>
Clears the screen to white. Does not work correctly in landscape mode, switch to Portrait mode before using this function.
Sourcepub fn to_black(&mut self) -> Result<(), ScreenError>
pub fn to_black(&mut self) -> Result<(), ScreenError>
Clears the screen to black. Does not work correctly in landscape mode, switch to Portrait mode before using this function.
Sourcepub fn brightness(&mut self, level: u8) -> Result<(), ScreenError>
pub fn brightness(&mut self, level: u8) -> Result<(), ScreenError>
Sets the brightness of the screen. Level must be between 0 and 255. 0 is the brightest, 255 is the darkest.
Sourcepub fn screen_off(&mut self) -> Result<(), ScreenError>
pub fn screen_off(&mut self) -> Result<(), ScreenError>
Turns the screen off. It will still be powered on, but the screen will be black. To turn the screen back on, use the screen_on() function. Retains the current image.
Sourcepub fn screen_on(&mut self) -> Result<(), ScreenError>
pub fn screen_on(&mut self) -> Result<(), ScreenError>
Turns the screen on. The screen will display the last image that was drawn.
Sourcepub fn draw(
&mut self,
img: ImageBuffer<Rgb<u8>, Vec<u8>>,
) -> Result<(), ScreenError>
pub fn draw( &mut self, img: ImageBuffer<Rgb<u8>, Vec<u8>>, ) -> Result<(), ScreenError>
Draws an ImageBuffer to the screen.
The image must be 320x480 or 480x320. Although not checked, the orientation of the image should match the orientation of the screen.
Otherwise the screen will still interpret the image as if it were in the wrong orientation, part of the image may be cut off and the screen will wrap around to the start in rendering.
Auto Trait Implementations§
impl Freeze for Screen
impl !RefUnwindSafe for Screen
impl Send for Screen
impl !Sync for Screen
impl Unpin for Screen
impl !UnwindSafe for Screen
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more