Struct vga::writers::Graphics640x480x16 [−][src]
A basic interface for interacting with vga graphics mode 640x480x16
Examples
Basic usage:
use vga::colors::Color16; use vga::writers::{Graphics640x480x16, GraphicsWriter}; let mode = Graphics640x480x16::new(); mode.set_mode(); mode.clear_screen(Color16::Black); mode.draw_line((80, 60), (80, 420), Color16::White); mode.draw_line((80, 60), (540, 60), Color16::White); mode.draw_line((80, 420), (540, 420), Color16::White); mode.draw_line((540, 420), (540, 60), Color16::White); mode.draw_line((80, 90), (540, 90), Color16::White); for (offset, character) in "Hello World!".chars().enumerate() { mode.draw_character(270 + offset * 8, 72, character, Color16::White) }
Implementations
impl Graphics640x480x16
[src]
pub const fn new() -> Graphics640x480x16
[src]
Creates a new Graphics640x480x16
.
Trait Implementations
impl Clone for Graphics640x480x16
[src]
fn clone(&self) -> Graphics640x480x16
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Graphics640x480x16
[src]
impl Debug for Graphics640x480x16
[src]
impl Default for Graphics640x480x16
[src]
fn default() -> Graphics640x480x16
[src]
impl GraphicsWriter<Color16> for Graphics640x480x16
[src]
fn clear_screen(&self, color: Color16)
[src]
fn draw_line(&self, start: Point<isize>, end: Point<isize>, color: Color16)
[src]
fn draw_character(&self, x: usize, y: usize, character: char, color: Color16)
[src]
fn set_pixel(&self, x: usize, y: usize, color: Color16)
[src]
Note: This method is provided for convenience, but has terrible
performance since it needs to ensure the correct WriteMode
per pixel
drawn. If you need to draw more then one pixel, consider using a method
such as draw_line
.
fn set_mode(&self)
[src]
fn get_frame_buffer(&self) -> *mut u8
[src]
impl Screen for Graphics640x480x16
[src]
Auto Trait Implementations
impl Send for Graphics640x480x16
[src]
impl Sync for Graphics640x480x16
[src]
impl Unpin for Graphics640x480x16
[src]
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,
pub 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.
pub 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>,