next up previous contents index
Next: Obtaining Pixels from Up: 4.3 DrawingReading, and Previous: 4.3.1 Writing to the

4.3.2 Reading Pixels

 

The method for reading pixels from the framebuffer and placing them in client memory is diagrammed in Figure 4.2. We describe the stages of the pixel reading process in the order in which they occur.

  
Figure 4.2: Operation of ReadPixels . RGBA and color index pixel paths are shown; depth and stencil pixel paths are not shown. RGBA-to-RGBA lookup, index-to-index lookup, and RGB-to-L conversion are optional.

Pixels are read using

void ReadPixels ( int x, int y, sizei width, sizei height, enum format, enum type, void *data ) ;

The arguments after x and y to ReadPixels  correspond to those of DrawPixels . The pixel storage modes that apply to ReadPixels  are summarized in Table 4.5.

  
Table 4.5: PixelStore  parameters pertaining to ReadPixels .





David Blythe
Sat Mar 29 02:23:21 PST 1997