0

I copied this method from an example to apply filters to an image but I have a problem:

    CGImageRef createStandardImage(CGImageRef image) 
{
    const size_t width = CGImageGetWidth(image);
    const size_t height = CGImageGetHeight(image);
    CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
    CGContextRef ctx = CGBitmapContextCreate(NULL, width, height, 8, 4*width, space,
                                             kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedFirst);
    CGColorSpaceRelease(space);
    CGContextDrawImage(ctx, CGRectMake(0, 0, width, height), image);
    CGImageRef dstImage = CGBitmapContextCreateImage(ctx);
    CGContextRelease(ctx);
    return dstImage;
}

I have a warning when I add this method...

warning: Semantic Issue: No previous prototype for function 'createStandardImage'

..and i have a error if I try to call it:

error: Semantic Issue: Conflicting types for 'createStandardImage'

why??

Safari
  • 11,437
  • 24
  • 91
  • 191
  • i have seen that if i insert this method in a my ViewController i have the warning but i not have the error when i try to use the method... – Safari Mar 17 '12 at 11:40
  • Where are you placing this method? – Manlio Mar 17 '12 at 12:50
  • at the end (to try) I put this method in a .h file and so I include this simple file. I have always the warning but now works well – Safari Mar 17 '12 at 14:48

0 Answers0