Missing Core Image Documentation
※
If you’ve ever gone searching for an up-to-date list of Core Image filters you’ll know this pain. Search through search results, header files, Apple’s documentation and you can’t find it. The best link Apple refers you to is this page from their documentation archive that hasn’t been updated since 2016:
So you decide you can at leaast build a small utility app to generate the list for you. Looking for examples you’ll find many old, out-of-date code bases on GitHub doing exactly that:
- https://github.com/noahsark769/cifilter.io
- https://github.com/FlexMonkey/Filterpedia
- https://github.com/jmade/CIFilter
However, there is a small cache of Apple documentation available if you know the right link, and I think it’s up-to-date:
Here’s the link for the builtin Box Blur Filter:
https://developer.apple.com/documentation/coreimage/cifilter/3228278-boxblurfilter
Notice that the left-hand column, now shows a long list of builtin filters!
If you had jumped in to read the CIFilter
documentation:
https://developer.apple.com/documentation/coreimage/cifilter
You’d have seen nothing.
There’s another option: Categorised filters. Here’s the link for Blur filters:
And now you can see all the filter categories in the left-hand column.
I have no idea what’s gone wrong with this documentation. I suspect it’s the way the header file CIFilterBuiltins.h
has been written, and the documentation generator has issues with it.
There are still problems with the documentation. Notice that the language is Objective-C but the examples are Swift? The API looks like this:
(CIFilter<CIBoxBlur>*) boxBlurFilter;
CIBoxBlur
is a protocol:
@protocol CIBoxBlur <CIFilter>
@property (nonatomic, retain, nullable) CIImage *inputImage;
@property (nonatomic) float radius;
@end
But the example is in Swift (yes, with the blank line):
func boxBlur(inputImage: CIImage) -> CIImage? {
let boxBlurFilter = CIFilter.boxBlur()
boxBlurFilter.inputImage = inputImage
boxBlurFilter.radius = 10
return boxBlurFilter.outputImage
}
The Box Blur filter is one of the few that have example code and example images, many of them don’t.
Anyway, hope this is helpful: