Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Top-to-bottom glReadPixels ?

487 views
Skip to first unread message

Dave Speer

unread,
Aug 8, 1995, 3:00:00 AM8/8/95
to

I don't see a way in OpenGL to get glReadPixels() to do top-to-bottom
transfers of image data (this is useful when the image origin is the
upper-left corner). This used to be very easy in IrisGL by calling
pixmode(PM_TTOB,1) prior to calling lrectread(). In OpenGL, you can
use glPixelZoom() with negative zoom factors to reflect an image, but
glPixelZoom() only affects glDrawPixels() and glCopyPixels(), not
glReadPixels(). So... it appears that my options are:
1. Use glCopyPixels() with negative zoom factor to copy the image
upside-down to another area of the frame buffer, then use
glReadPixels() to read from there.
2. Use glReadPixels() directly, and then build the top-to-bottom
image in memory as a separate processing step.

Is this correct or am I missing something?

Thanks for any advice.
Dave Speer
Boeing Information Services
dave_...@mlngw.chinalake.navy.mil

Allen Akin

unread,
Aug 14, 1995, 3:00:00 AM8/14/95
to
In article <DD0Kw...@avalon.chinalake.navy.mil>,

Dave Speer <dave_...@mlngw.chinalake.navy.mil> wrote:
|
| I don't see a way in OpenGL to get glReadPixels() to do top-to-bottom
| transfers of image data (this is useful when the image origin is the
| upper-left corner).

I don't know of one, but perhaps someone else has an idea.

| 1. Use glCopyPixels() with negative zoom factor to copy the image
| upside-down to another area of the frame buffer, then use
| glReadPixels() to read from there.
| 2. Use glReadPixels() directly, and then build the top-to-bottom
| image in memory as a separate processing step.

Either of the above would work. #1 probably would be fastest, if
there's space available in the framebuffer.

Allen

0 new messages