Port of Xlib's XImage and XShmImage functions on top of libxcb