glReadPixels read the front buffer or the back buffer?

the defination of glReadPixels says it read from the frame buffer, however, it does not say is the frame buffer the front buffer (which is already showed on the screen)or the back buffer (which is going to be shown the next time step).

Does anybody knows which buffer (front or back) is the glReadPixels read pixels from?

Thanks very much in advance

glReadBuffer will let you choose.

Usualy you draw stuff, then read it & then swapbuffers, so that buffer you just operated becomes front buffer. So logical it turns out to be backbuffer.

The default read buffer is the back buffer when using double buffering, and the front buffer when using single buffering. So with double buffering, you read before swapping buffer.

Or, as gmeed said, you can also select the read buffer with glReadBuffer.