我不能理解我在这里做错了什么,但是出于某些原因,无论我如何尝试,我都不能创建CIImage
UIImage *origImage = [[UIImage alloc] init];
origImage = [UIImage imageNamed:imageName];
imageName = [imageName substringToIndex:[imageName length]-4];
NSURL *path1 = [[NSBundle mainBundle] URLForResource:imageName withExtension:@"jpg"];
NSLog(@"the path is %@", path1);
NSLog(@"the inputImage is %@", imageName);
CIImage *inputImage = [[CIImage alloc] initWithCGImage:origImage.CGImage];
CIImage *inputImage1 = [[CIImage alloc] initWithImage:_originalImage];
CIImage *inputA = [[CIImage alloc] initWithContentsOfURL:path1];
CIImage *empty = [[CIImage alloc] initWithImage:origImage];这段代码末尾的断点显示了一个UIImage、一个字符串和一个url,所有这些都与预期的一样。标头包括CoreImage.h和UIKit。_originalImage是一个UIImage属性,它是在前面分配的。
在这件事上困惑了几天,真的很感谢任何帮助。谢谢。
发布于 2014-09-11 11:05:10
使用你的代码,我得到了所有4个CIImages,有没有可能你的jpg文件有什么问题?
发布于 2014-09-17 03:43:22
我通过项目设置解决了这个问题。我发现,如果我将Apple LLVM6.0代码生成的优化级别设置为None -00以外的值,那么这些图像都不会形成。然而,如果没有优化,它就会像预期的那样工作。不知道为什么,但不会抱怨。
https://stackoverflow.com/questions/25774296
复制相似问题