views:

160

answers:

1

Hey guys!

I have a monochrome image with 256 levels of grayscale. I want to map each level to a specific color and apply to the image to get a colored image as a result. How can I do it?

To be more precise here is the pair in Java 2D API that I need to find replacement for:

And here is the instruction of how it works in Java. I need to build the same under iPhone.

Thanks!

A: 

Looks to me like the kind of thing you'd want to do in a core image filter:

http://developer.apple.com/mac/library/documentation/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.html

If there isn't a suitable one already there, it wouldn't be very tricky to write.

NSResponder
I'm aware of Core Image framework. I bet I want to be wrong but it is not available under iPhone. I already studied the capabilities of OpenGL ES in this area, and I couldn't find glPixelMap available under iPhone, which would seem to be suitable for this purpose. So I ended up with an idea to get raw UIImage data and do the manipulations manually. It looks like not a very complex task...
Aleks N.