Trait buffer_graphics_lib::drawing::DrawingMethods
source · [−]pub trait DrawingMethods<T> {
fn draw_image(&mut self, start_x: T, start_y: T, image: &Image);
fn draw_line(&mut self, x1: T, y1: T, x2: T, y2: T, color: Color);
fn draw_rect(&mut self, x1: T, y1: T, x2: T, y2: T, color: Color);
fn draw_frame(&mut self, x1: T, y1: T, x2: T, y2: T, color: Color);
fn draw_circle(&mut self, x: T, y: T, radius: T, color: Color);
fn draw_circle_filled(&mut self, x: T, y: T, radius: T, color: Color);
fn get_pixel(&mut self, x: T, y: T, use_translate: bool) -> Option<Color>;
fn update_pixel(&mut self, x: T, y: T, color: Color);
}
Required Methods
sourcefn draw_image(&mut self, start_x: T, start_y: T, image: &Image)
fn draw_image(&mut self, start_x: T, start_y: T, image: &Image)
Draw an image at x
, y
Draw line from x1,y1
to x2,y2
in color
Draw a filled rectangle from x1,y1
to x2,y2
in color
sourcefn draw_frame(&mut self, x1: T, y1: T, x2: T, y2: T, color: Color)
fn draw_frame(&mut self, x1: T, y1: T, x2: T, y2: T, color: Color)
Draw a hollow rectangle from x1,y1
to x2,y2
in color
sourcefn draw_circle(&mut self, x: T, y: T, radius: T, color: Color)
fn draw_circle(&mut self, x: T, y: T, radius: T, color: Color)
Draw a hollow circle at x,y
with radius
in color
sourcefn draw_circle_filled(&mut self, x: T, y: T, radius: T, color: Color)
fn draw_circle_filled(&mut self, x: T, y: T, radius: T, color: Color)
Draw a filled circle at x,y
with radius
in color
Get the RGB values for a pixel Alpha will always be 255
If use_translate
is true than the x,y will be updated with self.translate
Although the method takes &mut self
it doesn’t mutate anything
sourcefn update_pixel(&mut self, x: T, y: T, color: Color)
fn update_pixel(&mut self, x: T, y: T, color: Color)
Update a pixel color, using [PixelWrapper::set_pixel] or [PixelWrapper::blend_pixel] depending
on whether color
s alpha is 255 or not