color balance on the iPhone
I am taking an image, loading it via the screen context, and changing it pixel by pixel. I have a number of different filters that I am applying to the images, but the last thing I need to do is shift the color balance (similar to Photoshop) to make the red more cyan. The code below shows how I am taking the image, getting the data, and going through the r/g/b values pixel by pixel: CGImageRef sourceImage = theImage.image.CGImage; CFDataRef theData; theData = CGDataProviderCopyData(CGImageGetDataProvider(sourceImage)); UInt8 *pixelData = (UInt8 *) CFDataGetBytePtr(theData); int dataLength =