UIImage

class UIImage : NSObject, NSSecureCoding
  • Resizes the image to width x height and converts it to an RGB CVPixelBuffer.

    Declaration

    Swift

    public func pixelBuffer(width: Int, height: Int) -> CVPixelBuffer?
  • Resizes the image to width x height and converts it to a grayscale CVPixelBuffer.

    Declaration

    Swift

    public func pixelBufferGray(width: Int, height: Int) -> CVPixelBuffer?
  • Declaration

    Swift

    func pixelBuffer(width: Int, height: Int, pixelFormatType: OSType,
                     colorSpace: CGColorSpace, alphaInfo: CGImageAlphaInfo) -> CVPixelBuffer?
  • Creates a new UIImage from a CVPixelBuffer. NOTE: This only works for RGB pixel buffers, not for grayscale.

    Declaration

    Swift

    public convenience init?(pixelBuffer: CVPixelBuffer)
  • Creates a new UIImage from a CVPixelBuffer, using Core Image.

    Declaration

    Swift

    public convenience init?(pixelBuffer: CVPixelBuffer, context: CIContext)