Skip to main content

switch_img_alloc

Function switch_img_alloc 

Source
pub unsafe extern "C" fn switch_img_alloc(
    img: *mut switch_image_t,
    fmt: switch_img_fmt_t,
    d_w: c_uint,
    d_h: c_uint,
    align: c_uint,
) -> *mut switch_image_t
Expand description

\brief Open a descriptor, allocating storage for the underlying image

Returns a descriptor for storing an image of the given format. The storage for the descriptor is allocated on the heap.

\param[in] img Pointer to storage for descriptor. If this parameter is NULL, the storage for the descriptor will be allocated on the heap. \param[in] fmt Format for the image \param[in] d_w Width of the image \param[in] d_h Height of the image \param[in] align Alignment, in bytes, of the image buffer and each row in the image(stride).

\return Returns a pointer to the initialized image descriptor. If the img parameter is non-null, the value of the img parameter will be returned.