fn pixel_buffer_index(&self, x: i16, y: i16) -> Option<usize> {
        if x >= 0 && x < self.width as i16 && y >= 0 && y < self.height as i16 {
            Some(y as usize * self.width as usize + x as usize)
        } else {
            None
        }
    }
// Returns the index of the pixel in the buffer; if the pixel is outside the canvas, None is returned.
//
Returns the index of the pixel in the buffer; if the pixel is outside the canvas, None is returned.
Returns the index of the pixel in the buffer ; if the pixel is outside the canvas None is returned .
fn pixel_buffer_index(&self, x: i16, y: i16) -> Option<usize> {
        if x >= 0 && x < self.width as i16 && y >= 0 && y < self.height as i16 {
            Some(y as usize * self.width as usize + x as usize)
        } else {
            None
        }
    }
fn pixel_buffer_index ( & self , x : i16 , y : i16 ) -> Option < usize > { if x >= 0 && x < self . width as i16 && y >= 0 && y < self . height as i16 { Some ( y as usize * self . width as usize + x as usize ) } else { None } }
Returns the index of the pixel in the buffer; if the pixel is outside the canvas, None is returned.
Returns the index of the pixel in the buffer ; if the pixel is outside the canvas None is returned .
&self
x
i16
y
i16