blob: 33fb3c7bf806bc9ed7995efae06f70c299b7af63 [file] [log] [blame]
Brian Paul8420ad92002-10-02 17:32:26 +00001Name
2
3 MESA_pack_invert
4
5Name Strings
6
7 GL_MESA_pack_invert
8
9Contact
10
Brian Pauld3b09fe2004-03-25 01:42:41 +000011 Brian Paul, Tungsten Graphics, Inc. (brian.paul 'at' tungstengraphics.com)
Brian Paul8420ad92002-10-02 17:32:26 +000012 Keith Whitwell, Tungsten Graphics, Inc. (keith 'at' tungstengraphics.com)
13
14Status
15
16 Shipping (Mesa 4.0.4 and later)
17
18Version
19
20 1.0
21
22Number
23
24 TBD
25
26Dependencies
27
28 OpenGL 1.0 or later is required
29 This extensions is written against the OpenGL 1.4 Specification.
30
31Overview
32
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,
37 etc).
38
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.
44
45IP Status
46
47 None
48
49Issues
50
Nicolas Kaiserae5776c2011-04-10 09:58:50 -060051 1. Should we also define UNPACK_INVERT_MESA for glDrawPixels, etc?
Brian Paul8420ad92002-10-02 17:32:26 +000052
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
57 future if needed.
58
59New Procedures and Functions
60
61 None
62
63New Tokens
64
65 Accepted by the <pname> parameter of PixelStorei and PixelStoref
66 and the <pname> parameter of GetIntegerv, GetFloatv, GetDoublev
67 and GetBooleanv:
68
69 PACK_INVERT_MESA 0x8758
70
71Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
72
73 None
74
75Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
76
77 None
78
79Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
80Operations and the Frame Buffer)
81
82 Add the following entry to table 4.4 (PixelStore parameters) on page 182:
83
84 Parameter Name Type Initial Value Valid Range
85 ---------------------------------------------------------
86 PACK_INVERT_MESA boolean FALSE TRUE/FALSE
87
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...":
91
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:
95
96 ... the first element of the Nth row is indicated by
97
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
100 image height
101 "
102
103Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
104
105 None
106
107Additions to Chapter 6 of the OpenGL 1.4 Specification (State and
108State Requests)
109
110 None
111
112Additions to Appendix A of the OpenGL 1.4 Specification (Invariance)
113
114 None
115
116Additions to the AGL/GLX/WGL Specifications
117
118 None
119
120GLX Protocol
121
122 None
123
124Errors
125
126 None
127
128New State
129
130 Add the following entry to table 6.20 (Pixels) on page 235:
131
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
135
136Revision History
137
138 21 September 2002 - Initial draft