Introduction to Core Image
Core Image is a framework for image processing built into iOS 5 that aims to provide near real-time processing of images and video by leveraging programmable graphics hardware capabilities. Prior to Core Image, the only way a developer could take advantage of programmable graphics hardware was to create small programs called shaders in a language called OpenGL Shading Language (GLSL). Not all devices have programmable graphics hardware; on these older devices (such as the iPhone 3G), Core Image falls back to using the main CPU for computations.
The Core Image framework is not included in any of the standard iOS application templates. To use this framework in your code you need to add it manually to your project.
Images and Filters
You need to be aware of two key concepts while working with Core Image:
- Images: An image is represented by an instance of the CIImage class and represents the input or output image/video frame that you want to process.
- Filters: The code that performs the actual image processing is known as a filter. A filter is represented by an instance of a CIFilter object. Though it is possible to create your own Core Image filters, this is an advanced topic and beyond the scope of this book. Apple provides more than 100 ready-to-use filters with the Core Image framework that you can use in your application.
Apple’s filters are grouped into 18 categories, and each category is identified by a unique name. These names are listed ...