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

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

Draw a hollow rectangle from x1,y1 to x2,y2 in color

Draw a hollow circle at x,y with radius in 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

Update a pixel color, using [PixelWrapper::set_pixel] or [PixelWrapper::blend_pixel] depending on whether colors alpha is 255 or not

Implementors