public int[] copyRectXOR(CPColorBmp bmp, CPRect rect) {
		CPRect r = new CPRect(0, 0, width, height);
		r.clip(rect);

		int[] buffer = new int[r.getWidth() * r.getHeight()];
		int w = r.getWidth();
		int h = r.getHeight();
		for (int j = 0; j < h; j++) {
			for (int i = 0; i < w; i++) {
				buffer[i + j * w] = data[(j + r.top) * width + i + r.left] ^ bmp.data[(j + r.top) * width + i + r.left];
			}
		}

		return buffer;
	}