CIContext
class CIContext : NSObject
-
Factory for creating a CIContext using the available graphics API.
Declaration
Swift
public class func createDefaultCIContext(_ mtlDevice: MTLDevice? = nil) -> CIContext?Parameters
mtlDeviceProcessor for computing
Return Value
Default configuration rendering context, otherwise nil.
-
Creates a UIImage from the given sample buffer input
Declaration
Swift
public func uiimage(withSampleBuffer sampleBuffer: CMSampleBuffer) -> UIImage?Parameters
sampleBuffersample buffer input
Return Value
UIImage from the sample buffer, otherwise nil
-
Creates a UIImage from the given pixel buffer input
Declaration
Swift
public func uiimage(withPixelBuffer pixelBuffer: CVPixelBuffer) -> UIImage?Parameters
pixelBufferPixel buffer input
Return Value
UIImage from the pixel buffer, otherwise nil
-
Orient a pixel buffer using an exif orientation value.
Declaration
Swift
@available(iOS 11.0, *) public func createPixelBuffer(fromPixelBuffer pixelBuffer: CVPixelBuffer, withOrientation orientation: CGImagePropertyOrientation, pixelBufferPool: CVPixelBufferPool) -> CVPixelBuffer?Parameters
pixelBufferPixel buffer input
orientationCGImage orientation for the new pixel buffer
pixelBufferPoolPixel buffer pool at which to allocate the new buffer
Return Value
Oriented pixel buffer, otherwise nil
-
Create a pixel buffer from a MTLTexture and orientation value.
Declaration
Swift
@available(iOS 11.0, *) public func createPixelBuffer(fromMTLTexture mtlTexture: MTLTexture, withOrientation orientation: CGImagePropertyOrientation, pixelBufferPool: CVPixelBufferPool) -> CVPixelBuffer?Parameters
mtlTextureInput texture to render
orientationCGImage orientation for the new pixel buffer
pixelBufferPoolPixel buffer pool at which to allocate the new buffer
Return Value
Oriented pixel buffer, otherwise nil
View on GitHub
CIContext Extension Reference