我想用 对图像产生影响CIImage framework
,当我为此设置参数时,输出图像显示空白图像。
有什么建议么?
用于应用过滤器的代码如下:
- (IBAction)filterImage:(id)sender {
CIImage *rawImageData;
rawImageData =[[CIImage alloc] initWithImage:self.imageView.image];
CIFilter *filter = [CIFilter filterWithName:@"CIDepthOfField"];
[filter setDefaults];
[filter setValue:rawImageData forKey:@"inputImage"];
[filter setValue:[CIVector vectorWithCGPoint:CGPointMake(50, 50)]
forKey:@"inputPoint1"];
[filter setValue:[CIVector vectorWithCGPoint:CGPointMake(100, 100)]
forKey:@"inputPoint2"];
[filter setValue:[NSNumber numberWithFloat:15.00]
forKey:@"inputSaturation"];
[filter setValue:[NSNumber numberWithFloat:15.00]
forKey:@"inputUnsharpMaskRadius"];
[filter setValue:[NSNumber numberWithFloat:15.70]
forKey:@"inputRadius"];
CIImage *filteredImageData = [filter valueForKey:@"outputImage"];
UIImage *filteredImage = [UIImage imageWithCIImage:filteredImageData];
self.imageView.image = filteredImage;
}