CVPixelBufferCreate

Function CVPixelBufferCreate 

Source
pub unsafe extern "C-unwind" fn CVPixelBufferCreate(
    allocator: Option<&CFAllocator>,
    width: usize,
    height: usize,
    pixel_format_type: u32,
    pixel_buffer_attributes: Option<&CFDictionary>,
    pixel_buffer_out: NonNull<*mut CVPixelBuffer>,
) -> CVReturn
Available on crate features CVBuffer and CVImageBuffer and CVPixelBuffer and CVReturn only.
Expand description

Call to create a single PixelBuffer for a given size and pixelFormatType.

Creates a single PixelBuffer for a given size and pixelFormatType. It allocates the necessary memory based on the pixel dimensions, pixelFormatType and extended pixels described in the pixelBufferAttributes. Not all parameters of the pixelBufferAttributes will be used here.

Parameter width: Width of the PixelBuffer in pixels.

Parameter height: Height of the PixelBuffer in pixels.

Parameter pixelFormatType: Pixel format indentified by its respective OSType.

Parameter pixelBufferAttributes: A dictionary with additional attributes for a pixel buffer. This parameter is optional. See BufferAttributeKeys for more details.

Parameter pixelBufferOut: The new pixel buffer will be returned here

Returns: returns kCVReturnSuccess on success.

ยงSafety

  • pixel_buffer_attributes generics must be of the correct type.
  • pixel_buffer_out must be a valid pointer.