Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mac os x access framebuffer raw data

I have to perform some task which need to access the screen data in the framebuffer of OS X. In 10.6.8 we can get the framebuffer base address by using Quart Display Service API, but we can not do this in 10.7 or 10.8.

Apple suggest to get the screen image by using CGDisplayCreateImage. But it is inefficient to get the raw image data because we have to draw the obtained image object to a context.

Is there other ways to get the raw data of a framebuffer?

like image 785
Travis Avatar asked Sep 03 '12 07:09

Travis


1 Answers

You don't need to draw the image returned by CGDisplayCreateImage to retrieve the raw image data. You can use CGImageGetDataProvider followed by CGDataProviderCopyData to get the data from it.

like image 196
bdash Avatar answered Oct 21 '22 08:10

bdash