pub fn update_pixels<I>(&mut self, x: u32, y: u32, pixels: I) -> Option<u32>
    where
        I: Iterator<Item = RGBA>,
    {
        self.frame_buffer_handle
            .seek(SeekFrom::Start((self.resolution.0 * y + x) as u64 * 4))
            .ok()?;

        let mut bytes_written = 0;
        for pixel in pixels {
            // TODO: if this is too slow, try stepping the iterator by a larger
            // amount and feeding more bytes at a time to the write calls
            bytes_written += self.frame_buffer_handle.write(&pixel.as_bytes()).ok()?;
        }

        Some(bytes_written as u32)
    }
/// Updates the buffer starting at position (x,y) with the specified colors
/// If the length of `pixels` + x is greater than the max length of the row,
/// drawing will continue at (0, y + 1) and so on.
///
/// Returns `None` if something went wrong, otherwise returns the numbers of pixels
/// written to the buffer.
///
/// To be able to see these updates, you must call `draw`
Updates the buffer starting at position (x,y) with the specified colors
If the length of `pixels` + x is greater than the max length of the row,
drawing will continue at (0, y + 1) and so on.

Returns `None` if something went wrong, otherwise returns the numbers of pixels
written to the buffer.

To be able to see these updates, you must call `draw`
Updates the buffer starting at position ( x y ) with the specified colors If the length of ` pixels ` + x is greater than the max length of the row drawing will continue at ( 0 y + 1 ) and so on . Returns ` None ` if something went wrong otherwise returns the numbers of pixels written to the buffer . To be able to see these updates you must call ` draw `
pub fn update_pixels<I>(&mut self, x: u32, y: u32, pixels: I) -> Option<u32>
    where
        I: Iterator<Item = RGBA>,
    {
        self.frame_buffer_handle
            .seek(SeekFrom::Start((self.resolution.0 * y + x) as u64 * 4))
            .ok()?;
        let mut bytes_written = 0;
        for pixel in pixels {
            // TODO: if this is too slow, try stepping the iterator by a larger
            // amount and feeding more bytes at a time to the write calls
            bytes_written += self.frame_buffer_handle.write(&pixel.as_bytes()).ok()?;
        }
        Some(bytes_written as u32)
    }
pub fn update_pixels < I > ( & mut self , x : u32 , y : u32 , pixels : I ) -> Option < u32 > where I : Iterator < Item = RGBA > , { self . frame_buffer_handle . seek ( SeekFrom :: Start ( ( self . resolution . 0 * y + x ) as u64 * 4 ) ) . ok ( ) ? ; let mut bytes_written = 0 ; for pixel in pixels { // TODO: if this is too slow, try stepping the iterator by a larger // amount and feeding more bytes at a time to the write calls bytes_written += self . frame_buffer_handle . write ( & pixel . as_bytes ( ) ) . ok ( ) ? ; } Some ( bytes_written as u32 ) }
Updates the buffer starting at position (x,y) with the specified colors
If the length of `pixels` + x is greater than the max length of the row,
drawing will continue at (0, y + 1) and so on.
Updates the buffer starting at position ( x y ) with the specified colors If the length of ` pixels ` + x is greater than the max length of the row drawing will continue at ( 0 y + 1 ) and so on .
&mut self
x
u32
y
u32
pixels
I
&mut self
x
u32
y
u32
pixels
I