blob: 0fa1f7b39dd9af1b8b4dc2e7781a2de477ad1b6d [file] [log] [blame]
Brian Paul8420ad92002-10-02 17:32:26 +00001Name
2
3 MESA_ycbcr_texture
4
5Name Strings
6
7 GL_MESA_ycbcr_texture
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 NV_texture_rectangle effects the definition of this extension.
31
32Overview
33
Brian Paulafc04282003-09-03 23:04:31 +000034 This extension supports texture images stored in the YCbCr format.
35 There is no support for converting YCbCr images to RGB or vice versa
36 during pixel transfer. The texture's YCbCr colors are converted to
37 RGB during texture sampling, after-which, all the usual per-fragment
38 operations take place. Only 2D texture images are supported (not
39 glDrawPixels, glReadPixels, etc).
Brian Paul8420ad92002-10-02 17:32:26 +000040
41 A YCbCr pixel (texel) is a 16-bit unsigned short with two components.
42 The first component is luminance (Y). For pixels in even-numbered
43 image columns, the second component is Cb. For pixels in odd-numbered
44 image columns, the second component is Cr. If one were to convert the
45 data to RGB one would need to examine two pixels from columns N and N+1
46 (where N is even) to deduce the RGB color.
47
48IP Status
49
50 None
51
52Issues
53
54 None
55
56New Procedures and Functions
57
58 None
59
60New Tokens
61
62 Accepted by the <internalFormat> and <format> parameters of
63 TexImage2D and TexSubImage2D:
64
Brian Paul7357f202003-05-02 15:05:02 +000065 YCBCR_MESA 0x8757
Brian Paul8420ad92002-10-02 17:32:26 +000066
67 Accepted by the <type> parameter of TexImage2D and TexSubImage2D:
68
Brian Paul7357f202003-05-02 15:05:02 +000069 UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple's */
70 UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple's */
Brian Paul8420ad92002-10-02 17:32:26 +000071
72Additions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
73
74 None
75
76Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
77
Brian Paul29f01902004-04-03 16:16:16 +000078 In section 3.6.4, Rasterization of Pixel Rectangles, on page 101,
Brian Paul8420ad92002-10-02 17:32:26 +000079 add the following to Table 3.8 (Packed pixel formats):
80
81 type Parameter GL Data Number of Matching
82 Token Name Type Components Pixel Formats
83 -------------- ------- ---------- -------------
Brian Paul29f01902004-04-03 16:16:16 +000084 UNSIGNED_SHORT_8_8_MESA ushort 2 YCBCR_MESA
85 UNSIGNED_SHORT_8_8_REV_MESA ushort 2 YCBCR_MESA
Brian Paul8420ad92002-10-02 17:32:26 +000086
87
88 In section 3.6.4, Rasterization of Pixel Rectangles, on page 102,
89 add the following to Table 3.10 (UNSIGNED_SHORT formats):
90
91 UNSIGNED_SHORT_8_8_MESA:
92
93 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
94 +-------------------------------+-------------------------------+
95 | 1st | 2nd |
96 +-------------------------------+-------------------------------+
97
98 UNSIGNED_SHORT_8_8_REV_MESA:
99
100 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
101 +-------------------------------+-------------------------------+
102 | 2nd | 1st |
103 +-------------------------------+-------------------------------+
104
105
Brian Paul29f01902004-04-03 16:16:16 +0000106 In section 3.6.4, Rasterization of Pixel Rectangles, on page 104,
Brian Paul8420ad92002-10-02 17:32:26 +0000107 add the following to Table 3.12 (Packed pixel fiedl assignments):
108
109 First Second Third Fourth
110 Format Element Element Element Element
111 ------ ------- ------- ------- -------
Brian Paul29f01902004-04-03 16:16:16 +0000112 YCBCR_MESA luminance chroma
Brian Paul8420ad92002-10-02 17:32:26 +0000113
114
115 In section 3.8.1, Texture Image Specification, on page 125, add
116 another item to the list of TexImage2D and TexImage3D equivalence
117 exceptions:
118
119 * The value of internalformat and format may be YCBCR_MESA to
120 indicate that the image data is in YCbCr format. type must
121 be either UNSIGNED_SHORT_8_8_MESA or UNSIGNED_SHORT_8_8_REV_MESA
122 as seen in tables 3.8 and 3.10. Table 3.12 describes the mapping
123 between Y and Cb/Cr to the components.
124 If NV_texture_rectangle is supported target may also be
125 TEXTURE_RECTANGLE_NV or PROXY_TEXTURE_RECTANGLE_NV.
126 All pixel transfer operations are bypassed. The texture is stored as
127 YCbCr, not RGB. Queries of the texture's red, green and blue component
Brian Paul361a9ac2003-09-19 14:58:21 +0000128 sizes will return zero. The YCbCr colors are converted to RGB during
129 texture sampling using an implementation dependent conversion.
Brian Paul8420ad92002-10-02 17:32:26 +0000130
131
132 In section 3.8.1, Texture Image Specification, on page 126, add
133 another item to the list of TexImage1D and TexImage2D equivalence
134 exceptions:
135
136 * The value of internalformat and format can not be YCBCR_MESA.
137
138
139 In section 3.8.2, Alternate Texture Image Specification Commands, on
140 page 129, insert this paragraph after the first full paragraph on the
141 page:
142
143 "If the internal storage format of the image being updated by
144 TexSubImage2D is YCBCR_MESA then format must be YCBCR_MESA.
145 The error INVALID_OPERATION will be generated otherwise."
146
147
148Additions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
149Operations and the Frame Buffer)
150
151 None
152
153Additions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
154
155 None
156
157Additions to Chapter 6 of the OpenGL 1.4 Specification (State and
158State Requests)
159
160 None
161
162Additions to Appendix A of the OpenGL 1.4 Specification (Invariance)
163
164 None
165
166Additions to the AGL/GLX/WGL Specifications
167
168 None
169
170GLX Protocol
171
172 None
173
174Errors
175
176 INVALID_ENUM is generated by TexImage2D if <internalFormat> is
177 MESA_YCBCR but <format> is not MESA_YCBCR.
178
179 INVALID_ENUM is generated by TexImage2D if <format> is MESA_YCBCR but
180 <internalFormat> is not MESA_YCBCR.
181
182 INVALID_VALUE is generated by TexImage2D if <format> is MESA_YCBCR and
183 <internalFormat> is MESA_YCBCR and <border> is not zero.
184
185 INVALID_OPERATION is generated by TexSubImage2D if the internal image
Brian Paul7357f202003-05-02 15:05:02 +0000186 format is YCBCR_MESA and <format> is not YCBCR_MESA.
Brian Paul8420ad92002-10-02 17:32:26 +0000187
188 INVALID_OPERATION is generated by CopyTexSubImage2D if the internal
189 image is YCBCR_MESA.
190
191New State
192
193 Edit table 6.16 on page 231: change the type of TEXTURE_INTERNAL_FORMAT
194 from n x Z42 to n x Z43 to indicate that internal format may also be
195 YCBCR_MESA.
196
197Revision History
198
199 20 September 2002 - Initial draft
Brian Paul7357f202003-05-02 15:05:02 +0000200 29 April 2003 - minor updates
Brian Paulafc04282003-09-03 23:04:31 +0000201 3 September 2003 - further clarify when YCbCr->RGB conversion takes place
Brian Paul361a9ac2003-09-19 14:58:21 +0000202 19 September 2003 - a few more updates prior to submitting to extension
203 registry.
Brian Paulfbb60ed2004-04-03 16:17:46 +0000204 3 April 2004 - fix assorted inaccuracies