You use ReadPixel and WritePixel on an existing pixmap. You can't use that on the backbuffer itself. You have to first transfer the backbuffer data into a pixmap and then work on the pixmap and then draw/upload the pixmap/image.
You can use GL_ReadPixels() for OpenGL reading the backbuffer into a memory space - such as that of a pixmap.
You can use GL_ReadPixels() for OpenGL reading the backbuffer into a memory space - such as that of a pixmap.