views:

1015

answers:

1

I'm trying to get the pixel information from an image and have got to the point where I have my void* data object which is a pointer to the image data.

What exactly is this object? I've tried iterating over it hoping that it's an array of pixel info but it doesn't seem to work.

I want to get the rgb values for each pixel.

+2  A: 

It's a pointer to the bitmap data. If you're having trouble interpreting it, then the bitmap probably isn't in the format you think it's in (CoreGraphics does some conversions automatically on loading external bitmaps).

Check the bitmap format info with CGBitmapContextGetBitmapInfo().

Mark Bessey