Bitmap

Trait Bitmap 

Source
pub trait Bitmap {
    // Required methods
    fn create(&self, area: Area) -> Box<dyn Bitmap + 'static>;
    fn set_pixel(
        &mut self,
        point: Point,
        color: Color,
    ) -> Result<(), PixelabError>;
    fn fill(&mut self, color: Color) -> Result<(), PixelabError>;
    fn overlay(
        &mut self,
        fb: &mut Box<dyn Bitmap + 'static>,
        point: Point,
    ) -> Result<(), PixelabError>;
    fn buffer(&mut self) -> &mut BitmapFormat;
    fn area(&mut self) -> &mut Area;

    // Provided methods
    fn draw_line(
        &mut self,
        start_point: Point,
        end_point: Point,
        color: Color,
    ) -> Result<(), PixelabError> { ... }
    fn set_border(&mut self, color: Color) -> Result<(), PixelabError> { ... }
    fn draw_poly_line(
        &mut self,
        points: Vec<(Point, Color)>,
    ) -> Result<(), PixelabError> { ... }
}

Required Methods§

Source

fn create(&self, area: Area) -> Box<dyn Bitmap + 'static>

Source

fn set_pixel(&mut self, point: Point, color: Color) -> Result<(), PixelabError>

Source

fn fill(&mut self, color: Color) -> Result<(), PixelabError>

Source

fn overlay( &mut self, fb: &mut Box<dyn Bitmap + 'static>, point: Point, ) -> Result<(), PixelabError>

Source

fn buffer(&mut self) -> &mut BitmapFormat

Source

fn area(&mut self) -> &mut Area

Provided Methods§

Source

fn draw_line( &mut self, start_point: Point, end_point: Point, color: Color, ) -> Result<(), PixelabError>

Source

fn set_border(&mut self, color: Color) -> Result<(), PixelabError>

Source

fn draw_poly_line( &mut self, points: Vec<(Point, Color)>, ) -> Result<(), PixelabError>

Implementors§