pub fn draw_rect_outline(&self, frame: &mut [u8], rect: &(usize, usize, usize, usize), stride: usize, color: [u8; 4]) {

        let y = rect.1;
        for x in rect.0..rect.0+rect.2 {
            let mut i = x * 4 + y * stride * 4;
            frame[i..i + 4].copy_from_slice(&color);

            i = x * 4 + (y + rect.3- 1) * stride * 4;
            frame[i..i + 4].copy_from_slice(&color);
        }

        let x = rect.0;
        for y in rect.1..rect.1+rect.3 {
            let mut i = x * 4 + y * stride * 4;
            frame[i..i + 4].copy_from_slice(&color);

            i = (x + rect.2 - 1) * 4 + y * stride * 4;
            frame[i..i + 4].copy_from_slice(&color);
        }
    }
/// Draws the outline of a given rectangle
Draws the outline of a given rectangle
Draws the outline of a given rectangle
pub fn draw_rect_outline(&self, frame: &mut [u8], rect: &(usize, usize, usize, usize), stride: usize, color: [u8; 4]) {
        let y = rect.1;
        for x in rect.0..rect.0+rect.2 {
            let mut i = x * 4 + y * stride * 4;
            frame[i..i + 4].copy_from_slice(&color);
            i = x * 4 + (y + rect.3- 1) * stride * 4;
            frame[i..i + 4].copy_from_slice(&color);
        }
        let x = rect.0;
        for y in rect.1..rect.1+rect.3 {
            let mut i = x * 4 + y * stride * 4;
            frame[i..i + 4].copy_from_slice(&color);
            i = (x + rect.2 - 1) * 4 + y * stride * 4;
            frame[i..i + 4].copy_from_slice(&color);
        }
    }
pub fn draw_rect_outline ( & self , frame : & mut [ u8 ] , rect : & ( usize , usize , usize , usize ) , stride : usize , color : [ u8 ; 4 ] ) { let y = rect . 1 ; for x in rect . 0 .. rect . 0 + rect . 2 { let mut i = x * 4 + y * stride * 4 ; frame [ i .. i + 4 ] . copy_from_slice ( & color ) ; i = x * 4 + ( y + rect . 3 - 1 ) * stride * 4 ; frame [ i .. i + 4 ] . copy_from_slice ( & color ) ; } let x = rect . 0 ; for y in rect . 1 .. rect . 1 + rect . 3 { let mut i = x * 4 + y * stride * 4 ; frame [ i .. i + 4 ] . copy_from_slice ( & color ) ; i = ( x + rect . 2 - 1 ) * 4 + y * stride * 4 ; frame [ i .. i + 4 ] . copy_from_slice ( & color ) ; } }
Draws the outline of a given rectangle
Draws the outline of a given rectangle
&self
frame
&mut [u8]
rect
&(usize, usize, usize, usize)
stride
usize
color
[u8; 4]
&self
frame
&mut [u8]
rect
&(usize, usize, usize, usize)
stride
usize
color
[u8; 4]