View Full Version : Extracting pixels with readpixels upside-down

02-01-2005, 12:04 PM
The general convention outside OpenGL is that the first pixel starts in the top left. readPixels gets values out starting at the bottom left. In any drawing context, I could just transform the image any way that I want. Is there any way to make readPixels give me back RGB values starting from the top left of the viewport?


02-01-2005, 10:43 PM
Simple answer: No.

The spec says:
"ReadPixels obtains values from the selected buffer from each pixel with lower
left hand corner at (x+i, y+j) for 0 <= i < width and 0 <= j < height; this pixel
is said to be the ith pixel in the jth row. If any of these pixels lies outside of the
window allocated to the current GL context, the values obtained for those pixels
are undefined. Results are also undefined for individual pixels that are not owned
by the current context. Otherwise, ReadPixels obtains values from the selected
buffer, regardless of how those values were placed there."