Mac os x access framebuffer source data

I need to perform some task that requires access to screen data in the OS X framebuffer. In 10.6.8 we can get the base address of the framebuffer using the Quart Display Service API, but we cannot do it in 10.7 or 10.8.

Apple suggests getting the screen image using CGDisplayCreateImage. But getting the raw image data is inefficient because we have to draw the resulting image object in context.

Are there other ways to get raw framebuffer data?

+6
source share
1 answer

You do not need to draw the image returned by CGDisplayCreateImage to receive raw image data. You can use CGImageGetDataProvider and then CGDataProviderCopyData to get data from it.

0
source

Source: https://habr.com/ru/post/924423/


All Articles