XGetImage/XPutImage on Pixmap

XGetImage/XPutImage on Pixmap

Post by Michael Tseitli » Fri, 23 May 2003 19:06:59



Hello,

It looks that when I call XGetImage and XPutImage on pixmap, X11 still
goes to the X Server and back. Is it really neccessary or there is a way
to save the time?

Thank you,

Michael

 
 
 

XGetImage/XPutImage on Pixmap

Post by Steve Kirkendal » Sat, 24 May 2003 00:23:27



> It looks that when I call XGetImage and XPutImage on pixmap, X11 still
> goes to the X Server and back. Is it really neccessary or there is a way
> to save the time?

It really is necessary.  The main different between an XImage and
a Pixmap is that Pixmaps reside in the server, and XImages reside
in the client.  Copying pixels from one to the other must involve
some client/server communication.

You might look into the shared memory versions, XShmPutImage() and
friends.  When the X server and client are both running on the same
host, the shared memory versions are much faster.  The image copying
*requests* still go through the X message queue but the image *data*
can be accessed directly via the shared memory.  Since images use
a lot of data, this matters!

Documentation for XShmPutImage() can be hard to come by.  If you
can't find it, let me know and I'll send you what I have.