Struct vga::writers::Graphics640x480x16 [−][src]
pub struct Graphics640x480x16;
Expand description
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]
impl Graphics640x480x16
[src]pub const fn new() -> Graphics640x480x16
[src]
pub const fn new() -> Graphics640x480x16
[src]Creates a new Graphics640x480x16
.
Trait Implementations
impl Clone for Graphics640x480x16
[src]
impl Clone for Graphics640x480x16
[src]fn clone(&self) -> Graphics640x480x16
[src]
fn clone(&self) -> Graphics640x480x16
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for Graphics640x480x16
[src]
impl Debug for Graphics640x480x16
[src]impl Default for Graphics640x480x16
[src]
impl Default for Graphics640x480x16
[src]fn default() -> Graphics640x480x16
[src]
fn default() -> Graphics640x480x16
[src]Returns the “default value” for a type. Read more
impl GraphicsWriter<Color16> for Graphics640x480x16
[src]
impl GraphicsWriter<Color16> for Graphics640x480x16
[src]fn set_pixel(&self, x: usize, y: usize, 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 clear_screen(&self, color: Color16)
[src]
fn clear_screen(&self, color: Color16)
[src]Clears the screen by setting all pixels to the specified color
.
fn draw_line(&self, start: Point<isize>, end: Point<isize>, color: Color16)
[src]
fn draw_line(&self, start: Point<isize>, end: Point<isize>, color: Color16)
[src]Draws a line from start
to end
with the specified color
.
fn draw_character(&self, x: usize, y: usize, character: char, color: Color16)
[src]
fn draw_character(&self, x: usize, y: usize, character: char, color: Color16)
[src]Draws a character at the given (x, y)
coordinant to the specified color
.
fn get_frame_buffer(&self) -> *mut u8
[src]
fn get_frame_buffer(&self) -> *mut u8
[src]Returns the frame buffer for this vga mode.
impl Screen for Graphics640x480x16
[src]
impl Screen for Graphics640x480x16
[src]