Preparing an Image Unit for Distribution
Preparation involves three tasks, described in the following sections:
Validating an Image Unit
You can validate your image unit with the ImageUnitAnalyzer tool by following these steps:
After you install the latest developer tools, you can find the ImageUnitAnalyzer tool in
/Developer/usr/bin
.You can also download the tool from Software Licensing & Trademark Agreements.
Open Terminal and drag the ImageUnitAnalyzer into the Terminal window. Then drag the image unit you want to validate into the Terminal window and press Return.
If your image unit is correctly packaged and the Objective-C code and kernel
routine are well formed, ImageUnitAnalyzer provides output similar to what’s shown in Listing 4-1. If your imagine unit has problems, you’ll see failure statements that, in most cases, describe what elements failed. See Figure 4-1.
Listing 4-1 Output produced by ImageUnitAnalyzer for a passing unit
############################################################## |
########### Image Unit Validation Tool Version 1.0 ########### |
########### Copyright 2005, Apple Computer, Inc. ########### |
############################################################## |
VALIDATING IMAGE UNIT: /Users/polly/Development/InvertColorImageUnit.plugin |
VALIDATING IMAGE UNIT BUNDLE |
- PASS: Image Unit has correct extension plugin |
- PASS: Description.plist exists /Users/polly/Development/InvertColorImageUnit.plugin/Contents/Resources/Description.plist |
PASS VALIDATING IMAGE UNIT BUNDLE |
VALIDATING IMAGE UNIT PLUGIN STRUCTURE |
- PASS: Description.plist is a valid XML file |
- PASS: Image Unit version is valid |
- PASS: The Image Unit contains valid filter list. Now analyzing filter list… |
- PASS: The entry InvertColorFilter does have a valid filter attributes dictionary |
- PASS: The entry InvertColorFilter does have a valid filter categories description |
- PASS: The entry InvertColorFilter does have a valid filter display name: InvertColorFilter |
- PASS: The entry InvertColorFilter does have a valid filter name: InvertColorFilter |
- PASS: The entry InvertColorFilter does have a valid filter dictionary |
- PASS: The Image Unit contains valid filters |
PASS VALIDATING IMAGE UNIT PLUGIN STRUCTURE |
VALIDATING IMAGE UNIT CIFILTERS |
- PASS: The filter InvertColorFilter was created successfully |
Testing filter invertColor |
PASS VALIDATING IMAGE UNIT CIFILTERS |
Verification of /Users/polly/Development/InvertColorImageUnit.plugin succeeded |
** PASS |
If your image unit fails with a –1
error but all the validation statements are marked “PASS”
, make sure that you passed only objects from the Objective-C portion of the image unit. See Kernel Routine Rules.


Testing an Image Unit
After your image unit passes validation, you’ll want to make sure that it works properly by following these steps:
Copy the image unit to
/Library/Graphics/Image Units
.You can also install an image unit in a
User/Library/Graphics/Image Units/
, but you may need to create theGraphic/Image Units
folder.Launch the Quartz Composer development tool.
Open the Patch Creator and type the image unit name into the Search field.
When you locate the image unit, drag it to the workspace.
Create a simple Quartz Composer composition that uses the image, as described in Writing Simple Kernel Routines.
Try the filter on a variety of images and with a variety of input value and make sure that it works.
Completing the Necessary Licensing and Trademark Agreements
Before you can distribute your image unit or use the Image Units logo provided by Apple, you’ll need to complete the licensing and trademark agreements and any other tasks described on the Software Licensing & Trademark Agreements website. See:
http://developer.apple.com/softwarelicensing/agreements/imageunits.html
The Image Units logo (see Figure 4-2) is available through a licensing agreement.

Further Reading
In addition to Core Image Kernel Language Reference, you might find these resources useful as you design and write your own image units:
Algorithms for Image Processing and Computer Vision, J. R. Parker, 1997. John Wiley & Sons.
OpenGL Shading Language, Second Edition, Randi J. Rost, 2006. Addison-Wesley Professional.
OpenGL Shading Language, available for download from http://www.opengl.org/documentation/glsl/.
Digital Image Processing, Second Edition, Rafael C. Gonzalez and Richard E. Woods. Addison-Wesley Publishers.
Digital Image Processing, Kenneth R. Castleman, Prentice Hall.
The Renderman Companion: A Programmer’s Guide to Realistic Computer Graphics, Steve Upstill, Addison-Wesley Professional.
GPU Gems: Programming Techniques, Tips, and Tricks for Real-Time Graphics, Randima Fernando, Addison-Wesley Professional. There are a number of other books in the GPU Gems series that you might also find useful.
Copyright © 2011 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2011-06-06