1

I am new to core animation , i add some layers to my view and add image to it. Now i want to give blur effect to my layer

But i don't know how to make CIFilter and add it. I go through the related questions Question 1 Question2


My code is given below (Shows compilation error)

#import < UIKit/UIKit.h >
#import < QuartzCore/QuartzCore.h >
#import < CoreGraphics/CoreGraphics.h >


@interface T_CALayerPart3_View : UIView {

    CALayer *_layer1;
    CALayer *_layer2;
    CALayer *_layer3;
    CALayer *_layer4;
    CALayer *_layer5;
    CIFilter *_filter;    //<----- error here[Expected specifier -qualifier -list before CIFilter]

    CATransform3D *_rotate, *_scale;

}
@end

Give me some suggestion. Your suggestion is important to me. Don't leave the page without any Answer/ comment.

[sorry for my poor English]

Community
  • 1
  • 1
new_programmer
  • 840
  • 3
  • 12
  • 22

1 Answers1

8

There is no CIFilter in iPhone OS. There is CAFilter but it is a private API so using it on AppStore apps means rejection. If you already know what images you will use, you could create the blurred image in the first place.

See How to implement a box or gaussian blur on iPhone on how to implement a Gaussian blur filter "legally".

See CAFilter — iPhone Development Wiki on how to apply a blur filter on a CALayer using the private CAFilter class.

Community
  • 1
  • 1
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005