byte[] bmpMaskData = ((DataBufferByte) bmpMask.getData().getDataBuffer()).getData();
byte[] rMaskData = convertToLSBFirst(bmpMaskData);
ArrayAccessor arrayAccess = AccessorFactory.getArrayAccessor();
long wnd = factory.getRootWindow();
LockedArray larr = arrayAccess.lockArrayShort(rSrcData);
long dataPtr = larr.getAddress();
long pixmap = x11.XCreateBitmapFromData(display, wnd,
dataPtr, width, height);
//System.out.println("source pixmap=" + pixmap);
larr.release();
larr = arrayAccess.lockArrayShort(rMaskData);
dataPtr = larr.getAddress();
long pixmapMask = x11.XCreateBitmapFromData(display, wnd, dataPtr,
width, height);
//System.out.println("mask pixmap=" + pixmap);
larr.release();
int fgRGB = bufImg.getRGB(0, 0);
Color fgColor = new Color(fgRGB);
Color bkColor = getBkColor(bufImg, fgColor);
X11.XColor bkColorPtr = getXColor(bkColor);
X11.XColor fgColorPtr = getXColor(fgColor);