iPhone OS Reference Library Apple Developer Connection spyglass button

Version: 1.0

Posted: 2009-07-21

Build Requirements: Mac OS X v10.5.7, Xcode 3.1, iPhone OS 3.0

Runtime Requirements: iPhone OS 3.0

View Source Code:

Download Sample Code (“GLImageProcessing.zip”, 353.6K)



Description

The GLImageProcessing sample application demonstrates how to implement simple image processing filters (Brightness, Contrast, Saturation, Hue rotation, Sharpness) using OpenGL ES1.1. The sample also shows how to create simple procedural button icons using CoreGraphics.

By looking at the code you'll see how to set up an OpenGL ES view and use it for applying a filter to a texture. The application creates a texture from an image loaded from disk. It pads the image to a power of two, if required by the GPU.

The Debug configuration in the Xcode project defines DEBUG and ASSERT preprocessor macros, to enable additional error checking.

To use this sample, open it in Xcode and click Build and Go. Use the slider to control the current filter. Only a single filter is applied at a time.

Document Revision History

Date Notes
2009-07-21Demonstrates how to implement simple image processing filters using OpenGL ES1.1.
Did this document help you? Yes It's good, but... Not helpful...