pub struct Terminal { /* private fields */ }
Expand description
Terminal represents a simple terminal-like renderer.
Implementations§
source§impl Terminal
impl Terminal
sourcepub fn new(font_path: &str, char_width: usize, char_height: usize) -> Self
pub fn new(font_path: &str, char_width: usize, char_height: usize) -> Self
Create a new Terminal instance.
sourcepub fn load_characters(&mut self)
pub fn load_characters(&mut self)
Load characters from the font image and store them in the characters map.
sourcepub fn set_char(&mut self, x: usize, y: usize, character: char)
pub fn set_char(&mut self, x: usize, y: usize, character: char)
Set a character in the grid at the specified position.
sourcepub fn render(&self) -> DynamicImage
pub fn render(&self) -> DynamicImage
Render the grid to an image.
sourcepub fn get_raw_grid(&self) -> impl Iterator<Item = &Vec<char>>
pub fn get_raw_grid(&self) -> impl Iterator<Item = &Vec<char>>
Get an iterator over the raw grid data.
Auto Trait Implementations§
impl RefUnwindSafe for Terminal
impl Send for Terminal
impl Sync for Terminal
impl Unpin for Terminal
impl UnwindSafe for Terminal
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
Mutably borrows from an owned value. Read more