core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

s_readpix.c File Reference

#include "main/glheader.h"
#include "main/bufferobj.h"
#include "main/colormac.h"
#include "main/convolve.h"
#include "main/context.h"
#include "main/feedback.h"
#include "main/image.h"
#include "main/macros.h"
#include "main/imports.h"
#include "main/pixel.h"
#include "main/state.h"
#include "s_context.h"
#include "s_depth.h"
#include "s_span.h"
#include "s_stencil.h"

Functions

static void read_index_pixels (GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing)
static void read_depth_pixels (GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing)
 Read pixels for format=GL_DEPTH_COMPONENT.
static void read_stencil_pixels (GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing)
 Read pixels for format=GL_STENCIL_INDEX.
static GLboolean fast_read_rgba_pixels (GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing, GLbitfield transferOps)
 Optimized glReadPixels for particular pixel formats when pixel scaling, biasing, mapping, etc.
static void adjust_colors (GLcontext *ctx, GLuint n, GLfloat rgba[][4])
 When we're using a low-precision color buffer (like 16-bit 5/6/5) we have to adjust our color values a bit to pass conformance.
static void read_rgba_pixels (GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing)
static void read_depth_stencil_pixels (GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing)
 Read combined depth/stencil values.
void _swrast_ReadPixels (GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *packing, GLvoid *pixels)
 Software fallback routine for ctx->Driver.ReadPixels().


Function Documentation

void _swrast_ReadPixels ( GLcontext ctx,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height,
GLenum  format,
GLenum  type,
const struct gl_pixelstore_attrib packing,
GLvoid *  pixels 
)

Software fallback routine for ctx->Driver.ReadPixels().

By time we get here, all error checking will have been done.

static void adjust_colors ( GLcontext ctx,
GLuint  n,
GLfloat  rgba[][4] 
) [static]

When we're using a low-precision color buffer (like 16-bit 5/6/5) we have to adjust our color values a bit to pass conformance.

The problem is when a 5 or 6-bit color value is convert to an 8-bit value and then a floating point value, the floating point values don't increment uniformly as the 5 or 6-bit value is incremented.

This function adjusts floating point values to compensate.

static GLboolean fast_read_rgba_pixels ( GLcontext ctx,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height,
GLenum  format,
GLenum  type,
GLvoid *  pixels,
const struct gl_pixelstore_attrib packing,
GLbitfield  transferOps 
) [static]

Optimized glReadPixels for particular pixel formats when pixel scaling, biasing, mapping, etc.

are disabled.

Returns:
GL_TRUE if success, GL_FALSE if unable to do the readpixels

static void read_depth_pixels ( GLcontext ctx,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height,
GLenum  type,
GLvoid *  pixels,
const struct gl_pixelstore_attrib packing 
) [static]

Read pixels for format=GL_DEPTH_COMPONENT.

static void read_depth_stencil_pixels ( GLcontext ctx,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height,
GLenum  type,
GLvoid *  pixels,
const struct gl_pixelstore_attrib packing 
) [static]

Read combined depth/stencil values.

We'll have already done error checking to be sure the expected depth and stencil buffers really exist.

static void read_index_pixels ( GLcontext ctx,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height,
GLenum  type,
GLvoid *  pixels,
const struct gl_pixelstore_attrib packing 
) [static]

static void read_rgba_pixels ( GLcontext ctx,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height,
GLenum  format,
GLenum  type,
GLvoid *  pixels,
const struct gl_pixelstore_attrib packing 
) [static]

static void read_stencil_pixels ( GLcontext ctx,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height,
GLenum  type,
GLvoid *  pixels,
const struct gl_pixelstore_attrib packing 
) [static]

Read pixels for format=GL_STENCIL_INDEX.


Generated on Sun Sep 27 06:48:05 2009 for Mesa Software Rasterization (swrast) by  doxygen 1.5.4