Merge remote branch 'origin/master' into pipe-video
[mesa.git] / docs / MESA_pack_invert.spec
1 Name
2
3 MESA_pack_invert
4
5 Name Strings
6
7 GL_MESA_pack_invert
8
9 Contact
10
11 Brian Paul, Tungsten Graphics, Inc. (brian.paul 'at' tungstengraphics.com)
12 Keith Whitwell, Tungsten Graphics, Inc. (keith 'at' tungstengraphics.com)
13
14 Status
15
16 Shipping (Mesa 4.0.4 and later)
17
18 Version
19
20 1.0
21
22 Number
23
24 TBD
25
26 Dependencies
27
28 OpenGL 1.0 or later is required
29 This extensions is written against the OpenGL 1.4 Specification.
30
31 Overview
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
45 IP Status
46
47 None
48
49 Issues
50
51 1. Should we also defined UNPACK_INVERT_MESA for glDrawPixels, etc?
52
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
59 New Procedures and Functions
60
61 None
62
63 New 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
71 Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
72
73 None
74
75 Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
76
77 None
78
79 Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
80 Operations 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
103 Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
104
105 None
106
107 Additions to Chapter 6 of the OpenGL 1.4 Specification (State and
108 State Requests)
109
110 None
111
112 Additions to Appendix A of the OpenGL 1.4 Specification (Invariance)
113
114 None
115
116 Additions to the AGL/GLX/WGL Specifications
117
118 None
119
120 GLX Protocol
121
122 None
123
124 Errors
125
126 None
127
128 New 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
136 Revision History
137
138 21 September 2002 - Initial draft