2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Pixel transfer functions (glPixelZoom, glPixelMap, glPixelTransfer)
32 #include "bufferobj.h"
36 #include "mfeatures.h"
40 #include "main/dispatch.h"
43 /**********************************************************************/
44 /***** glPixelZoom *****/
45 /**********************************************************************/
48 _mesa_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
50 GET_CURRENT_CONTEXT(ctx
);
52 ASSERT_OUTSIDE_BEGIN_END(ctx
);
54 if (ctx
->Pixel
.ZoomX
== xfactor
&&
55 ctx
->Pixel
.ZoomY
== yfactor
)
58 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
59 ctx
->Pixel
.ZoomX
= xfactor
;
60 ctx
->Pixel
.ZoomY
= yfactor
;
65 /**********************************************************************/
66 /***** glPixelMap *****/
67 /**********************************************************************/
70 * Return pointer to a pixelmap by name.
72 static struct gl_pixelmap
*
73 get_pixelmap(struct gl_context
*ctx
, GLenum map
)
76 case GL_PIXEL_MAP_I_TO_I
:
77 return &ctx
->PixelMaps
.ItoI
;
78 case GL_PIXEL_MAP_S_TO_S
:
79 return &ctx
->PixelMaps
.StoS
;
80 case GL_PIXEL_MAP_I_TO_R
:
81 return &ctx
->PixelMaps
.ItoR
;
82 case GL_PIXEL_MAP_I_TO_G
:
83 return &ctx
->PixelMaps
.ItoG
;
84 case GL_PIXEL_MAP_I_TO_B
:
85 return &ctx
->PixelMaps
.ItoB
;
86 case GL_PIXEL_MAP_I_TO_A
:
87 return &ctx
->PixelMaps
.ItoA
;
88 case GL_PIXEL_MAP_R_TO_R
:
89 return &ctx
->PixelMaps
.RtoR
;
90 case GL_PIXEL_MAP_G_TO_G
:
91 return &ctx
->PixelMaps
.GtoG
;
92 case GL_PIXEL_MAP_B_TO_B
:
93 return &ctx
->PixelMaps
.BtoB
;
94 case GL_PIXEL_MAP_A_TO_A
:
95 return &ctx
->PixelMaps
.AtoA
;
103 * Helper routine used by the other _mesa_PixelMap() functions.
106 store_pixelmap(struct gl_context
*ctx
, GLenum map
, GLsizei mapsize
,
107 const GLfloat
*values
)
110 struct gl_pixelmap
*pm
= get_pixelmap(ctx
, map
);
112 _mesa_error(ctx
, GL_INVALID_ENUM
, "glPixelMap(map)");
117 case GL_PIXEL_MAP_S_TO_S
:
119 ctx
->PixelMaps
.StoS
.Size
= mapsize
;
120 for (i
= 0; i
< mapsize
; i
++) {
121 ctx
->PixelMaps
.StoS
.Map
[i
] = (GLfloat
)IROUND(values
[i
]);
124 case GL_PIXEL_MAP_I_TO_I
:
126 ctx
->PixelMaps
.ItoI
.Size
= mapsize
;
127 for (i
= 0; i
< mapsize
; i
++) {
128 ctx
->PixelMaps
.ItoI
.Map
[i
] = values
[i
];
134 for (i
= 0; i
< mapsize
; i
++) {
135 GLfloat val
= CLAMP(values
[i
], 0.0F
, 1.0F
);
143 * Convenience wrapper for _mesa_validate_pbo_access() for gl[Get]PixelMap().
146 validate_pbo_access(struct gl_context
*ctx
,
147 struct gl_pixelstore_attrib
*pack
, GLsizei mapsize
,
148 GLenum format
, GLenum type
, GLsizei clientMemSize
,
153 /* Note, need to use DefaultPacking and Unpack's buffer object */
154 _mesa_reference_buffer_object(ctx
,
155 &ctx
->DefaultPacking
.BufferObj
,
158 ok
= _mesa_validate_pbo_access(1, &ctx
->DefaultPacking
, mapsize
, 1, 1,
159 format
, type
, clientMemSize
, ptr
);
162 _mesa_reference_buffer_object(ctx
,
163 &ctx
->DefaultPacking
.BufferObj
,
164 ctx
->Shared
->NullBufferObj
);
167 if (_mesa_is_bufferobj(pack
->BufferObj
)) {
168 _mesa_error(ctx
, GL_INVALID_OPERATION
,
169 "gl[Get]PixelMap*v(out of bounds PBO access)");
171 _mesa_error(ctx
, GL_INVALID_OPERATION
,
172 "glGetnPixelMap*vARB(out of bounds access:"
173 " bufSize (%d) is too small)", clientMemSize
);
181 _mesa_PixelMapfv( GLenum map
, GLsizei mapsize
, const GLfloat
*values
)
183 GET_CURRENT_CONTEXT(ctx
);
184 ASSERT_OUTSIDE_BEGIN_END(ctx
);
186 /* XXX someday, test against ctx->Const.MaxPixelMapTableSize */
187 if (mapsize
< 1 || mapsize
> MAX_PIXEL_MAP_TABLE
) {
188 _mesa_error( ctx
, GL_INVALID_VALUE
, "glPixelMapfv(mapsize)" );
192 if (map
>= GL_PIXEL_MAP_S_TO_S
&& map
<= GL_PIXEL_MAP_I_TO_A
) {
193 /* test that mapsize is a power of two */
194 if (!_mesa_is_pow_two(mapsize
)) {
195 _mesa_error( ctx
, GL_INVALID_VALUE
, "glPixelMapfv(mapsize)" );
200 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
202 if (!validate_pbo_access(ctx
, &ctx
->Unpack
, mapsize
, GL_INTENSITY
,
203 GL_FLOAT
, INT_MAX
, values
)) {
207 values
= (const GLfloat
*) _mesa_map_pbo_source(ctx
, &ctx
->Unpack
, values
);
209 if (_mesa_is_bufferobj(ctx
->Unpack
.BufferObj
)) {
210 _mesa_error(ctx
, GL_INVALID_OPERATION
,
211 "glPixelMapfv(PBO is mapped)");
216 store_pixelmap(ctx
, map
, mapsize
, values
);
218 _mesa_unmap_pbo_source(ctx
, &ctx
->Unpack
);
223 _mesa_PixelMapuiv(GLenum map
, GLsizei mapsize
, const GLuint
*values
)
225 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
226 GET_CURRENT_CONTEXT(ctx
);
227 ASSERT_OUTSIDE_BEGIN_END(ctx
);
229 if (mapsize
< 1 || mapsize
> MAX_PIXEL_MAP_TABLE
) {
230 _mesa_error( ctx
, GL_INVALID_VALUE
, "glPixelMapuiv(mapsize)" );
234 if (map
>= GL_PIXEL_MAP_S_TO_S
&& map
<= GL_PIXEL_MAP_I_TO_A
) {
235 /* test that mapsize is a power of two */
236 if (!_mesa_is_pow_two(mapsize
)) {
237 _mesa_error( ctx
, GL_INVALID_VALUE
, "glPixelMapuiv(mapsize)" );
242 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
244 if (!validate_pbo_access(ctx
, &ctx
->Unpack
, mapsize
, GL_INTENSITY
,
245 GL_UNSIGNED_INT
, INT_MAX
, values
)) {
249 values
= (const GLuint
*) _mesa_map_pbo_source(ctx
, &ctx
->Unpack
, values
);
251 if (_mesa_is_bufferobj(ctx
->Unpack
.BufferObj
)) {
252 _mesa_error(ctx
, GL_INVALID_OPERATION
,
253 "glPixelMapuiv(PBO is mapped)");
258 /* convert to floats */
259 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
261 for (i
= 0; i
< mapsize
; i
++) {
262 fvalues
[i
] = (GLfloat
) values
[i
];
267 for (i
= 0; i
< mapsize
; i
++) {
268 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
272 _mesa_unmap_pbo_source(ctx
, &ctx
->Unpack
);
274 store_pixelmap(ctx
, map
, mapsize
, fvalues
);
279 _mesa_PixelMapusv(GLenum map
, GLsizei mapsize
, const GLushort
*values
)
281 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
282 GET_CURRENT_CONTEXT(ctx
);
283 ASSERT_OUTSIDE_BEGIN_END(ctx
);
285 if (mapsize
< 1 || mapsize
> MAX_PIXEL_MAP_TABLE
) {
286 _mesa_error( ctx
, GL_INVALID_VALUE
, "glPixelMapusv(mapsize)" );
290 if (map
>= GL_PIXEL_MAP_S_TO_S
&& map
<= GL_PIXEL_MAP_I_TO_A
) {
291 /* test that mapsize is a power of two */
292 if (!_mesa_is_pow_two(mapsize
)) {
293 _mesa_error( ctx
, GL_INVALID_VALUE
, "glPixelMapuiv(mapsize)" );
298 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
300 if (!validate_pbo_access(ctx
, &ctx
->Unpack
, mapsize
, GL_INTENSITY
,
301 GL_UNSIGNED_SHORT
, INT_MAX
, values
)) {
305 values
= (const GLushort
*) _mesa_map_pbo_source(ctx
, &ctx
->Unpack
, values
);
307 if (_mesa_is_bufferobj(ctx
->Unpack
.BufferObj
)) {
308 _mesa_error(ctx
, GL_INVALID_OPERATION
,
309 "glPixelMapusv(PBO is mapped)");
314 /* convert to floats */
315 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
317 for (i
= 0; i
< mapsize
; i
++) {
318 fvalues
[i
] = (GLfloat
) values
[i
];
323 for (i
= 0; i
< mapsize
; i
++) {
324 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
328 _mesa_unmap_pbo_source(ctx
, &ctx
->Unpack
);
330 store_pixelmap(ctx
, map
, mapsize
, fvalues
);
335 _mesa_GetnPixelMapfvARB( GLenum map
, GLsizei bufSize
, GLfloat
*values
)
337 GET_CURRENT_CONTEXT(ctx
);
339 const struct gl_pixelmap
*pm
;
341 ASSERT_OUTSIDE_BEGIN_END(ctx
);
343 pm
= get_pixelmap(ctx
, map
);
345 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetPixelMapfv(map)");
351 if (!validate_pbo_access(ctx
, &ctx
->Pack
, mapsize
, GL_INTENSITY
,
352 GL_FLOAT
, bufSize
, values
)) {
356 values
= (GLfloat
*) _mesa_map_pbo_dest(ctx
, &ctx
->Pack
, values
);
358 if (_mesa_is_bufferobj(ctx
->Pack
.BufferObj
)) {
359 _mesa_error(ctx
, GL_INVALID_OPERATION
,
360 "glGetPixelMapfv(PBO is mapped)");
365 if (map
== GL_PIXEL_MAP_S_TO_S
) {
367 for (i
= 0; i
< mapsize
; i
++) {
368 values
[i
] = (GLfloat
) ctx
->PixelMaps
.StoS
.Map
[i
];
372 memcpy(values
, pm
->Map
, mapsize
* sizeof(GLfloat
));
375 _mesa_unmap_pbo_dest(ctx
, &ctx
->Pack
);
380 _mesa_GetPixelMapfv( GLenum map
, GLfloat
*values
)
382 _mesa_GetnPixelMapfvARB(map
, INT_MAX
, values
);
386 _mesa_GetnPixelMapuivARB( GLenum map
, GLsizei bufSize
, GLuint
*values
)
388 GET_CURRENT_CONTEXT(ctx
);
390 const struct gl_pixelmap
*pm
;
392 ASSERT_OUTSIDE_BEGIN_END(ctx
);
394 pm
= get_pixelmap(ctx
, map
);
396 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetPixelMapuiv(map)");
402 if (!validate_pbo_access(ctx
, &ctx
->Pack
, mapsize
, GL_INTENSITY
,
403 GL_UNSIGNED_INT
, bufSize
, values
)) {
407 values
= (GLuint
*) _mesa_map_pbo_dest(ctx
, &ctx
->Pack
, values
);
409 if (_mesa_is_bufferobj(ctx
->Pack
.BufferObj
)) {
410 _mesa_error(ctx
, GL_INVALID_OPERATION
,
411 "glGetPixelMapuiv(PBO is mapped)");
416 if (map
== GL_PIXEL_MAP_S_TO_S
) {
418 memcpy(values
, ctx
->PixelMaps
.StoS
.Map
, mapsize
* sizeof(GLint
));
421 for (i
= 0; i
< mapsize
; i
++) {
422 values
[i
] = FLOAT_TO_UINT( pm
->Map
[i
] );
426 _mesa_unmap_pbo_dest(ctx
, &ctx
->Pack
);
431 _mesa_GetPixelMapuiv( GLenum map
, GLuint
*values
)
433 _mesa_GetnPixelMapuivARB(map
, INT_MAX
, values
);
437 _mesa_GetnPixelMapusvARB( GLenum map
, GLsizei bufSize
, GLushort
*values
)
439 GET_CURRENT_CONTEXT(ctx
);
441 const struct gl_pixelmap
*pm
;
443 ASSERT_OUTSIDE_BEGIN_END(ctx
);
445 pm
= get_pixelmap(ctx
, map
);
447 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetPixelMapusv(map)");
453 if (!validate_pbo_access(ctx
, &ctx
->Pack
, mapsize
, GL_INTENSITY
,
454 GL_UNSIGNED_SHORT
, bufSize
, values
)) {
458 values
= (GLushort
*) _mesa_map_pbo_dest(ctx
, &ctx
->Pack
, values
);
460 if (_mesa_is_bufferobj(ctx
->Pack
.BufferObj
)) {
461 _mesa_error(ctx
, GL_INVALID_OPERATION
,
462 "glGetPixelMapusv(PBO is mapped)");
469 case GL_PIXEL_MAP_I_TO_I
:
470 for (i
= 0; i
< mapsize
; i
++) {
471 values
[i
] = (GLushort
) CLAMP(ctx
->PixelMaps
.ItoI
.Map
[i
], 0.0, 65535.);
474 case GL_PIXEL_MAP_S_TO_S
:
475 for (i
= 0; i
< mapsize
; i
++) {
476 values
[i
] = (GLushort
) CLAMP(ctx
->PixelMaps
.StoS
.Map
[i
], 0.0, 65535.);
480 for (i
= 0; i
< mapsize
; i
++) {
481 CLAMPED_FLOAT_TO_USHORT(values
[i
], pm
->Map
[i
] );
485 _mesa_unmap_pbo_dest(ctx
, &ctx
->Pack
);
490 _mesa_GetPixelMapusv( GLenum map
, GLushort
*values
)
492 _mesa_GetnPixelMapusvARB(map
, INT_MAX
, values
);
496 /**********************************************************************/
497 /***** glPixelTransfer *****/
498 /**********************************************************************/
502 * Implements glPixelTransfer[fi] whether called immediately or from a
506 _mesa_PixelTransferf( GLenum pname
, GLfloat param
)
508 GET_CURRENT_CONTEXT(ctx
);
509 ASSERT_OUTSIDE_BEGIN_END(ctx
);
513 if (ctx
->Pixel
.MapColorFlag
== (param
? GL_TRUE
: GL_FALSE
))
515 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
516 ctx
->Pixel
.MapColorFlag
= param
? GL_TRUE
: GL_FALSE
;
519 if (ctx
->Pixel
.MapStencilFlag
== (param
? GL_TRUE
: GL_FALSE
))
521 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
522 ctx
->Pixel
.MapStencilFlag
= param
? GL_TRUE
: GL_FALSE
;
525 if (ctx
->Pixel
.IndexShift
== (GLint
) param
)
527 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
528 ctx
->Pixel
.IndexShift
= (GLint
) param
;
530 case GL_INDEX_OFFSET
:
531 if (ctx
->Pixel
.IndexOffset
== (GLint
) param
)
533 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
534 ctx
->Pixel
.IndexOffset
= (GLint
) param
;
537 if (ctx
->Pixel
.RedScale
== param
)
539 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
540 ctx
->Pixel
.RedScale
= param
;
543 if (ctx
->Pixel
.RedBias
== param
)
545 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
546 ctx
->Pixel
.RedBias
= param
;
549 if (ctx
->Pixel
.GreenScale
== param
)
551 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
552 ctx
->Pixel
.GreenScale
= param
;
555 if (ctx
->Pixel
.GreenBias
== param
)
557 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
558 ctx
->Pixel
.GreenBias
= param
;
561 if (ctx
->Pixel
.BlueScale
== param
)
563 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
564 ctx
->Pixel
.BlueScale
= param
;
567 if (ctx
->Pixel
.BlueBias
== param
)
569 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
570 ctx
->Pixel
.BlueBias
= param
;
573 if (ctx
->Pixel
.AlphaScale
== param
)
575 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
576 ctx
->Pixel
.AlphaScale
= param
;
579 if (ctx
->Pixel
.AlphaBias
== param
)
581 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
582 ctx
->Pixel
.AlphaBias
= param
;
585 if (ctx
->Pixel
.DepthScale
== param
)
587 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
588 ctx
->Pixel
.DepthScale
= param
;
591 if (ctx
->Pixel
.DepthBias
== param
)
593 FLUSH_VERTICES(ctx
, _NEW_PIXEL
);
594 ctx
->Pixel
.DepthBias
= param
;
597 _mesa_error( ctx
, GL_INVALID_ENUM
, "glPixelTransfer(pname)" );
604 _mesa_PixelTransferi( GLenum pname
, GLint param
)
606 _mesa_PixelTransferf( pname
, (GLfloat
) param
);
611 /**********************************************************************/
612 /***** State Management *****/
613 /**********************************************************************/
616 * Return a bitmask of IMAGE_*_BIT flags which to indicate which
617 * pixel transfer operations are enabled.
620 update_image_transfer_state(struct gl_context
*ctx
)
624 if (ctx
->Pixel
.RedScale
!= 1.0F
|| ctx
->Pixel
.RedBias
!= 0.0F
||
625 ctx
->Pixel
.GreenScale
!= 1.0F
|| ctx
->Pixel
.GreenBias
!= 0.0F
||
626 ctx
->Pixel
.BlueScale
!= 1.0F
|| ctx
->Pixel
.BlueBias
!= 0.0F
||
627 ctx
->Pixel
.AlphaScale
!= 1.0F
|| ctx
->Pixel
.AlphaBias
!= 0.0F
)
628 mask
|= IMAGE_SCALE_BIAS_BIT
;
630 if (ctx
->Pixel
.IndexShift
|| ctx
->Pixel
.IndexOffset
)
631 mask
|= IMAGE_SHIFT_OFFSET_BIT
;
633 if (ctx
->Pixel
.MapColorFlag
)
634 mask
|= IMAGE_MAP_COLOR_BIT
;
636 ctx
->_ImageTransferState
= mask
;
641 * Update mesa pixel transfer derived state.
643 void _mesa_update_pixel( struct gl_context
*ctx
, GLuint new_state
)
645 if (new_state
& _NEW_PIXEL
)
646 update_image_transfer_state(ctx
);
651 _mesa_init_pixel_dispatch(struct _glapi_table
*disp
)
653 SET_GetPixelMapfv(disp
, _mesa_GetPixelMapfv
);
654 SET_GetPixelMapuiv(disp
, _mesa_GetPixelMapuiv
);
655 SET_GetPixelMapusv(disp
, _mesa_GetPixelMapusv
);
656 SET_PixelMapfv(disp
, _mesa_PixelMapfv
);
657 SET_PixelMapuiv(disp
, _mesa_PixelMapuiv
);
658 SET_PixelMapusv(disp
, _mesa_PixelMapusv
);
659 SET_PixelTransferf(disp
, _mesa_PixelTransferf
);
660 SET_PixelTransferi(disp
, _mesa_PixelTransferi
);
661 SET_PixelZoom(disp
, _mesa_PixelZoom
);
663 /* GL_ARB_robustness */
664 SET_GetnPixelMapfvARB(disp
, _mesa_GetnPixelMapfvARB
);
665 SET_GetnPixelMapuivARB(disp
, _mesa_GetnPixelMapuivARB
);
666 SET_GetnPixelMapusvARB(disp
, _mesa_GetnPixelMapusvARB
);
670 /**********************************************************************/
671 /***** Initialization *****/
672 /**********************************************************************/
675 init_pixelmap(struct gl_pixelmap
*map
)
683 * Initialize the context's PIXEL attribute group.
686 _mesa_init_pixel( struct gl_context
*ctx
)
689 ctx
->Pixel
.RedBias
= 0.0;
690 ctx
->Pixel
.RedScale
= 1.0;
691 ctx
->Pixel
.GreenBias
= 0.0;
692 ctx
->Pixel
.GreenScale
= 1.0;
693 ctx
->Pixel
.BlueBias
= 0.0;
694 ctx
->Pixel
.BlueScale
= 1.0;
695 ctx
->Pixel
.AlphaBias
= 0.0;
696 ctx
->Pixel
.AlphaScale
= 1.0;
697 ctx
->Pixel
.DepthBias
= 0.0;
698 ctx
->Pixel
.DepthScale
= 1.0;
699 ctx
->Pixel
.IndexOffset
= 0;
700 ctx
->Pixel
.IndexShift
= 0;
701 ctx
->Pixel
.ZoomX
= 1.0;
702 ctx
->Pixel
.ZoomY
= 1.0;
703 ctx
->Pixel
.MapColorFlag
= GL_FALSE
;
704 ctx
->Pixel
.MapStencilFlag
= GL_FALSE
;
705 init_pixelmap(&ctx
->PixelMaps
.StoS
);
706 init_pixelmap(&ctx
->PixelMaps
.ItoI
);
707 init_pixelmap(&ctx
->PixelMaps
.ItoR
);
708 init_pixelmap(&ctx
->PixelMaps
.ItoG
);
709 init_pixelmap(&ctx
->PixelMaps
.ItoB
);
710 init_pixelmap(&ctx
->PixelMaps
.ItoA
);
711 init_pixelmap(&ctx
->PixelMaps
.RtoR
);
712 init_pixelmap(&ctx
->PixelMaps
.GtoG
);
713 init_pixelmap(&ctx
->PixelMaps
.BtoB
);
714 init_pixelmap(&ctx
->PixelMaps
.AtoA
);
716 if (ctx
->Visual
.doubleBufferMode
) {
717 ctx
->Pixel
.ReadBuffer
= GL_BACK
;
720 ctx
->Pixel
.ReadBuffer
= GL_FRONT
;
724 ctx
->_ImageTransferState
= 0;