Function

VTCreateCGImageFromCVPixelBuffer(_:options:imageOut:)

Creates a Core Graphics bitmap image or image mask using the provided pixel buffer.

Declaration

func VTCreateCGImageFromCVPixelBuffer(_ pixelBuffer: CVPixelBuffer, options: CFDictionary?, imageOut: UnsafeMutablePointer<CGImage?>) -> OSStatus

Parameters

pixelBuffer

The CVPixelBuffer object to be used as the image data source for the CGImage.

options

No options are currently supported. Pass NULL for this argument.

imageOut

Pointer to an address to receive the newly created CGImage.

Discussion

This routine creates a CGImage representation of the image data contained in the provided CVPixelBuffer. The source CVPixelBuffer may be retained for the lifetime of the CGImage. Changes to the CVPixelBuffer after making this call (other than releasing it) will have undefined results.

Not all CVPixelBuffer pixel formats support conversion into a CGImage-compatible pixel format.

See Also

Utilities

func VTRegisterProfessionalVideoWorkflowVideoDecoders()

Loads decoders appropriate for the client's professional video workflows.

func VTRegisterProfessionalVideoWorkflowVideoEncoders()

Loads encoders appropriate for the client's professional video workflows.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software