我在CALayer
添加过滤器时遇到问题....这是代码,但最后有一行我们在CALayer
添加过滤器..
CIImage *inputImage = [[CIImage alloc]initWithImage:[UIImage imageNamed:@"%d.jpg"]];
CIFilter *minimumComponent = [ CIFilter filterWithName:@"CIMinimumComponent"];
[minimumComponent setValue:inputImage forKey:@"inputImage"];
[minimumComponent setDefaults];
CIImage *outputImage = [minimumComponent valueForKey:@"outputImage"];
CIContext *context = [CIContext contextWithOptions:nil];
imageLayer = [UIImage imageWithCGImage:[context createCGImage:outputImage fromRect:outputImage.extent]];
我猜这里是错误
imageLayer = [UIImage imageWithCGImage:[context createCGImage:outputImage fromRect:outputImage.extent]];
here是我明白这个想法的链接......
答案 0 :(得分:1)
好的,首先我不是100%肯定你得到的错误是什么,但我建议换成这样的......
CIImage *outputImage = [minimumComponent valueForKey:@"outputImage"];
UIImage *uiImage = [UIImage imageWithCIImage:outputImage];