aboutsummaryrefslogtreecommitdiff
path: root/evc/src/debug.rs
blob: 44b51cf10fd599672989c7c1cae34af8f84cd622 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::{frame::Frame, pixel::Pixel, view::View};

impl View<&mut Frame> {
    pub fn draw_box(&mut self, color: Pixel) {
        let w = self.size.0;
        let h = self.size.1;
        for x in 0..w {
            self[(x, 0)] = color;
            self[(x, h - 1)] = color;
        }
        for y in 0..h {
            self[(0, y)] = color;
            self[(w - 1, y)] = color;
        }
    }
}
impl Pixel {
    pub const RED: Pixel = Pixel { r: 255, g: 0, b: 0 };
    pub const GREEN: Pixel = Pixel { r: 0, g: 255, b: 0 };
    pub const BLUE: Pixel = Pixel { r: 0, g: 0, b: 255 };
}