378 379














Open GL Super Bible:Raster Graphics in OpenGL















To access the contents, click the chapter and section titles.


Open GL Super Bible


(Publisher: Macmillan Computer Publishing)

Author(s): Waite group Press

ISBN: 1571690735

Publication Date: 08/01/96

 




Previous
Table of Contents
Next




glReadPixels

Purpose
Reads a block of pixels from the framebuffer.
Include File
<GL/gl.h>
Syntax
void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const Glvoid *pixels);
Description
This function copies pixel data from the
framebuffer to memory. Besides the format and type arguments, several
other parameters define the encoding of pixel data in memory and control
the processing of the pixel data before it is placed in the memory
buffer. See the references for glPixelMap, glPixelStore,
glPixelTransfer.


Parameters

x

GLint: The lower-left corner window horizontal coordinate.
y

GLint: The lower-left corner window vertical coordinate.
width

GLsizei: The width of the image in pixels.
height

GLsizei: The height of the image in pixels.
format

GLenum: The colorspace of the pixels to be
read. Valid formats are as follows:





GL_COLOR_INDEX
Color index pixels

GL_LUMINANCE
Grayscale pixels

GL_LUMINANCE_ALPHA
Grayscale + alpha pixels (2 components)

GL_RGB
RGB pixels (3 components)

GL_RGBA
RGBA pixels (4 components)

GL_RED
Red pixels

GL_GREEN
Green pixels

GL_BLUE
Blue pixels

GL_ALPHA
Alpha pixels

GL_STENCIL_INDEX
Stencil buffer values

GL_DEPTH_COMPONENT
Depth buffer values



type

Glenum: The data type of the pixels to be
drawn. Valid types are as follows:





GL_BYTE
Signed 8-bit values (
128 to 127)

GL_UNSIGNED_BYTE
Unsigned 8-bit values (0 to 255)

GL_BITMAP
Bitmap image (0 to 1)

GL_SHORT
Signed 16-bit values (
32768 to 32767)

GL_UNSIGNED_SHORT
Unsigned 16-bit values (0 to 65535)

GL_INT
Signed 32-bit values (
2147483648 to 2147483647)

GL_UNSIGNED_INT
Unsigned 32-bit values (0 to 4294967295)

GL_FLOAT
32-bit floating point values (GLfloat)



pixels

Glvoid *: A pointer to the pixel data for the image.
Returns
None.
Known Bugs
The GL_PACK_ALIGNMENT parameter for glPixelStore is presently ignored by glReadPixels.
Example
See the example in CH11\BITMAP.C.
See Also
glPixelMap, glPixelStore, glPixelTransfer






Previous
Table of Contents
Next














 


Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.












Wyszukiwarka

Podobne podstrony:
376 379
378,6,artykul
377 379
BY Barejsza J , Ab atrybucyi i datawanni dzwiuch maniet Aleksinskaha skarbu, Bankauski wiesnik, nr [
374 378
01 (378)
07 (379)
376 379
378 381
09 (378)
379 Przychód z eksportu towarów w ksiegach rachunkowych
372 378

więcej podobnych podstron