1
votes

For some reason, attempting to apply the CIComicEffect is giving me the GLES error I put in the title. Here is my code:

CGImageRef imageRef = imageToPass.CGImage;

CIContext *context = [CIContext contextWithOptions:nil];               // 1

CIImage *image = [CIImage imageWithCGImage:imageRef];               // 2

CIFilter *filter = [CIFilter filterWithName:@"CIComicEffect"];          // 3

[filter setValue:image forKey:kCIInputImageKey];

//[filter setValue:@0.8f forKey:kCIInputIntensityKey];

CIImage *result = [filter valueForKey:kCIOutputImageKey];              // 4

CGRect extent = [result extent];

CGImageRef cgImage = [context createCGImage:result fromRect:extent];   // 5

UIImageOrientation originalOrientation = imageToPass.imageOrientation;
CGFloat originalScale = imageToPass.scale;

imageToPass = [UIImage imageWithCGImage:cgImage scale:originalScale orientation:originalOrientation];

I have 0 idea what is going wrong. Further, a Google search results in practically nothing. Here are the relevant iOS docs:
https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIComicEffect

https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/QuartzCoreFramework/Classes/CIFilter_Class/index.html#//apple_ref/occ/cl/CIFilter

1
how large is the image? have you tried something smaller? - Rhythmic Fistman

1 Answers

1
votes

I can't see where it is happening in your code, but most likely you are executing that code repeatedly, so the filter gets applied over and over. I.e., imageToPass is both the result and the input for next iteration.