Function av_image_alloc

Source
pub unsafe extern "C" fn av_image_alloc(
    pointers: *mut *mut u8,
    linesizes: *mut c_int,
    w: c_int,
    h: c_int,
    pix_fmt: AVPixelFormat,
    align: c_int,
) -> c_int
Expand description

Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordingly. The allocated image buffer has to be freed by using av_freep(&pointers[0]).

@param pointers array to be filled with the pointer for each image plane @param linesizes the array filled with the linesize for each plane @param w width of the image in pixels @param h height of the image in pixels @param pix_fmt the AVPixelFormat of the image @param align the value to use for buffer size alignment @return the size in bytes required for the image buffer, a negative error code in case of failure