pub struct Printer { /* private fields */ }
Expand description
A custom GameBoy SerialDevice
that emulates
how the GameBoy printer operated.
This device can be used to display printed images by games, check
a sample implementation in mizu
frontend crate.
Implementations
sourceimpl Printer
impl Printer
sourcepub fn get_image_buffer(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn get_image_buffer(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Returns the current printer image buffer
The format is in RGB. i.e. 3 bytes per pixel.
sourcepub fn get_image_size(&self) -> (u32, u32)
pub fn get_image_size(&self) -> (u32, u32)
Returns the current printer image size (width, height)
sourcepub fn clear_image_buffer(&mut self)
pub fn clear_image_buffer(&mut self)
Clear the current image buffer of the printer.
Trait Implementations
sourceimpl SerialDevice for Printer
impl SerialDevice for Printer
sourcefn exchange_bit_external_clock(&mut self, bit: bool) -> bool
fn exchange_bit_external_clock(&mut self, bit: bool) -> bool
A device implemnts this, when receiving a call from this function will
send a bit (return) and get a bit from the sender (bit
argument) Read more
Auto Trait Implementations
impl RefUnwindSafe for Printer
impl Send for Printer
impl Sync for Printer
impl Unpin for Printer
impl UnwindSafe for Printer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more