Any efficient way of converting XImage data to pixel map (e.g. array of RGB quads)?
问题 I'm trying to capture images with XGetImage. Everything fine but I need to send the data to a module which expects an array of RGB quads. Calling XGetPixel for every pixel in the image is very slow (0.5 seconds on a i5 for 1440x900 resolution). I've looked up the XGetPixel source code in xlib and the reason is obvious, a lot of computations are done for each pixel. Is there any efficient (or maybe completely different) way of doing this? 回答1: With the MIT Shared Memory Extension you can store