What is void * returned from CGBitmapContextGetData?

I am trying to get pixel information from an image and got to the point where I have a void* data object that is a pointer to image data.

What is this object? I tried iterating over it, hoping it was an array of pixel information, but it didn't seem to work.

I want to get rgb values ​​for each pixel.

+4
source share
1 answer

This is a pointer to the bitmap image data. If you are having trouble interpreting it, then the bitmap is probably not in the format you think (CoreGraphics does some conversion automatically when loading external bitmaps).

Check the bitmap format information with CGBitmapContextGetBitmapInfo() .

+4
source

All Articles