[][src]Function k4a_sys::k4a_image_create

pub unsafe extern "C" fn k4a_image_create(
    format: k4a_image_format_t,
    width_pixels: c_int,
    height_pixels: c_int,
    stride_bytes: c_int,
    image_handle: *mut k4a_image_t
) -> k4a_result_t

Create an image.

\param format The format of the image that will be stored in this image container.

\param width_pixels Width in pixels.

\param height_pixels Height in pixels.

\param stride_bytes The number of bytes per horizontal line of the image.

\param image_handle Pointer to store image handle in.

\remarks This function is used to create images of formats that have consistent stride. The function is not suitable for compressed formats that may not be represented by the same number of bytes per line.

\remarks For most image formats, the function will allocate an image buffer of size \p height_pixels * \p stride_bytes. Buffers #K4A_IMAGE_FORMAT_COLOR_NV12 format will allocate an additional \p height_pixels / 2 set of lines (each of \p stride_bytes). This function cannot be used to allocate #K4A_IMAGE_FORMAT_COLOR_MJPG buffers.

\remarks To create an image object without the API allocating memory, or to represent an image that has a non-deterministic stride, use k4a_image_create_from_buffer().

\remarks The \ref k4a_image_t is created with a reference count of 1.

\remarks When finished using the created image, release it with k4a_image_release.

\returns Returns #K4A_RESULT_SUCCEEDED on success. Errors are indicated with #K4A_RESULT_FAILED.

\relates k4a_image_t

\xmlonly k4a.h (include k4a/k4a.h) k4a.lib k4a.dll \endxmlonly