我已经使用核心图像框架在我的项目中添加图像过滤器。我添加的前五个过滤器工作正常。但是当我实现其他过滤器。图像熄灭。工作是: 1)CIHueAdjust 2)CIGammaAdjust 3)CIExposureAdjust 4)CIColorMonochrome 5)CISepiaTone 没有工作对我来说,其他过滤器是CIGloom,CILineOverlay和others.Here是我code.Plz帮助我是我我错了.....使用核心图像过滤器的图像
CIImage *inputImage = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"leaves2.png"]];
CIFilter *Gloom = [CIFilter filterWithName:@"CIGloom"];
[Gloom setDefaults];
[Gloom setValue: inputImage forKey:@"inputImage"];
[Gloom setValue:[NSNumber numberWithFloat: 10.00]
forKey:@"inputRadius"];[Gloom setValue:[NSNumber numberWithFloat: 0.8f]
forKey:@"inputIntensity"];
CIImage *outputImage = [Gloom valueForKey:@"outputImage"];
// define context
CIContext *context = [CIContext contextWithOptions:nil];
// set image to UIImageView
imageView.image = [UIImage imageWithCGImage:
[context createCGImage:outputImage
fromRect:outputImage.extent]];
当我点击button.The图像去F。
是否'Gloom'获得分配一个有效的指针在第二行? – Caleb 2011-12-22 07:48:05
是的。它得到。它适用于其他filters.But对于某些过滤器,它不 – 2011-12-22 10:55:39
当图像返回。它为空。 – 2011-12-22 11:11:22