pub fn raw_sub_rgba_buffer(&self, x: usize, y: usize, width: usize, height: usize) -> Vec<u8> {
        let mut sub = Vec::with_capacity(width * height * 4);
        for _y in y..(y + height) {
            for _x in x..(x + width) {
                if _y > self.height || _x > self.width {
                    panic!("Pixel access is out of bounds");
                }
                sub.extend_from_slice(&self.pixel(_x, _y).unwrap().0);
            }
        }
        return sub
    }
/// Creates a raw sub buffer from self.
///
/// # Panics
///
/// Panics if a pixel access is out of bounds.
Creates a raw sub buffer from self.
Creates a raw sub buffer from self .
pub fn raw_sub_rgba_buffer(&self, x: usize, y: usize, width: usize, height: usize) -> Vec<u8> {
        let mut sub = Vec::with_capacity(width * height * 4);
        for _y in y..(y + height) {
            for _x in x..(x + width) {
                if _y > self.height || _x > self.width {
                    panic!("Pixel access is out of bounds");
                }
                sub.extend_from_slice(&self.pixel(_x, _y).unwrap().0);
            }
        }
        return sub
    }
pub fn raw_sub_rgba_buffer ( & self , x : usize , y : usize , width : usize , height : usize ) -> Vec < u8 > { let mut sub = Vec :: with_capacity ( width * height * 4 ) ; for _y in y .. ( y + height ) { for _x in x .. ( x + width ) { if _y > self . height || _x > self . width { panic ! ( " " ) ; } sub . extend_from_slice ( & self . pixel ( _x , _y ) . unwrap ( ) . 0 ) ; } } return sub }
Creates a raw sub buffer from self.
Creates a raw sub buffer from self .
&self
x
usize
y
usize
width
usize
height
usize
&self
x
usize
y
usize
width
usize
height
usize
panics
Panics if a pixel access is out of bounds.
Panics if a pixel access is out of bounds .