How can I apply CICrystallize filter iOS 7?
-
21-12-2019 - |
Question
I'm working with Photo app using Xcode 5 and iOS7. The problem is that when I apply CICrystallize filter and run the project the screen of the simulator goes blank. Could anyone help me? The implementation of the method is:
- (IBAction)cristalizar:(id)sender {
CIImage *imagen = [[CIImage alloc]initWithCGImage:self.imagenView.image.CGImage];
CIFilter *cristalizar = [CIFilter filterWithName:@"CICrystallize"];
[cristalizar setDefaults];
CIVector *vector = [CIVector vectorWithX:150 Y:150];
[cristalizar setValue:imagen forKey:kCIInputImageKey];
[cristalizar setValue:@20.00f forKey:kCIInputRadiusKey];
[cristalizar setValue:vector forKey:kCIInputCenterKey];
CIImage *resultado = [cristalizar valueForKey:kCIOutputImageKey];
CIContext *contexto = [CIContext contextWithOptions:nil];
CGImageRef cgImagen = [contexto createCGImage:resultado fromRect:[resultado extent]];
self.imagenView.image = [UIImage imageWithCGImage:cgImagen];
}
Solution
The CICrystallize
is not available on iOS.
Availability
Available in OS X v10.4 and later.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow