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?>) -> OSStatusParameters
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.