【发布时间】:2019-11-18 00:00:59
【问题描述】:
目前我正在开发一个应用程序,我可以在其中捕获照片并将过滤器应用于照片。过滤器应用完美,但应用过滤器后,新图像大小高度宽度与捕获的图像交换。像这样
我无法弄清楚我在哪里犯了错误
let ciContext = CIContext(options: nil)
let coreimg = CIImage(image: AppDelegate.captured_iamge!)
let filter = CIFilter(name: CIFilterNames[indexPath.row])
filter!.setDefaults()
filter!.setValue(coreimg, forKey: kCIInputImageKey)
let filtered_img_data = filter!.value(forKey: kCIOutputImageKey) as! CIImage
let filtered_img_ref = ciContext.createCGImage(filtered_img_data, from: filtered_img_data.extent)
let img = UIImage(cgImage: filtered_img_ref!)
img_view.image = img
如果有人能帮忙就好了
【问题讨论】:
-
“更大”是指图像尺寸还是内存占用?
-
图片尺寸
标签: uiimageview swift4 core-image cifilter