3
我使用圖像模糊的波紋管代碼。 'resultImage'顯示模糊的圖像,但是當我將它放在CALayer內容上時,它什麼也沒有顯示。作爲CALayer模糊CIImage內容圖像
CIImage *imageToBlur = [CIImage imageWithCGImage:image.CGImage];
CIFilter *gaussianBlurFilter = [CIFilter filterWithName: @"CIGaussianBlur"];
[gaussianBlurFilter setValue:imageToBlur forKey: @"inputImage"];
[gaussianBlurFilter setValue:[NSNumber numberWithFloat: 10] forKey: @"inputRadius"];
CIImage *resultImage = [gaussianBlurFilter valueForKey: @"outputImage"];
self.contents = resultImage;