UIImage

  • 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?
  • 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)
  • Creates a new UIImage from an array of RGBA bytes.

    Declaration

    Swift

    @nonobjc public class func fromByteArrayRGBA(_ bytes: [UInt8],
                                                 width: Int,
                                                 height: Int,
                                                 scale: CGFloat = 0,
                                                 orientation: UIImageOrientation = .up) -> UIImage?
  • Creates a new UIImage from an array of grayscale bytes.

    Declaration

    Swift

    @nonobjc public class func fromByteArrayGray(_ bytes: [UInt8],
                                                 width: Int,
                                                 height: Int,
                                                 scale: CGFloat = 0,
                                                 orientation: UIImageOrientation = .up) -> UIImage?