Navaron Bracke

remove unused extension function

... ... @@ -8,31 +8,6 @@ extension CVBuffer {
let cgImage = CIContext().createCGImage(ciImage, from: ciImage.extent)
return UIImage(cgImage: cgImage!)
}
var image1: UIImage {
// Lock the base address of the pixel buffer
CVPixelBufferLockBaseAddress(self, CVPixelBufferLockFlags.readOnly)
// Get the number of bytes per row for the pixel buffer
let baseAddress = CVPixelBufferGetBaseAddress(self)
// Get the number of bytes per row for the pixel buffer
let bytesPerRow = CVPixelBufferGetBytesPerRow(self)
// Get the pixel buffer width and height
let width = CVPixelBufferGetWidth(self)
let height = CVPixelBufferGetHeight(self)
// Create a device-dependent RGB color space
let colorSpace = CGColorSpaceCreateDeviceRGB()
// Create a bitmap graphics context with the sample buffer data
var bitmapInfo = CGBitmapInfo.byteOrder32Little.rawValue
bitmapInfo |= CGImageAlphaInfo.premultipliedFirst.rawValue & CGBitmapInfo.alphaInfoMask.rawValue
//let bitmapInfo: UInt32 = CGBitmapInfo.alphaInfoMask.rawValue
let context = CGContext(data: baseAddress, width: width, height: height, bitsPerComponent: 8, bytesPerRow: bytesPerRow, space: colorSpace, bitmapInfo: bitmapInfo)
// Create a Quartz image from the pixel data in the bitmap graphics context
let quartzImage = context?.makeImage()
// Unlock the pixel buffer
CVPixelBufferUnlockBaseAddress(self, CVPixelBufferLockFlags.readOnly)
// Create an image object from the Quartz image
return UIImage(cgImage: quartzImage!)
}
}
extension UIDeviceOrientation {
... ...