pub fn read<F>(&self, callback: F)
    where
        F: 'static + FnOnce(Result<Rgba8AsyncMappedImageBuffer, ()>),
    {
        let [width, height] = self.buffer.size();
        self.buffer.read(move |result| {
            let result = result.map(move |mapping| {
                let mapping = Rgba8AsyncMapping { mapping };
                Rgba8AsyncMappedImageBuffer(
                    image::ImageBuffer::from_raw(width, height, mapping)
                        .expect("image buffer dimensions did not match mapping"),
                )
            });
            callback(result);
        })
    }
/// Reads the non-linear sRGBA image from mapped memory.
///
/// Specifically, this asynchronously maps the buffer of bytes from GPU to host memory and,
/// once mapped, calls the given user callback with the data represented as an
/// `Rgba8AsyncMapping`.
///
/// Note: The given callback will not be called until the memory is mapped and the device is
/// polled. You should not rely on the callback being called immediately.
///
/// The given callback will be called on the current thread. If you would like the callback to
/// be processed on a thread pool, see the `read_threaded` method.
Reads the non-linear sRGBA image from mapped memory.
Specifically, this asynchronously maps the buffer of bytes from GPU to host memory and,
once mapped, calls the given user callback with the data represented as an
`Rgba8AsyncMapping`.

The given callback will not be called until the memory is mapped and the device is
polled. You should not rely on the callback being called immediately.

The given callback will be called on the current thread. If you would like the callback to
be processed on a thread pool, see the `read_threaded` method.
Reads the non - linear sRGBA image from mapped memory . Specifically this asynchronously maps the buffer of bytes from GPU to host memory and once mapped calls the given user callback with the data represented as an ` Rgba8AsyncMapping ` . The given callback will not be called until the memory is mapped and the device is polled . You should not rely on the callback being called immediately . The given callback will be called on the current thread . If you would like the callback to be processed on a thread pool see the ` read_threaded ` method .
pub fn read<F>(&self, callback: F)
    where
        F: 'static + FnOnce(Result<Rgba8AsyncMappedImageBuffer, ()>),
    {
        let [width, height] = self.buffer.size();
        self.buffer.read(move |result| {
            let result = result.map(move |mapping| {
                let mapping = Rgba8AsyncMapping { mapping };
                Rgba8AsyncMappedImageBuffer(
                    image::ImageBuffer::from_raw(width, height, mapping)
                        .expect("image buffer dimensions did not match mapping"),
                )
            });
            callback(result);
        })
    }
pub fn read < F > ( & self , callback : F ) where F : ' static + FnOnce ( Result < Rgba8AsyncMappedImageBuffer , ( ) > ) , { let [ width , height ] = self . buffer . size ( ) ; self . buffer . read ( move | result | { let result = result . map ( move | mapping | { let mapping = Rgba8AsyncMapping { mapping } ; Rgba8AsyncMappedImageBuffer ( image :: ImageBuffer :: from_raw ( width , height , mapping ) . expect ( " " ) , ) } ) ; callback ( result ) ; } ) }
Reads the non-linear sRGBA image from mapped memory.
Reads the non - linear sRGBA image from mapped memory .
&self
callback
F
&self
callback
F