【发布时间】:2012-05-11 14:28:14
【问题描述】:
抱歉今天问了这么多问题,周五出现脑死症状。
我有一个 CICrop 过滤器:
[crop setValue:beginImage forKey:@"inputImage"]; //give the crop filter the beginImage
[crop setValue:[CIVector vectorWithX:0.0f Y:0.0f Z:_exportSize W:_exportSize] forKey:@"inputRectangle"]; //give the filter the size to crop to
croppedImage = [crop valueForKey:@"outputImage"]; //set the output image, note it's still a CIImage at this point
很遗憾,它不起作用。它裁剪的图像最终为 0x0 像素。 _exportSize(它是一个 CGFloat)的快速 NSLog 显示它是 1024,但日志显示图像裁剪后是 0x0。我不知道为什么。
此代码以前有效。我认为唯一的区别是我曾经裁剪 UIImage 而不裁剪 CIImages。我宁愿不必转换,因为我计划在裁剪后做其他 CoreImage 的东西。
正如我所说,_exportSize 是一个 CGFloat _exportSize;并记录它显示它 1024.0000。
有什么想法吗?
干杯。
【问题讨论】:
标签: ios crop cgimage core-image