pub fn write_chunks<W: Write>( buffer: &mut W, screen_data: &[u8], width: u32, height: u32, ) -> Result<()>