Introduction

An image unit is a Core Image filter that is packaged as an NSBundle object. Any image processing filter that uses Core Image should be packaged as an image unit. Doing so makes it easy to distribute your filter. An image unit is not only a Core Image filter packaged as a bundle, it is a distribution mechanism for an image processing filter. This means that when you create an image unit, you also get the benefit of consistent packaging and an Apple-provided logo that you can license to use.

This tutorial provides the steps you need to write an image processing filter for OS X. More specifically, it shows you how to create image units that contain an executable filter. An executable filter has one portion that uses the central processing unit (CPU) to execute and another portion that uses the graphics processing unit (GPU). This document does not discuss nonexecutable filters, because they consist only of code that runs on the GPU and therefore have limitations.

Organization of This Document

The document is organized into these chapter:

Prerequisite Reading

Before reading this document you should:

If you are not a Cocoa programmer, don’t panic! The kernel routine portion of an image processing filter uses a procedural language. If you know C, you’ll catch on fast. The higher-level portion of an image processing filter uses the Core Image API, which is an Objective-C API, but is not part of the Cocoa framework. Because Xcode provides a template for writing an image unit, you’ll see that it’s relatively straightforward to use Objective-C to write an image unit.

If you are not an OpenGL programmer, don’t worry. The Core Image API was designed to hide all the messy details of dealing with the GPU from you. Although the kernel routine portion of an image processing filter uses a subset of the OpenGL Shading Language (glslang), you’ll see by looking at the examples that you don’t need prior knowledge to write kernel routines. You do, however, need to have an understanding of the mathematics behind the processing that you want to implement.

See Also

The resources in this section are valuable to any developer who is writing an image unit. You’ll find them most helpful as you work your way through this document and later on, when you are writing your own image units.