/// Create an image from a pre-allocated buffer
Create an image from a pre-allocated buffer
Create an image from a pre - allocated buffer
pub fn image_create_from_buffer<T: FnOnce(*mut ())>(
        &self,
        format: ImageFormat,
        width_pixels: i32,
        height_pixels: i32,
        stride_bytes: i32,
        buffer: *mut u8,
        buffer_size: usize,
        buffer_release_cb: Box<T>,
    ) -> Result<Image, Error> {
        self.image_create_from_buffer_native(
            format.into(),
            width_pixels,
            height_pixels,
            stride_bytes,
            buffer,
            buffer_size,
            Some(Self::buffer_release_callback::<T>),
            Box::<T>::into_raw(buffer_release_cb) as _,
        )
    }
pub fn image_create_from_buffer < T : FnOnce ( * mut ( ) ) > ( & self , format : ImageFormat , width_pixels : i32 , height_pixels : i32 , stride_bytes : i32 , buffer : * mut u8 , buffer_size : usize , buffer_release_cb : Box < T > , ) -> Result < Image , Error > { self . image_create_from_buffer_native ( format . into ( ) , width_pixels , height_pixels , stride_bytes , buffer , buffer_size , Some ( Self :: buffer_release_callback :: < T > ) , Box :: < T > :: into_raw ( buffer_release_cb ) as _ , ) }
Create an image from a pre-allocated buffer
Create an image from a pre - allocated buffer
&self
format
ImageFormat
width_pixels
i32
height_pixels
i32
stride_bytes
i32
buffer
*mut u8
buffer_size
usize
buffer_release_cb
Box<T>