-/* $Id: pixel.c,v 1.30 2001/07/13 20:07:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
-#ifdef PC_HEADER
-#include "all.h"
-#else
#include "glheader.h"
+#include "imports.h"
#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mem.h"
#include "pixel.h"
#include "mtypes.h"
-#endif
-
/**********************************************************************/
-void
+void GLAPIENTRY
_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor )
{
GET_CURRENT_CONTEXT(ctx);
/**********************************************************************/
-void
+void GLAPIENTRY
_mesa_PixelStorei( GLenum pname, GLint param )
{
/* NOTE: this call can't be compiled into the display list */
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Pack.Alignment = param;
break;
+ case GL_PACK_INVERT_MESA:
+ if (!ctx->Extensions.MESA_pack_invert) {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glPixelstore(pname)" );
+ return;
+ }
+ if (ctx->Pack.Invert == param)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
+ ctx->Pack.Invert = param;
+ break;
+
case GL_UNPACK_SWAP_BYTES:
if (param == (GLint)ctx->Unpack.SwapBytes)
return;
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Unpack.Alignment = param;
break;
+ case GL_UNPACK_CLIENT_STORAGE_APPLE:
+ if (param == (GLint)ctx->Unpack.ClientStorage)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
+ ctx->Unpack.ClientStorage = param ? GL_TRUE : GL_FALSE;
+ break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" );
return;
}
-void
+void GLAPIENTRY
_mesa_PixelStoref( GLenum pname, GLfloat param )
{
_mesa_PixelStorei( pname, (GLint) param );
-void
-_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
+void GLAPIENTRY
+_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values )
{
GLint i;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (mapsize<0 || mapsize>MAX_PIXEL_MAP_TABLE) {
+ if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" );
return;
}
- if (map>=GL_PIXEL_MAP_S_TO_S && map<=GL_PIXEL_MAP_I_TO_A) {
+ if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) {
/* test that mapsize is a power of two */
- GLuint p;
- GLboolean ok = GL_FALSE;
- for (p=1; p<=MAX_PIXEL_MAP_TABLE; p=p<<1) {
- if ( (p&mapsize) == p ) {
- ok = GL_TRUE;
- break;
- }
- }
- if (!ok) {
+ if (_mesa_bitcount((GLuint) mapsize) != 1) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" );
return;
}
case GL_PIXEL_MAP_I_TO_R:
ctx->Pixel.MapItoRsize = mapsize;
for (i=0;i<mapsize;i++) {
- GLfloat val = CLAMP( values[i], 0.0, 1.0 );
+ GLfloat val = CLAMP( values[i], 0.0F, 1.0F );
ctx->Pixel.MapItoR[i] = val;
ctx->Pixel.MapItoR8[i] = (GLint) (val * 255.0F);
}
case GL_PIXEL_MAP_I_TO_G:
ctx->Pixel.MapItoGsize = mapsize;
for (i=0;i<mapsize;i++) {
- GLfloat val = CLAMP( values[i], 0.0, 1.0 );
+ GLfloat val = CLAMP( values[i], 0.0F, 1.0F );
ctx->Pixel.MapItoG[i] = val;
ctx->Pixel.MapItoG8[i] = (GLint) (val * 255.0F);
}
case GL_PIXEL_MAP_I_TO_B:
ctx->Pixel.MapItoBsize = mapsize;
for (i=0;i<mapsize;i++) {
- GLfloat val = CLAMP( values[i], 0.0, 1.0 );
+ GLfloat val = CLAMP( values[i], 0.0F, 1.0F );
ctx->Pixel.MapItoB[i] = val;
ctx->Pixel.MapItoB8[i] = (GLint) (val * 255.0F);
}
case GL_PIXEL_MAP_I_TO_A:
ctx->Pixel.MapItoAsize = mapsize;
for (i=0;i<mapsize;i++) {
- GLfloat val = CLAMP( values[i], 0.0, 1.0 );
+ GLfloat val = CLAMP( values[i], 0.0F, 1.0F );
ctx->Pixel.MapItoA[i] = val;
ctx->Pixel.MapItoA8[i] = (GLint) (val * 255.0F);
}
case GL_PIXEL_MAP_R_TO_R:
ctx->Pixel.MapRtoRsize = mapsize;
for (i=0;i<mapsize;i++) {
- ctx->Pixel.MapRtoR[i] = CLAMP( values[i], 0.0, 1.0 );
+ ctx->Pixel.MapRtoR[i] = CLAMP( values[i], 0.0F, 1.0F );
}
break;
case GL_PIXEL_MAP_G_TO_G:
ctx->Pixel.MapGtoGsize = mapsize;
for (i=0;i<mapsize;i++) {
- ctx->Pixel.MapGtoG[i] = CLAMP( values[i], 0.0, 1.0 );
+ ctx->Pixel.MapGtoG[i] = CLAMP( values[i], 0.0F, 1.0F );
}
break;
case GL_PIXEL_MAP_B_TO_B:
ctx->Pixel.MapBtoBsize = mapsize;
for (i=0;i<mapsize;i++) {
- ctx->Pixel.MapBtoB[i] = CLAMP( values[i], 0.0, 1.0 );
+ ctx->Pixel.MapBtoB[i] = CLAMP( values[i], 0.0F, 1.0F );
}
break;
case GL_PIXEL_MAP_A_TO_A:
ctx->Pixel.MapAtoAsize = mapsize;
for (i=0;i<mapsize;i++) {
- ctx->Pixel.MapAtoA[i] = CLAMP( values[i], 0.0, 1.0 );
+ ctx->Pixel.MapAtoA[i] = CLAMP( values[i], 0.0F, 1.0F );
}
break;
default:
-void
-_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values )
+void GLAPIENTRY
+_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values )
{
+ const GLint n = MIN2(mapsize, MAX_PIXEL_MAP_TABLE);
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
GLint i;
if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
- for (i=0;i<mapsize;i++) {
+ for (i=0;i<n;i++) {
fvalues[i] = (GLfloat) values[i];
}
}
else {
- for (i=0;i<mapsize;i++) {
+ for (i=0;i<n;i++) {
fvalues[i] = UINT_TO_FLOAT( values[i] );
}
}
-void
-_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values )
+void GLAPIENTRY
+_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values )
{
+ const GLint n = MIN2(mapsize, MAX_PIXEL_MAP_TABLE);
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
GLint i;
if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
- for (i=0;i<mapsize;i++) {
+ for (i=0;i<n;i++) {
fvalues[i] = (GLfloat) values[i];
}
}
else {
- for (i=0;i<mapsize;i++) {
+ for (i=0;i<n;i++) {
fvalues[i] = USHORT_TO_FLOAT( values[i] );
}
}
-void
+void GLAPIENTRY
_mesa_GetPixelMapfv( GLenum map, GLfloat *values )
{
GET_CURRENT_CONTEXT(ctx);
}
-void
+void GLAPIENTRY
_mesa_GetPixelMapuiv( GLenum map, GLuint *values )
{
GET_CURRENT_CONTEXT(ctx);
}
-void
+void GLAPIENTRY
_mesa_GetPixelMapusv( GLenum map, GLushort *values )
{
GET_CURRENT_CONTEXT(ctx);
* Implements glPixelTransfer[fi] whether called immediately or from a
* display list.
*/
-void
+void GLAPIENTRY
_mesa_PixelTransferf( GLenum pname, GLfloat param )
{
GET_CURRENT_CONTEXT(ctx);
}
-void
+void GLAPIENTRY
_mesa_PixelTransferi( GLenum pname, GLint param )
{
_mesa_PixelTransferf( pname, (GLfloat) param );
}
-
-
/**********************************************************************/
/***** Pixel processing functions ******/
/**********************************************************************/
void
_mesa_map_rgba( const GLcontext *ctx, GLuint n, GLfloat rgba[][4] )
{
- const GLfloat rscale = ctx->Pixel.MapRtoRsize - 1;
- const GLfloat gscale = ctx->Pixel.MapGtoGsize - 1;
- const GLfloat bscale = ctx->Pixel.MapBtoBsize - 1;
- const GLfloat ascale = ctx->Pixel.MapAtoAsize - 1;
+ const GLfloat rscale = (GLfloat) (ctx->Pixel.MapRtoRsize - 1);
+ const GLfloat gscale = (GLfloat) (ctx->Pixel.MapGtoGsize - 1);
+ const GLfloat bscale = (GLfloat) (ctx->Pixel.MapBtoBsize - 1);
+ const GLfloat ascale = (GLfloat) (ctx->Pixel.MapAtoAsize - 1);
const GLfloat *rMap = ctx->Pixel.MapRtoR;
const GLfloat *gMap = ctx->Pixel.MapGtoG;
const GLfloat *bMap = ctx->Pixel.MapBtoB;
const GLfloat bb = ctx->Pixel.PostColorMatrixBias[2];
const GLfloat as = ctx->Pixel.PostColorMatrixScale[3];
const GLfloat ab = ctx->Pixel.PostColorMatrixBias[3];
- const GLfloat *m = ctx->ColorMatrix.m;
+ const GLfloat *m = ctx->ColorMatrixStack.Top->m;
GLuint i;
for (i = 0; i < n; i++) {
const GLfloat r = rgba[i][RCOMP];
_mesa_lookup_rgba(const struct gl_color_table *table,
GLuint n, GLfloat rgba[][4])
{
- ASSERT(table->FloatTable);
if (!table->Table || table->Size == 0)
return;
GLuint i;
for (i = 0; i < n; i++) {
GLint j = IROUND(rgba[i][RCOMP] * scale);
- GLfloat c = CHAN_TO_FLOAT(lut[CLAMP(j, 0, 1)]);
+ GLfloat c = CHAN_TO_FLOAT(lut[CLAMP(j, 0, max)]);
rgba[i][RCOMP] = rgba[i][GCOMP] =
rgba[i][BCOMP] = rgba[i][ACOMP] = c;
}
-
}
else {
const GLint max = table->Size - 1;
const GLuint gShift = CHAN_BITS - ctx->Visual.greenBits;
const GLuint bShift = CHAN_BITS - ctx->Visual.blueBits;
GLuint aShift;
- const GLfloat rScale = 1.0 / (GLfloat) ((1 << ctx->Visual.redBits ) - 1);
- const GLfloat gScale = 1.0 / (GLfloat) ((1 << ctx->Visual.greenBits) - 1);
- const GLfloat bScale = 1.0 / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1);
+ const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1);
+ const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1);
+ const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1);
GLfloat aScale;
GLuint i;
if (ctx->Visual.alphaBits > 0) {
aShift = CHAN_BITS - ctx->Visual.alphaBits;
- aScale = 1.0 / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1);
+ aScale = 1.0F / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1);
}
else {
aShift = 0;
}
#endif
}
+
+/**********************************************************************/
+/***** State Management *****/
+/**********************************************************************/
+
+/*
+ * Return a bitmask of IMAGE_*_BIT flags which to indicate which
+ * pixel transfer operations are enabled.
+ */
+static void
+update_image_transfer_state(GLcontext *ctx)
+{
+ GLuint mask = 0;
+
+ if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F ||
+ ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F ||
+ ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F ||
+ ctx->Pixel.AlphaScale != 1.0F || ctx->Pixel.AlphaBias != 0.0F)
+ mask |= IMAGE_SCALE_BIAS_BIT;
+
+ if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset)
+ mask |= IMAGE_SHIFT_OFFSET_BIT;
+
+ if (ctx->Pixel.MapColorFlag)
+ mask |= IMAGE_MAP_COLOR_BIT;
+
+ if (ctx->Pixel.ColorTableEnabled)
+ mask |= IMAGE_COLOR_TABLE_BIT;
+
+ if (ctx->Pixel.Convolution1DEnabled ||
+ ctx->Pixel.Convolution2DEnabled ||
+ ctx->Pixel.Separable2DEnabled) {
+ mask |= IMAGE_CONVOLUTION_BIT;
+ if (ctx->Pixel.PostConvolutionScale[0] != 1.0F ||
+ ctx->Pixel.PostConvolutionScale[1] != 1.0F ||
+ ctx->Pixel.PostConvolutionScale[2] != 1.0F ||
+ ctx->Pixel.PostConvolutionScale[3] != 1.0F ||
+ ctx->Pixel.PostConvolutionBias[0] != 0.0F ||
+ ctx->Pixel.PostConvolutionBias[1] != 0.0F ||
+ ctx->Pixel.PostConvolutionBias[2] != 0.0F ||
+ ctx->Pixel.PostConvolutionBias[3] != 0.0F) {
+ mask |= IMAGE_POST_CONVOLUTION_SCALE_BIAS;
+ }
+ }
+
+ if (ctx->Pixel.PostConvolutionColorTableEnabled)
+ mask |= IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT;
+
+ if (ctx->ColorMatrixStack.Top->type != MATRIX_IDENTITY ||
+ ctx->Pixel.PostColorMatrixScale[0] != 1.0F ||
+ ctx->Pixel.PostColorMatrixBias[0] != 0.0F ||
+ ctx->Pixel.PostColorMatrixScale[1] != 1.0F ||
+ ctx->Pixel.PostColorMatrixBias[1] != 0.0F ||
+ ctx->Pixel.PostColorMatrixScale[2] != 1.0F ||
+ ctx->Pixel.PostColorMatrixBias[2] != 0.0F ||
+ ctx->Pixel.PostColorMatrixScale[3] != 1.0F ||
+ ctx->Pixel.PostColorMatrixBias[3] != 0.0F)
+ mask |= IMAGE_COLOR_MATRIX_BIT;
+
+ if (ctx->Pixel.PostColorMatrixColorTableEnabled)
+ mask |= IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT;
+
+ if (ctx->Pixel.HistogramEnabled)
+ mask |= IMAGE_HISTOGRAM_BIT;
+
+ if (ctx->Pixel.MinMaxEnabled)
+ mask |= IMAGE_MIN_MAX_BIT;
+
+ ctx->_ImageTransferState = mask;
+}
+
+
+void _mesa_update_pixel( GLcontext *ctx, GLuint new_state )
+{
+ if (new_state & _NEW_COLOR_MATRIX)
+ _math_matrix_analyse( ctx->ColorMatrixStack.Top );
+
+ /* References ColorMatrix.type (derived above).
+ */
+ if (new_state & _IMAGE_NEW_TRANSFER_STATE)
+ update_image_transfer_state(ctx);
+}
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+void _mesa_init_pixel( GLcontext * ctx )
+{
+ int i;
+
+ /* Pixel group */
+ ctx->Pixel.RedBias = 0.0;
+ ctx->Pixel.RedScale = 1.0;
+ ctx->Pixel.GreenBias = 0.0;
+ ctx->Pixel.GreenScale = 1.0;
+ ctx->Pixel.BlueBias = 0.0;
+ ctx->Pixel.BlueScale = 1.0;
+ ctx->Pixel.AlphaBias = 0.0;
+ ctx->Pixel.AlphaScale = 1.0;
+ ctx->Pixel.DepthBias = 0.0;
+ ctx->Pixel.DepthScale = 1.0;
+ ctx->Pixel.IndexOffset = 0;
+ ctx->Pixel.IndexShift = 0;
+ ctx->Pixel.ZoomX = 1.0;
+ ctx->Pixel.ZoomY = 1.0;
+ ctx->Pixel.MapColorFlag = GL_FALSE;
+ ctx->Pixel.MapStencilFlag = GL_FALSE;
+ ctx->Pixel.MapStoSsize = 1;
+ ctx->Pixel.MapItoIsize = 1;
+ ctx->Pixel.MapItoRsize = 1;
+ ctx->Pixel.MapItoGsize = 1;
+ ctx->Pixel.MapItoBsize = 1;
+ ctx->Pixel.MapItoAsize = 1;
+ ctx->Pixel.MapRtoRsize = 1;
+ ctx->Pixel.MapGtoGsize = 1;
+ ctx->Pixel.MapBtoBsize = 1;
+ ctx->Pixel.MapAtoAsize = 1;
+ ctx->Pixel.MapStoS[0] = 0;
+ ctx->Pixel.MapItoI[0] = 0;
+ ctx->Pixel.MapItoR[0] = 0.0;
+ ctx->Pixel.MapItoG[0] = 0.0;
+ ctx->Pixel.MapItoB[0] = 0.0;
+ ctx->Pixel.MapItoA[0] = 0.0;
+ ctx->Pixel.MapItoR8[0] = 0;
+ ctx->Pixel.MapItoG8[0] = 0;
+ ctx->Pixel.MapItoB8[0] = 0;
+ ctx->Pixel.MapItoA8[0] = 0;
+ ctx->Pixel.MapRtoR[0] = 0.0;
+ ctx->Pixel.MapGtoG[0] = 0.0;
+ ctx->Pixel.MapBtoB[0] = 0.0;
+ ctx->Pixel.MapAtoA[0] = 0.0;
+ ctx->Pixel.HistogramEnabled = GL_FALSE;
+ ctx->Pixel.MinMaxEnabled = GL_FALSE;
+ ctx->Pixel.PixelTextureEnabled = GL_FALSE;
+ ctx->Pixel.FragmentRgbSource = GL_PIXEL_GROUP_COLOR_SGIS;
+ ctx->Pixel.FragmentAlphaSource = GL_PIXEL_GROUP_COLOR_SGIS;
+ ASSIGN_4V(ctx->Pixel.PostColorMatrixScale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.PostColorMatrixBias, 0.0, 0.0, 0.0, 0.0);
+ ASSIGN_4V(ctx->Pixel.ColorTableScale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.ColorTableBias, 0.0, 0.0, 0.0, 0.0);
+ ASSIGN_4V(ctx->Pixel.PCCTscale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.PCCTbias, 0.0, 0.0, 0.0, 0.0);
+ ASSIGN_4V(ctx->Pixel.PCMCTscale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.PCMCTbias, 0.0, 0.0, 0.0, 0.0);
+ ctx->Pixel.ColorTableEnabled = GL_FALSE;
+ ctx->Pixel.PostConvolutionColorTableEnabled = GL_FALSE;
+ ctx->Pixel.PostColorMatrixColorTableEnabled = GL_FALSE;
+ ctx->Pixel.Convolution1DEnabled = GL_FALSE;
+ ctx->Pixel.Convolution2DEnabled = GL_FALSE;
+ ctx->Pixel.Separable2DEnabled = GL_FALSE;
+ for (i = 0; i < 3; i++) {
+ ASSIGN_4V(ctx->Pixel.ConvolutionBorderColor[i], 0.0, 0.0, 0.0, 0.0);
+ ctx->Pixel.ConvolutionBorderMode[i] = GL_REDUCE;
+ ASSIGN_4V(ctx->Pixel.ConvolutionFilterScale[i], 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.ConvolutionFilterBias[i], 0.0, 0.0, 0.0, 0.0);
+ }
+ for (i = 0; i < MAX_CONVOLUTION_WIDTH * MAX_CONVOLUTION_WIDTH * 4; i++) {
+ ctx->Convolution1D.Filter[i] = 0.0;
+ ctx->Convolution2D.Filter[i] = 0.0;
+ ctx->Separable2D.Filter[i] = 0.0;
+ }
+ ASSIGN_4V(ctx->Pixel.PostConvolutionScale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.PostConvolutionBias, 0.0, 0.0, 0.0, 0.0);
+ /* GL_SGI_texture_color_table */
+ ASSIGN_4V(ctx->Pixel.TextureColorTableScale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.TextureColorTableBias, 0.0, 0.0, 0.0, 0.0);
+
+ /* Pixel transfer */
+ ctx->Pack.Alignment = 4;
+ ctx->Pack.RowLength = 0;
+ ctx->Pack.ImageHeight = 0;
+ ctx->Pack.SkipPixels = 0;
+ ctx->Pack.SkipRows = 0;
+ ctx->Pack.SkipImages = 0;
+ ctx->Pack.SwapBytes = GL_FALSE;
+ ctx->Pack.LsbFirst = GL_FALSE;
+ ctx->Pack.ClientStorage = GL_FALSE;
+ ctx->Pack.Invert = GL_FALSE;
+ ctx->Unpack.Alignment = 4;
+ ctx->Unpack.RowLength = 0;
+ ctx->Unpack.ImageHeight = 0;
+ ctx->Unpack.SkipPixels = 0;
+ ctx->Unpack.SkipRows = 0;
+ ctx->Unpack.SkipImages = 0;
+ ctx->Unpack.SwapBytes = GL_FALSE;
+ ctx->Unpack.LsbFirst = GL_FALSE;
+ ctx->Unpack.ClientStorage = GL_FALSE;
+ ctx->Unpack.Invert = GL_FALSE;
+
+ if (ctx->Visual.doubleBufferMode) {
+ ctx->Pixel.ReadBuffer = GL_BACK;
+ ctx->Pixel._ReadSrcMask = BACK_LEFT_BIT;
+ }
+ else {
+ ctx->Pixel.ReadBuffer = GL_FRONT;
+ ctx->Pixel._ReadSrcMask = FRONT_LEFT_BIT;
+ }
+
+ /* Miscellaneous */
+ ctx->_ImageTransferState = 0;
+}