Hi Readers!
Many times we need to check what Core Image filters do we have in iOS framework. Here is a simple code to get all the list of filters with their attributes. This will be easier for you to check and apply any filter on an image.
I have passed nil to get all the categories. You can pass other categories displayed in CIFilter.h class
Example 1: Passing as nil
NSArray *arr = [CIFilter filterNamesInCategory:nil];
[arr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
CIFilter *filter = [CIFilter filterWithName:obj];
NSLog(@"filter properties %@",filter.attributes);
}];
Example 2: Passing a category
NSArray *arr = [CIFilter filterNamesInCategory:kCICategoryDistortionEffect];
[arr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
CIFilter *filter = [CIFilter filterWithName:obj];
NSLog(@"filter properties %@",filter.attributes);
}];
Hope it helps!
0 Comment(s)