93 if (
ctx->Visual->RGBAflag) {
106 a =
ctx->Pack.Alignment;
107 if (
ctx->Pack.RowLength>0) {
108 l =
ctx->Pack.RowLength;
129 if (
ctx->Pixel.IndexShift!=0 ||
ctx->Pixel.IndexOffset!=0) {
131 if (
ctx->Pixel.IndexShift<0) {
133 s = -
ctx->Pixel.IndexShift;
140 s =
ctx->Pixel.IndexShift;
147 if (
ctx->Pixel.MapColorFlag) {
176 if (
ctx->Pack.SwapBytes) {
187 if (
ctx->Pack.SwapBytes) {
198 if (
ctx->Pack.SwapBytes) {
209 if (
ctx->Pack.SwapBytes) {
220 if (
ctx->Pack.SwapBytes) {
243 if (
ctx->Visual->DepthBits<=0) {
249 bias_or_scale =
ctx->Pixel.DepthBias!=0.0 ||
ctx->Pixel.DepthScale!=1.0;
259 a =
ctx->Pack.Alignment;
260 if (
ctx->Pack.RowLength>0) {
261 l =
ctx->Pack.RowLength;
282 while ((
max&0x80000000)==0) {
332 if (
ctx->Pack.SwapBytes) {
343 if (
ctx->Pack.SwapBytes) {
354 if (
ctx->Pack.SwapBytes) {
365 if (
ctx->Pack.SwapBytes) {
376 if (
ctx->Pack.SwapBytes) {
400 if (
ctx->Visual->StencilBits<=0) {
406 shift_or_offset =
ctx->Pixel.IndexShift!=0 ||
ctx->Pixel.IndexOffset!=0;
416 a =
ctx->Pack.Alignment;
417 if (
ctx->Pack.RowLength>0) {
418 l =
ctx->Pack.RowLength;
440 if (shift_or_offset) {
442 if (
ctx->Pixel.IndexShift<0) {
444 s = -
ctx->Pixel.IndexShift;
451 s =
ctx->Pixel.IndexShift;
458 if (
ctx->Pixel.MapStencilFlag) {
483 if (
ctx->Pack.SwapBytes) {
494 if (
ctx->Pack.SwapBytes) {
505 if (
ctx->Pack.SwapBytes) {
516 if (
ctx->Pack.SwapBytes) {
527 if (
ctx->Pack.SwapBytes) {
545 if (
ctx->Pixel.RedScale!=1.0F ||
ctx->Pixel.RedBias!=0.0F ||
546 ctx->Pixel.GreenScale!=1.0F ||
ctx->Pixel.GreenBias!=0.0F ||
547 ctx->Pixel.BlueScale!=1.0F ||
ctx->Pixel.BlueBias!=0.0F ||
548 ctx->Pixel.AlphaScale!=1.0F ||
ctx->Pixel.AlphaBias!=0.0F) {
570 r =
red[
i] *
ctx->Pixel.RedScale +
ctx->Pixel.RedBias;
572 b =
blue[
i] *
ctx->Pixel.BlueScale +
ctx->Pixel.BlueBias;
621 GLboolean r_flag, g_flag, b_flag, a_flag, l_flag;
628 r_flag = g_flag = b_flag = a_flag = l_flag =
GL_FALSE;
656 r_flag = g_flag = b_flag =
GL_TRUE;
660 r_flag = g_flag = b_flag =
GL_TRUE;
665 r_flag = g_flag = b_flag = a_flag =
GL_TRUE;
669 r_flag = g_flag = b_flag = a_flag =
GL_TRUE;
697 a =
ctx->Pack.Alignment;
698 if (
ctx->Pack.RowLength > 0)
700 l =
ctx->Pack.RowLength;
725 if (
ctx->Visual->RGBAflag)
731 GLfloat rscale = 1.0F *
ctx->Visual->InvRedScale;
732 GLfloat gscale = 1.0F *
ctx->Visual->InvGreenScale;
733 GLfloat bscale = 1.0F *
ctx->Visual->InvBlueScale;
734 GLfloat ascale = 1.0F *
ctx->Visual->InvAlphaScale;
754 if (
ctx->Pixel.MapColorFlag)
769 if (
ctx->Pixel.IndexShift != 0 ||
ctx->Pixel.IndexOffset != 0)
772 if (
ctx->Pixel.IndexShift < 0)
775 s = -
ctx->Pixel.IndexShift;
784 s =
ctx->Pixel.IndexShift;
904 if (
ctx->Pack.SwapBytes)
938 if (
ctx->Pack.SwapBytes)
972 if (
ctx->Pack.SwapBytes)
1006 if (
ctx->Pack.SwapBytes)
1036 *
dst++ = luminance[
i];
1040 if (
ctx->Pack.SwapBytes)
1069 (
void) (*
ctx->Driver.SetBuffer)(
ctx,
ctx->Pixel.ReadBuffer);
1098 (
void) (*
ctx->Driver.SetBuffer)(
ctx,
ctx->Color.DrawBuffer);
void gl_read_alpha_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte alpha[])
void gl_error(GLcontext *ctx, GLenum error, const char *s)
GLint gl_sizeof_type(GLenum type)
void gl_swap4(GLuint *p, GLuint n)
void gl_swap2(GLushort *p, GLuint n)
GLint GLint GLsizei GLsizei GLsizei depth
#define GL_UNSIGNED_SHORT
GLint GLint GLint GLint GLint x
#define GL_LUMINANCE_ALPHA
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLuint GLuint GLsizei GLenum type
#define GL_INVALID_OPERATION
GLclampf GLclampf GLclampf alpha
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
#define GL_DEPTH_COMPONENT
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLint GLfloat GLint stencil
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define DEFARRAY(TYPE, NAME, SIZE)
#define MEMCPY(DST, SRC, BYTES)
#define FLOAT_TO_USHORT(X)
#define FLOAT_TO_UBYTE(X)
#define INSIDE_BEGIN_END(CTX)
#define FLOAT_TO_SHORT(X)
static int sum(int x_, int y_)
static void scale_and_bias_rgba(GLcontext *ctx, GLint n, GLfloat red[], GLfloat green[], GLfloat blue[], GLfloat alpha[])
static void map_rgba(GLcontext *ctx, GLint n, GLfloat red[], GLfloat green[], GLfloat blue[], GLfloat alpha[])
static void read_index_pixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type, GLvoid *pixels)
static void read_color_pixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
static void read_depth_pixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type, GLvoid *pixels)
static void read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum type, GLvoid *pixels)
void gl_ReadPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
static GLboolean scale_or_bias_rgba(GLcontext *ctx)
void gl_read_stencil_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte stencil[])
#define CLAMP(f, min, max)