ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static GLvoid* read_color_image ( GLcontext *  ctx,
GLint  x,
GLint  y,
GLenum  type,
GLsizei  width,
GLsizei  height 
) [static]

Read an RGBA image from the frame buffer. This is used by glCopyTex[Sub]Image[12]D().

Parameters:
xwindow source x
ywindow source y
widthimage width
heightimage height
typedatatype for returned GL_RGBA image
Returns:
pointer to image

Definition at line 67 of file s_texstore.c.

Referenced by _swrast_copy_teximage1d(), _swrast_copy_teximage2d(), _swrast_copy_texsubimage1d(), _swrast_copy_texsubimage2d(), and _swrast_copy_texsubimage3d().

{
   SWcontext *swrast = SWRAST_CONTEXT(ctx);
   struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
   const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type);
   const GLint stride = width * pixelSize;
   GLint row;
   GLubyte *image, *dst;

   image = (GLubyte *) _mesa_malloc(width * height * pixelSize);
   if (!image)
      return NULL;

   RENDER_START(swrast, ctx);

   dst = image;
   for (row = 0; row < height; row++) {
      _swrast_read_rgba_span(ctx, rb, width, x, y + row, type, dst);
      dst += stride;
   }

   RENDER_FINISH(swrast, ctx);

   return image;
}

Generated on Sun May 27 2012 04:59:53 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.