pub fn with_buffer(
        api: Arc<Api>,
        format: k4a_image_format_t,
        width_pixels: i32,
        height_pixels: i32,
        stride_bytes: i32,
        buffer: *mut u8,
        buffer_size: usize,
        buffer_release_cb: k4a_memory_destroy_cb_t,
        buffer_release_cb_context: *mut (),
    ) -> Result<Image, Error> {
        let mut handle: k4a_image_t = ptr::null_mut();
        Error::from((api.k4a_image_create_from_buffer)(
            format,
            width_pixels,
            height_pixels,
            stride_bytes,
            buffer,
            buffer_size,
            buffer_release_cb,
            buffer_release_cb_context,
            &mut handle,
        ))
        .to_result_fn(|| Image::from_handle(api, handle))
    }
/// 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 with_buffer(
        api: Arc<Api>,
        format: k4a_image_format_t,
        width_pixels: i32,
        height_pixels: i32,
        stride_bytes: i32,
        buffer: *mut u8,
        buffer_size: usize,
        buffer_release_cb: k4a_memory_destroy_cb_t,
        buffer_release_cb_context: *mut (),
    ) -> Result<Image, Error> {
        let mut handle: k4a_image_t = ptr::null_mut();
        Error::from((api.k4a_image_create_from_buffer)(
            format,
            width_pixels,
            height_pixels,
            stride_bytes,
            buffer,
            buffer_size,
            buffer_release_cb,
            buffer_release_cb_context,
            &mut handle,
        ))
        .to_result_fn(|| Image::from_handle(api, handle))
    }
pub fn with_buffer ( api : Arc < Api > , format : k4a_image_format_t , width_pixels : i32 , height_pixels : i32 , stride_bytes : i32 , buffer : * mut u8 , buffer_size : usize , buffer_release_cb : k4a_memory_destroy_cb_t , buffer_release_cb_context : * mut ( ) , ) -> Result < Image , Error > { let mut handle : k4a_image_t = ptr :: null_mut ( ) ; Error :: from ( ( api . k4a_image_create_from_buffer ) ( format , width_pixels , height_pixels , stride_bytes , buffer , buffer_size , buffer_release_cb , buffer_release_cb_context , & mut handle , ) ) . to_result_fn ( | | Image :: from_handle ( api , handle ) ) }
Create an image from a pre-allocated buffer
Create an image from a pre - allocated buffer
api
Arc<Api>
format
k4a_image_format_t
width_pixels
i32
height_pixels
i32
stride_bytes
i32
buffer
*mut u8
buffer_size
usize
buffer_release_cb
k4a_memory_destroy_cb_t
buffer_release_cb_context
*mut ()