CIContext

extension CIContext
  • Creates a UIImage from the given sample buffer input

    Declaration

    Swift

    public func uiimage(withSampleBuffer sampleBuffer: CMSampleBuffer) -> UIImage?

    Parameters

    sampleBuffer

    sample 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

    pixelBuffer

    Pixel 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

    pixelBuffer

    Pixel buffer input

    orientation

    CGImage orientation for the new pixel buffer

    pixelBufferPool

    Pixel buffer pool at which to allocate the new buffer

    Return Value

    Oriented pixel buffer, otherwise nil