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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With