Como posso aplicar o filtro CICrystallize iOS 7?
-
21-12-2019 - |
Pergunta
Estou trabalhando com o aplicativo Photo usando Xcode 5 e iOS7.O problema é que quando aplico o filtro CICrystallize e executo o projeto a tela do simulador fica em branco.Alguém pode ajudar-me?A implementação do método é:
- (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];
}
Solução
O CICrystallize
não está disponível no iOS.
Disponibilidade
Disponível no OS X v10.4 e posterior.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow