i have a problem with the Core Image filters. The code is pretty simple. I create a new project "single view app"; add CoreImage framework.. (here do i ned to add any header file?) add an uiiamgeview...and set an image to its.image. However, when i tried the following code, it did not show any effect. could you plz give me a hand with the mistake or error? btw, I m running the program under simulator 5.0 with Xcode 4.2.1 Thanks in advance.
CIImage *backgroundciImage = self.sourceImageView.image.CIImage;
CIContext *context = [CIContext contextWithOptions:nil];
//set the filter
CIFilter *filter = [CIFilter filterWithName:@"CIGammaAdjust"];
[filter setDefaults];
[filter setValue:backgroundciImage forKey:@"inputImage"];
[filter setValue:[NSNumber numberWithFloat:3.0f] forKey:@"inputPower"];
//get the output image
CIImage *outputImage = [filter valueForKey:@"outputImage"];
self.sourceImageView.image = [UIImage imageWithCGImage:[context createCGImage:outputImage fromRect:outputImage.extent]];