iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK
by Kyle Richter, Joe Keeley
Initializing an Image
To apply a filter to an image, Core Image requires an image to be an instance of CIImage. To get an instance of CIImage from a UIImage, a conversion to CGImage and then to CIImage is needed. In ICFFilterViewController, the tableView:cellForRowAtIndexPath: method handles the inputImage by checking with the filter delegate to get either the starting image or the image from the previous filter. The filter delegate keeps an array of UIImages, which it will use to return the last image from the imageWithLastFilterApplied method.
If the starting image is provided, it is converted to CGImage and then used to create a CIImage. If the input image is from another filter, it is safe to assume that UIImage has an associated CIImage ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access