11 Brian Paul
, Tungsten Graphics
, Inc.
(brian.paul 'at' tungstengraphics.com
)
12 Keith Whitwell
, Tungsten Graphics
, Inc.
(keith 'at' tungstengraphics.com
)
16 Shipping
(Mesa
4.0.4 and later
)
28 OpenGL
1.0 or later is required
29 This extensions is written against the OpenGL
1.4 Specification.
33 This extension adds a new pixel storage parameter to indicate that
34 images are to be packed
in top
-to
-bottom order instead of OpenGL's
35 conventional bottom
-to
-top order. Only pixel packing can be
36 inverted
(i.e.
for glReadPixels
, glGetTexImage
, glGetConvolutionFilter
,
39 Almost all known image file formats store images
in top
-to
-bottom
40 order. As it is
, OpenGL reads images from the frame buffer
in
41 bottom
-to
-top order. Thus
, images usually have to be inverted before
42 writing them to a file with image I
/O libraries. This extension
43 allows images to be
read such that inverting isn't needed.
51 1. Should we also defined UNPACK_INVERT_MESA
for glDrawPixels
, etc?
53 Resolved
: No
, we're only concerned with pixel packing. There are other
54 solutions
for inverting images when using glDrawPixels
(negative Y pixel
55 zoom
) or glTexImage
(invert the vertex T coordinates
). It would be easy
56 enough to define a complementary extension
for pixel packing
in the
59 New Procedures and Functions
65 Accepted by the
<pname
> parameter of PixelStorei and PixelStoref
66 and the
<pname
> parameter of GetIntegerv
, GetFloatv
, GetDoublev
69 PACK_INVERT_MESA
0x8758
71 Additions to Chapter
2 of the OpenGL
1.4 Specification
(OpenGL Operation
)
75 Additions to Chapter
3 of the OpenGL
1.4 Specification
(Rasterization
)
79 Additions to Chapter
4 of the OpenGL
1.4 Specification
(Per
-Fragment
80 Operations and the Frame Buffer
)
82 Add the following entry to table
4.4 (PixelStore parameters
) on page
182:
84 Parameter
Name Type Initial Value Valid Range
85 ---------------------------------------------------------
86 PACK_INVERT_MESA boolean FALSE TRUE
/FALSE
88 In the section labeled "Placement
in Client Memory" on page
184
89 insert the following text into the paragraph before the sentence
90 that starts with "If the format is RED
, GREEN
, BLUE..."
:
92 "The parameter PACK_INVERT_MESA controls whether the image is packed
93 in bottom
-to
-top order
(the default
) or top
-to
-bottom order. Equation
94 3.8 is modified as follows
:
96 ... the first element of the Nth row is indicated by
98 p
+ Nk
, if PACK_INVERT_MESA is false
99 p
+ k
* (H
- 1) - Nk
, if PACK_INVERT_MESA is true
, where H is the
103 Additions to Chapter
5 of the OpenGL
1.4 Specification
(Special Functions
)
107 Additions to Chapter
6 of the OpenGL
1.4 Specification
(State and
112 Additions to Appendix A of the OpenGL
1.4 Specification
(Invariance
)
116 Additions to the AGL
/GLX
/WGL Specifications
130 Add the following entry to table
6.20 (Pixels
) on page
235:
132 Get Value Type Get Cmd Initial Value Description Sec Attribute
133 --------------------------------------------------------------------------------------------------
134 PACK_INVERT_MESA boolean GetBoolean FALSE Value of PACK_INVERT_MESA
4.3.2 pixel
-store
138 21 September
2002 - Initial draft