rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glTexImage1D.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="glTexImage1D">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glTexImage1D</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glTexImage1D</refname>
17 <refpurpose>specify a one-dimensional texture image</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glTexImage1D</function></funcdef>
23 <paramdef>GLenum <parameter>target</parameter></paramdef>
24 <paramdef>GLint <parameter>level</parameter></paramdef>
25 <paramdef>GLint <parameter>internalFormat</parameter></paramdef>
26 <paramdef>GLsizei <parameter>width</parameter></paramdef>
27 <paramdef>GLint <parameter>border</parameter></paramdef>
28 <paramdef>GLenum <parameter>format</parameter></paramdef>
29 <paramdef>GLenum <parameter>type</parameter></paramdef>
30 <paramdef>const GLvoid * <parameter>data</parameter></paramdef>
31 </funcprototype>
32 </funcsynopsis>
33 </refsynopsisdiv>
34 <!-- eqn: ignoring delim $$ -->
35 <para>
36 </para>
37 <refsect1 id="parameters"><title>Parameters</title>
38 <variablelist>
39 <varlistentry>
40 <term><parameter>target</parameter></term>
41 <listitem>
42 <para>
43 Specifies the target texture.
44 Must be <constant>GL_TEXTURE_1D</constant> or <constant>GL_PROXY_TEXTURE_1D</constant>.
45 </para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>level</parameter></term>
50 <listitem>
51 <para>
52 Specifies the level-of-detail number.
53 Level 0 is the base image level.
54 Level <emphasis>n</emphasis> is the <emphasis>n</emphasis>th mipmap reduction image.
55 </para>
56 </listitem>
57 </varlistentry>
58 <varlistentry>
59 <term><parameter>internalFormat</parameter></term>
60 <listitem>
61 <para>
62 Specifies the number of color components in the texture.
63 Must be 1, 2, 3, or 4, or one of the following symbolic constants:
64 <constant>GL_ALPHA</constant>,
65 <constant>GL_ALPHA4</constant>,
66 <constant>GL_ALPHA8</constant>,
67 <constant>GL_ALPHA12</constant>,
68 <constant>GL_ALPHA16</constant>,
69 <constant>GL_COMPRESSED_ALPHA</constant>,
70 <constant>GL_COMPRESSED_LUMINANCE</constant>,
71 <constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
72 <constant>GL_COMPRESSED_INTENSITY</constant>,
73 <constant>GL_COMPRESSED_RGB</constant>,
74 <constant>GL_COMPRESSED_RGBA</constant>,
75 <constant>GL_DEPTH_COMPONENT</constant>,
76 <constant>GL_DEPTH_COMPONENT16</constant>,
77 <constant>GL_DEPTH_COMPONENT24</constant>,
78 <constant>GL_DEPTH_COMPONENT32</constant>,
79 <constant>GL_LUMINANCE</constant>,
80 <constant>GL_LUMINANCE4</constant>,
81 <constant>GL_LUMINANCE8</constant>,
82 <constant>GL_LUMINANCE12</constant>,
83 <constant>GL_LUMINANCE16</constant>,
84 <constant>GL_LUMINANCE_ALPHA</constant>,
85 <constant>GL_LUMINANCE4_ALPHA4</constant>,
86 <constant>GL_LUMINANCE6_ALPHA2</constant>,
87 <constant>GL_LUMINANCE8_ALPHA8</constant>,
88 <constant>GL_LUMINANCE12_ALPHA4</constant>,
89 <constant>GL_LUMINANCE12_ALPHA12</constant>,
90 <constant>GL_LUMINANCE16_ALPHA16</constant>,
91 <constant>GL_INTENSITY</constant>,
92 <constant>GL_INTENSITY4</constant>,
93 <constant>GL_INTENSITY8</constant>,
94 <constant>GL_INTENSITY12</constant>,
95 <constant>GL_INTENSITY16</constant>,
96 <constant>GL_R3_G3_B2</constant>,
97 <constant>GL_RGB</constant>,
98 <constant>GL_RGB4</constant>,
99 <constant>GL_RGB5</constant>,
100 <constant>GL_RGB8</constant>,
101 <constant>GL_RGB10</constant>,
102 <constant>GL_RGB12</constant>,
103 <constant>GL_RGB16</constant>,
104 <constant>GL_RGBA</constant>,
105 <constant>GL_RGBA2</constant>,
106 <constant>GL_RGBA4</constant>,
107 <constant>GL_RGB5_A1</constant>,
108 <constant>GL_RGBA8</constant>,
109 <constant>GL_RGB10_A2</constant>,
110 <constant>GL_RGBA12</constant>,
111 <constant>GL_RGBA16</constant>,
112 <constant>GL_SLUMINANCE</constant>,
113 <constant>GL_SLUMINANCE8</constant>,
114 <constant>GL_SLUMINANCE_ALPHA</constant>,
115 <constant>GL_SLUMINANCE8_ALPHA8</constant>,
116 <constant>GL_SRGB</constant>,
117 <constant>GL_SRGB8</constant>,
118 <constant>GL_SRGB_ALPHA</constant>, or
119 <constant>GL_SRGB8_ALPHA8</constant>.
120 </para>
121 </listitem>
122 </varlistentry>
123 <varlistentry>
124 <term><parameter>width</parameter></term>
125 <listitem>
126 <para>
127 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
128 <inlineequation><mml:math>
129 <!-- eqn: 2 sup n + 2 ( border ):-->
130 <mml:mrow>
131 <mml:msup><mml:mn>2</mml:mn>
132 <mml:mi mathvariant="italic">n</mml:mi>
133 </mml:msup>
134 <mml:mo>+</mml:mo>
135 <mml:mrow>
136 <mml:mn>2</mml:mn>
137 <mml:mo>&af;</mml:mo>
138 <mml:mfenced open="(" close=")">
139 <mml:mi mathvariant="italic">border</mml:mi>
140 </mml:mfenced>
141 </mml:mrow>
142 </mml:mrow>
143 </mml:math></inlineequation>
144 for some integer
145 <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
146 All
147 implementations support texture images that are at least 64 texels
148 wide. The height of the 1D texture image is 1.
149 </para>
150 </listitem>
151 </varlistentry>
152 <varlistentry>
153 <term><parameter>border</parameter></term>
154 <listitem>
155 <para>
156 Specifies the width of the border.
157 Must be either 0 or 1.
158 </para>
159 </listitem>
160 </varlistentry>
161 <varlistentry>
162 <term><parameter>format</parameter></term>
163 <listitem>
164 <para>
165 Specifies the format of the pixel data.
166 The following symbolic values are accepted:
167 <constant>GL_COLOR_INDEX</constant>,
168 <constant>GL_RED</constant>,
169 <constant>GL_GREEN</constant>,
170 <constant>GL_BLUE</constant>,
171 <constant>GL_ALPHA</constant>,
172 <constant>GL_RGB</constant>,
173 <constant>GL_BGR</constant>,
174 <constant>GL_RGBA</constant>,
175 <constant>GL_BGRA</constant>,
176 <constant>GL_LUMINANCE</constant>, and
177 <constant>GL_LUMINANCE_ALPHA</constant>.
178 </para>
179 </listitem>
180 </varlistentry>
181 <varlistentry>
182 <term><parameter>type</parameter></term>
183 <listitem>
184 <para>
185 Specifies the data type of the pixel data.
186 The following symbolic values are accepted:
187 <constant>GL_UNSIGNED_BYTE</constant>,
188 <constant>GL_BYTE</constant>,
189 <constant>GL_BITMAP</constant>,
190 <constant>GL_UNSIGNED_SHORT</constant>,
191 <constant>GL_SHORT</constant>,
192 <constant>GL_UNSIGNED_INT</constant>,
193 <constant>GL_INT</constant>,
194 <constant>GL_FLOAT</constant>,
195 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
196 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
197 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>,
198 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>,
199 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
200 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
201 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
202 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
203 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
204 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
205 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>, and
206 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant>.
207 </para>
208 </listitem>
209 </varlistentry>
210 <varlistentry>
211 <term><parameter>data</parameter></term>
212 <listitem>
213 <para>
214 Specifies a pointer to the image data in memory.
215 </para>
216 </listitem>
217 </varlistentry>
218 </variablelist>
219 </refsect1>
220 <refsect1 id="description"><title>Description</title>
221 <para>
222 Texturing maps a portion of a specified texture image
223 onto each graphical primitive for which texturing is enabled.
224 To enable and disable one-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>
225 and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_1D</constant>.
226 </para>
227 <para>
228 Texture images are defined with <function>glTexImage1D</function>.
229 The arguments describe the parameters of the texture image,
230 such as width,
231 width of the border,
232 level-of-detail number
233 (see <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>),
234 and the internal resolution and format used to store the image.
235 The last three arguments describe how the image is represented in
236 memory; they are identical to the pixel formats used for
237 <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>.
238 </para>
239 <para>
240 If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_1D</constant>, no data is read from <parameter>data</parameter>, but
241 all of the texture image state is recalculated, checked for
242 consistency, and checked against the implementation's capabilities.
243 If the implementation cannot handle a texture of the
244 requested texture size, it sets all of the image state to 0,
245 but does not generate an error (see <citerefentry><refentrytitle>glGetError</refentrytitle></citerefentry>). To query for an
246 entire mipmap array, use an image array level greater than or equal to
247 1.
248 </para>
249 <para>
250 If <parameter>target</parameter> is <constant>GL_TEXTURE_1D</constant>,
251 data is read from <parameter>data</parameter> as a sequence of signed or unsigned bytes,
252 shorts,
253 or longs,
254 or single-precision floating-point values,
255 depending on <parameter>type</parameter>.
256 These values are grouped into sets of one,
257 two,
258 three,
259 or four values,
260 depending on <parameter>format</parameter>,
261 to form elements.
262 If <parameter>type</parameter> is <constant>GL_BITMAP</constant>,
263 the data is considered as a string of unsigned bytes
264 (and <parameter>format</parameter> must be <constant>GL_COLOR_INDEX</constant>).
265 Each data byte is treated as eight 1-bit elements,
266 with bit ordering determined by <constant>GL_UNPACK_LSB_FIRST</constant>
267 (see <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>).
268 </para>
269 <para>
270 If a non-zero named buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target
271 (see <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>) while a texture image is
272 specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
273 </para>
274 <para>
275 The first element corresponds to the left end of the texture array.
276 Subsequent elements progress left-to-right through the remaining texels
277 in the texture array.
278 The final element corresponds to the right end of the texture array.
279 </para>
280 <para>
281 <parameter>format</parameter> determines the composition of each element in <parameter>data</parameter>.
282 It can assume one of these symbolic values:
283 </para>
284 <variablelist>
285 <varlistentry>
286 <term><constant>GL_COLOR_INDEX</constant></term>
287 <listitem>
288 <para>
289 Each element is a single value,
290 a color index.
291 The GL converts it to fixed point
292 (with an unspecified number of zero bits to the right of the binary point),
293 shifted left or right depending on the value and sign of <constant>GL_INDEX_SHIFT</constant>,
294 and added to <constant>GL_INDEX_OFFSET</constant>
295 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
296 The resulting index is converted to a set of color components
297 using the
298 <constant>GL_PIXEL_MAP_I_TO_R</constant>,
299 <constant>GL_PIXEL_MAP_I_TO_G</constant>,
300 <constant>GL_PIXEL_MAP_I_TO_B</constant>, and
301 <constant>GL_PIXEL_MAP_I_TO_A</constant> tables,
302 and clamped to the range [0,1].
303 </para>
304 </listitem>
305 </varlistentry>
306 <varlistentry>
307 <term><constant>GL_RED</constant></term>
308 <listitem>
309 <para>
310 Each element is a single red component.
311 The GL converts it to floating point and assembles it into an RGBA element
312 by attaching 0 for green and blue, and 1 for alpha.
313 Each component is then multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
314 added to the signed bias <constant>GL_c_BIAS</constant>,
315 and clamped to the range [0,1]
316 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
317 </para>
318 </listitem>
319 </varlistentry>
320 <varlistentry>
321 <term><constant>GL_GREEN</constant></term>
322 <listitem>
323 <para>
324 Each element is a single green component.
325 The GL converts it to floating point and assembles it into an RGBA element
326 by attaching 0 for red and blue, and 1 for alpha.
327 Each component is then multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
328 added to the signed bias <constant>GL_c_BIAS</constant>,
329 and clamped to the range [0,1]
330 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
331 </para>
332 </listitem>
333 </varlistentry>
334 <varlistentry>
335 <term><constant>GL_BLUE</constant></term>
336 <listitem>
337 <para>
338 Each element is a single blue component.
339 The GL converts it to floating point and assembles it into an RGBA element
340 by attaching 0 for red and green, and 1 for alpha.
341 Each component is then multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
342 added to the signed bias <constant>GL_c_BIAS</constant>,
343 and clamped to the range [0,1]
344 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
345 </para>
346 </listitem>
347 </varlistentry>
348 <varlistentry>
349 <term><constant>GL_ALPHA</constant></term>
350 <listitem>
351 <para>
352 Each element is a single alpha component.
353 The GL converts it to floating point and assembles it into an RGBA element
354 by attaching 0 for red, green, and blue.
355 Each component is then multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
356 added to the signed bias <constant>GL_c_BIAS</constant>,
357 and clamped to the range [0,1]
358 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
359 </para>
360 </listitem>
361 </varlistentry>
362 <varlistentry>
363 <term><constant>GL_INTENSITY</constant></term>
364 <listitem>
365 <para>
366 Each element is a single intensity value.
367 The GL converts it to floating point,
368 then assembles it into an RGBA element by replicating the intensity value
369 three times for red, green, blue, and alpha.
370 Each component is then multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
371 added to the signed bias <constant>GL_c_BIAS</constant>,
372 and clamped to the range [0,1]
373 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
374 </para>
375 </listitem>
376 </varlistentry>
377 <varlistentry>
378 <term><constant>GL_RGB</constant></term>
379 <listitem>
380 </listitem>
381 </varlistentry>
382 <varlistentry>
383 <term><constant>GL_BGR</constant></term>
384 <listitem>
385 <para>
386 Each element is an RGB triple.
387 The GL converts it to floating point and assembles it into an RGBA element
388 by attaching 1 for alpha.
389 Each component is then multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
390 added to the signed bias <constant>GL_c_BIAS</constant>,
391 and clamped to the range [0,1]
392 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
393 </para>
394 </listitem>
395 </varlistentry>
396 <varlistentry>
397 <term><constant>GL_RGBA</constant></term>
398 <listitem>
399 </listitem>
400 </varlistentry>
401 <varlistentry>
402 <term><constant>GL_BGRA</constant></term>
403 <listitem>
404 <para>
405 Each element contains all four components.
406 Each component is multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
407 added to the signed bias <constant>GL_c_BIAS</constant>,
408 and clamped to the range [0,1]
409 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
410 </para>
411 </listitem>
412 </varlistentry>
413 <varlistentry>
414 <term><constant>GL_LUMINANCE</constant></term>
415 <listitem>
416 <para>
417 Each element is a single luminance value.
418 The GL converts it to floating point,
419 then assembles it into an RGBA element by replicating the luminance value
420 three times for red, green, and blue and attaching 1 for alpha.
421 Each component is then multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
422 added to the signed bias <constant>GL_c_BIAS</constant>,
423 and clamped to the range [0,1]
424 (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
425 </para>
426 </listitem>
427 </varlistentry>
428 <varlistentry>
429 <term><constant>GL_LUMINANCE_ALPHA</constant></term>
430 <listitem>
431 <para>
432 Each element is a luminance/alpha pair.
433 The GL converts it to floating point,
434 then assembles it into an RGBA element by replicating the luminance value
435 three times for red, green, and blue.
436 Each component is then multiplied by the signed scale factor <constant>GL_c_SCALE</constant>,
437 added to the signed bias <constant>GL_c_BIAS</constant>,
438 and clamped to the range [0,1] (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
439 </para>
440 </listitem>
441 </varlistentry>
442 <varlistentry>
443 <term><constant>GL_DEPTH_COMPONENT</constant></term>
444 <listitem>
445 <para>
446 Each element is a single depth value.
447 The GL converts it to floating point, multiplies by the signed scale factor
448 <constant>GL_DEPTH_SCALE</constant>, adds the signed bias <constant>GL_DEPTH_BIAS</constant>,
449 and clamps to the range [0,1] (see <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>).
450 </para>
451 </listitem>
452 </varlistentry>
453 </variablelist>
454 <para>
455 Refer to the <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry> reference page for a description of
456 the acceptable values for the <parameter>type</parameter> parameter.
457 </para>
458 <para>
459 If an application wants to store the texture at a certain
460 resolution or in a certain format, it can request the resolution
461 and format with <parameter>internalFormat</parameter>. The GL will choose an internal
462 representation that closely approximates that requested by <parameter>internalFormat</parameter>, but
463 it may not match exactly.
464 (The representations specified by <constant>GL_LUMINANCE</constant>,
465 <constant>GL_LUMINANCE_ALPHA</constant>, <constant>GL_RGB</constant>,
466 and <constant>GL_RGBA</constant> must match exactly. The numeric values 1, 2, 3, and 4
467 may also be used to specify the above representations.)
468 </para>
469 <para>
470 If the <parameter>internalFormat</parameter> parameter is one of the generic compressed formats,
471 <constant>GL_COMPRESSED_ALPHA</constant>,
472 <constant>GL_COMPRESSED_INTENSITY</constant>,
473 <constant>GL_COMPRESSED_LUMINANCE</constant>,
474 <constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
475 <constant>GL_COMPRESSED_RGB</constant>, or
476 <constant>GL_COMPRESSED_RGBA</constant>, the GL will replace the internal format with the symbolic constant for a specific internal format and compress the texture before storage. If no corresponding internal format is available, or the GL can not compress that image for any reason, the internal format is instead replaced with a corresponding base internal format.
477 </para>
478 <para>
479 If the <parameter>internalFormat</parameter> parameter is
480 <constant>GL_SRGB</constant>,
481 <constant>GL_SRGB8</constant>,
482 <constant>GL_SRGB_ALPHA</constant>,
483 <constant>GL_SRGB8_ALPHA8</constant>,
484 <constant>GL_SLUMINANCE</constant>,
485 <constant>GL_SLUMINANCE8</constant>,
486 <constant>GL_SLUMINANCE_ALPHA</constant>, or
487 <constant>GL_SLUMINANCE8_ALPHA8</constant>, the texture is treated as if the red, green, blue, or luminance components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component
488 <inlineequation><mml:math>
489 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
490 <mml:mi mathvariant="italic">s</mml:mi>
491 </mml:msub>
492 </mml:math></inlineequation>
493 to a linear component
494 <inlineequation><mml:math>
495 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
496 <mml:mi mathvariant="italic">l</mml:mi>
497 </mml:msub>
498 </mml:math></inlineequation>
499 is:
500 </para>
501 <para>
502 <inlineequation><mml:math>
503 <mml:mrow>
504 <mml:msub>
505 <mml:mi mathvariant="italic">c</mml:mi>
506 <mml:mi mathvariant="italic">l</mml:mi>
507 </mml:msub>
508 <mml:mo>=</mml:mo>
509 <mml:mrow>
510 <mml:mo>{</mml:mo>
511
512 <mml:mtable columnalign="left">
513 <mml:mtr>
514 <mml:mtd columnalign="left">
515 <mml:mfrac>
516 <mml:msub>
517 <mml:mi mathvariant="italic">c</mml:mi>
518 <mml:mi mathvariant="italic">s</mml:mi>
519 </mml:msub>
520 <mml:mn>12.92</mml:mn>
521 </mml:mfrac>
522 </mml:mtd>
523 <mml:mtd columnalign="left">
524 <mml:mrow>
525 <mml:mspace width="1ex"/>
526 <mml:mo>if</mml:mo>
527 <mml:mspace width="1ex"/>
528 </mml:mrow>
529 <mml:msub>
530 <mml:mi mathvariant="italic">c</mml:mi>
531 <mml:mi mathvariant="italic">s</mml:mi>
532 </mml:msub>
533 <mml:mo>&le;</mml:mo>
534 <mml:mn>0.04045</mml:mn>
535 </mml:mtd>
536 </mml:mtr>
537 <mml:mtr>
538 <mml:mtd columnalign="left">
539 <mml:msup>
540 <mml:mrow>
541 <mml:mo>(</mml:mo>
542 <mml:mfrac>
543 <mml:mrow>
544 <mml:msub>
545 <mml:mi>c</mml:mi>
546 <mml:mi>s</mml:mi>
547 </mml:msub>
548 <mml:mo>+</mml:mo>
549 <mml:mn>0.055</mml:mn>
550 </mml:mrow>
551 <mml:mn>1.055</mml:mn>
552 </mml:mfrac>
553 <mml:mo>)</mml:mo>
554 </mml:mrow>
555 <mml:mn>2.4</mml:mn>
556 </mml:msup>
557 </mml:mtd>
558 <mml:mtd columnalign="left">
559 <mml:mrow>
560 <mml:mspace width="1ex"/>
561 <mml:mo>if</mml:mo>
562 <mml:mspace width="1ex"/>
563 </mml:mrow>
564 <mml:msub>
565 <mml:mi mathvariant="italic">c</mml:mi>
566 <mml:mi mathvariant="italic">s</mml:mi>
567 </mml:msub>
568 <mml:mo>&gt;</mml:mo>
569 <mml:mn>0.04045</mml:mn>
570 </mml:mtd>
571 </mml:mtr>
572 </mml:mtable>
573 </mml:mrow>
574 </mml:mrow>
575 </mml:math>
576 </inlineequation>
577 </para>
578 <para>
579 Assume
580 <inlineequation><mml:math>
581 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
582 <mml:mi mathvariant="italic">s</mml:mi>
583 </mml:msub>
584 </mml:math></inlineequation>
585 is the sRGB component in the range [0,1].
586 </para>
587 <para>
588 Use the <constant>GL_PROXY_TEXTURE_1D</constant> target to try out a resolution and
589 format. The implementation will
590 update and recompute its best match for the requested storage resolution
591 and format. To then query this state, call <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
592 If the texture cannot be accommodated, texture state is set to 0.
593 </para>
594 <para>
595 A one-component texture image uses only the red component of the RGBA
596 color from <parameter>data</parameter>.
597 A two-component image uses the R and A values.
598 A three-component image uses the R, G, and B values.
599 A four-component image uses all of the RGBA components.
600 </para>
601 <para>
602 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures during texture filtering and application. Image-based shadowing can be enabled by comparing texture r coordinates to depth texture values to generate a boolean result. See <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry> for details on texture comparison.
603 </para>
604 </refsect1>
605 <refsect1 id="notes"><title>Notes</title>
606 <para>
607 Texturing has no effect in color index mode.
608 </para>
609 <para>
610 If the <code>ARB_imaging</code> extension is supported, RGBA elements may
611 also be processed by the imaging pipeline. The following stages may be
612 applied to an RGBA color before color component clamping to the range
613 <inlineequation><mml:math>
614 <!-- eqn: [0,1]:-->
615 <mml:mfenced open="[" close="]">
616 <mml:mn>0</mml:mn>
617 <mml:mn>1</mml:mn>
618 </mml:mfenced>
619 </mml:math></inlineequation>:
620 </para>
621 <variablelist>
622 <varlistentry>
623 <term>1. Color component replacement by the color table specified for</term>
624 <listitem>
625 <para>
626 <constant>GL_COLOR_TABLE</constant>, if enabled. See <citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>.
627 </para>
628 </listitem>
629 </varlistentry>
630 <varlistentry>
631 <term>2. One-dimensional convolution filtering, if enabled. See</term>
632 <listitem>
633 <para>
634 <citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>.
635 </para>
636 <para>
637 If a convolution filter changes the <parameter>width</parameter> of the texture (by
638 processing with a <constant>GL_CONVOLUTION_BORDER_MODE</constant> of <constant>GL_REDUCE</constant>, for
639 example), the <parameter>width</parameter> must
640 <inlineequation><mml:math>
641 <!-- eqn: 2 sup n + 2 ( border ):-->
642 <mml:mrow>
643 <mml:msup><mml:mn>2</mml:mn>
644 <mml:mi mathvariant="italic">n</mml:mi>
645 </mml:msup>
646 <mml:mo>+</mml:mo>
647 <mml:mrow>
648 <mml:mn>2</mml:mn>
649 <mml:mo>&af;</mml:mo>
650 <mml:mfenced open="(" close=")">
651 <mml:mi mathvariant="italic">border</mml:mi>
652 </mml:mfenced>
653 </mml:mrow>
654 </mml:mrow>
655 </mml:math></inlineequation>,
656 for some
657 integer
658 <inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>,
659 after filtering.
660 </para>
661 </listitem>
662 </varlistentry>
663 <varlistentry>
664 <term>3. RGBA components may be multiplied by <constant>GL_POST_CONVOLUTION_c_SCALE</constant>,</term>
665 <listitem>
666 <para>
667 and added to <constant>GL_POST_CONVOLUTION_c_BIAS</constant>, if enabled. See
668 <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>.
669 </para>
670 </listitem>
671 </varlistentry>
672 <varlistentry>
673 <term>4. Color component replacement by the color table specified for</term>
674 <listitem>
675 <para>
676 <constant>GL_POST_CONVOLUTION_COLOR_TABLE</constant>, if enabled. See <citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>.
677 </para>
678 </listitem>
679 </varlistentry>
680 <varlistentry>
681 <term>5. Transformation by the color matrix.</term>
682 <listitem>
683 <para>
684 See <citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>.
685 </para>
686 </listitem>
687 </varlistentry>
688 <varlistentry>
689 <term>6. RGBA components may be multiplied by <constant>GL_POST_COLOR_MATRIX_c_SCALE</constant>,</term>
690 <listitem>
691 <para>
692 and added to <constant>GL_POST_COLOR_MATRIX_c_BIAS</constant>, if enabled. See
693 <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>.
694 </para>
695 </listitem>
696 </varlistentry>
697 <varlistentry>
698 <term>7. Color component replacement by the color table specified for</term>
699 <listitem>
700 <para>
701 <constant>GL_POST_COLOR_MATRIX_COLOR_TABLE</constant>, if enabled. See <citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>.
702 </para>
703 </listitem>
704 </varlistentry>
705 </variablelist>
706 <para>
707 The texture image can be represented by the same data formats
708 as the pixels in a <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry> command,
709 except that <constant>GL_STENCIL_INDEX</constant>
710 cannot be used.
711 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry> modes affect texture images
712 in exactly the way they affect <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>.
713 </para>
714 <para>
715 <constant>GL_PROXY_TEXTURE_1D</constant> may be used only if the GL version is 1.1 or greater.
716 </para>
717 <para>
718 Internal formats other than 1, 2, 3, or 4 may be
719 used only if the GL version is 1.1 or greater.
720 </para>
721 <para>
722 In GL version 1.1 or greater,
723 <parameter>data</parameter> may be a null pointer. In this case texture memory is
724 allocated to accommodate a texture of width <parameter>width</parameter>.
725 You can then download subtextures to initialize the
726 texture memory. The image is undefined if the program tries to apply
727 an uninitialized portion of the texture image to a primitive.
728 </para>
729 <para>
730 Formats <constant>GL_BGR</constant>, and <constant>GL_BGRA</constant> and types
731 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
732 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
733 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>,
734 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>,
735 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
736 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
737 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
738 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
739 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
740 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
741 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>, and
742 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant> are available only if the GL version
743 is 1.2 or greater.
744 </para>
745 <para>
746 When the <code>ARB_multitexture</code> extension is supported, or the GL version is 1.3 or greater, <function>glTexImage1D</function>
747 specifies the one-dimensional texture for the current texture unit,
748 specified with <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>.
749 </para>
750 <para>
751 <constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
752 <constant>GL_DEPTH_COMPONENT24</constant>, and <constant>GL_DEPTH_COMPONENT32</constant> are available only
753 if the GL version is 1.4 or greater.
754 </para>
755 <para>
756 Non-power-of-two textures are supported if the GL version is 2.0 or greater, or if the implementation exports the <constant>GL_ARB_texture_non_power_of_two</constant> extension.
757 </para>
758 <para>
759 The
760 <constant>GL_SRGB</constant>,
761 <constant>GL_SRGB8</constant>,
762 <constant>GL_SRGB_ALPHA</constant>,
763 <constant>GL_SRGB8_ALPHA8</constant>,
764 <constant>GL_SLUMINANCE</constant>,
765 <constant>GL_SLUMINANCE8</constant>,
766 <constant>GL_SLUMINANCE_ALPHA</constant>, and
767 <constant>GL_SLUMINANCE8_ALPHA8</constant>
768 internal formats are only available if the GL version is 2.1 or greater.
769 </para>
770 </refsect1>
771 <refsect1 id="errors"><title>Errors</title>
772 <para>
773 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_TEXTURE_1D</constant>
774 or <constant>GL_PROXY_TEXTURE_1D</constant>.
775 </para>
776 <para>
777 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>format</parameter> is not an accepted
778 format constant. Format constants other than <constant>GL_STENCIL_INDEX</constant>
779 are accepted.
780 </para>
781 <para>
782 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not a type constant.
783 </para>
784 <para>
785 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is <constant>GL_BITMAP</constant> and
786 <parameter>format</parameter> is not <constant>GL_COLOR_INDEX</constant>.
787 </para>
788 <para>
789 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>level</parameter> is less than 0.
790 </para>
791 <para>
792 <constant>GL_INVALID_VALUE</constant> may be generated if <parameter>level</parameter> is greater than
793 <inlineequation><mml:math>
794 <!-- eqn: log sub 2 (max):-->
795 <mml:mrow>
796 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
797 <mml:mn>2</mml:mn>
798 </mml:msub>
799 <mml:mo>&af;</mml:mo>
800 <mml:mfenced open="(" close=")">
801 <mml:mi mathvariant="italic">max</mml:mi>
802 </mml:mfenced>
803 </mml:mrow>
804 </mml:math></inlineequation>,
805 where <emphasis>max</emphasis> is the returned value of <constant>GL_MAX_TEXTURE_SIZE</constant>.
806 </para>
807 <para>
808 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>internalFormat</parameter> is not 1, 2, 3, 4, or
809 one of the accepted resolution and format symbolic constants.
810 </para>
811 <para>
812 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter> is less than 0
813 or greater than 2 + <constant>GL_MAX_TEXTURE_SIZE</constant>.
814 </para>
815 <para>
816 <constant>GL_INVALID_VALUE</constant> is generated if non-power-of-two textures are not supported and the <parameter>width</parameter> cannot be represented as
817 <inlineequation><mml:math>
818 <!-- eqn: 2 sup n + 2(border):-->
819 <mml:mrow>
820 <mml:msup><mml:mn>2</mml:mn>
821 <mml:mi mathvariant="italic">n</mml:mi>
822 </mml:msup>
823 <mml:mo>+</mml:mo>
824 <mml:mrow>
825 <mml:mn>2</mml:mn>
826 <mml:mo>&af;</mml:mo>
827 <mml:mfenced open="(" close=")">
828 <mml:mi mathvariant="italic">border</mml:mi>
829 </mml:mfenced>
830 </mml:mrow>
831 </mml:mrow>
832 </mml:math></inlineequation>
833 for some integer value of <emphasis>n</emphasis>.
834 </para>
835 <para>
836 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>border</parameter> is not 0 or 1.
837 </para>
838 <para>
839 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>type</parameter> is one of
840 <constant>GL_UNSIGNED_BYTE_3_3_2</constant>,
841 <constant>GL_UNSIGNED_BYTE_2_3_3_REV</constant>,
842 <constant>GL_UNSIGNED_SHORT_5_6_5</constant>, or
843 <constant>GL_UNSIGNED_SHORT_5_6_5_REV</constant>
844 and <parameter>format</parameter> is not <constant>GL_RGB</constant>.
845 </para>
846 <para>
847 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>type</parameter> is one of
848 <constant>GL_UNSIGNED_SHORT_4_4_4_4</constant>,
849 <constant>GL_UNSIGNED_SHORT_4_4_4_4_REV</constant>,
850 <constant>GL_UNSIGNED_SHORT_5_5_5_1</constant>,
851 <constant>GL_UNSIGNED_SHORT_1_5_5_5_REV</constant>,
852 <constant>GL_UNSIGNED_INT_8_8_8_8</constant>,
853 <constant>GL_UNSIGNED_INT_8_8_8_8_REV</constant>,
854 <constant>GL_UNSIGNED_INT_10_10_10_2</constant>, or
855 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant>
856 and <parameter>format</parameter> is neither <constant>GL_RGBA</constant> nor <constant>GL_BGRA</constant>.
857 </para>
858 <para>
859 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>format</parameter> is
860 <constant>GL_DEPTH_COMPONENT</constant> and <parameter>internalFormat</parameter> is not
861 <constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
862 <constant>GL_DEPTH_COMPONENT24</constant>, or <constant>GL_DEPTH_COMPONENT32</constant>.
863 </para>
864 <para>
865 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>internalFormat</parameter> is
866 <constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
867 <constant>GL_DEPTH_COMPONENT24</constant>, or <constant>GL_DEPTH_COMPONENT32</constant>, and <parameter>format</parameter> is
868 not <constant>GL_DEPTH_COMPONENT</constant>.
869 </para>
870 <para>
871 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
872 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the buffer object's data store is currently mapped.
873 </para>
874 <para>
875 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
876 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
877 object such that the memory reads required would exceed the data store size.
878 </para>
879 <para>
880 <constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to the
881 <constant>GL_PIXEL_UNPACK_BUFFER</constant> target and <parameter>data</parameter> is not evenly divisible
882 into the number of bytes needed to store in memory a datum indicated by <parameter>type</parameter>.
883 </para>
884 <para>
885 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glTexImage1D</function>
886 is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
887 and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
888 </para>
889 </refsect1>
890 <refsect1 id="associatedgets"><title>Associated Gets</title>
891 <para>
892 <citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
893 </para>
894 <para>
895 <citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_1D</constant>
896 </para>
897 <para>
898 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
899 </para>
900 </refsect1>
901 <refsect1 id="seealso"><title>See Also</title>
902 <para>
903 <citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
904 <citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
905 <citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
906 <citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
907 <citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
908 <citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
909 <citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
910 <citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
911 <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
912 <citerefentry><refentrytitle>glGetCompressedTexImage</refentrytitle></citerefentry>,
913 <citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>,
914 <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
915 <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
916 <citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
917 <citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
918 <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
919 <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
920 <citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
921 <citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
922 <citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>,
923 <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
924 </para>
925 </refsect1>
926 <refsect1 id="Copyright"><title>Copyright</title>
927 <para>
928 Copyright <trademark class="copyright"></trademark> 1991-2006
929 Silicon Graphics, Inc. This document is licensed under the SGI
930 Free Software B License. For details, see
931 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
932 </para>
933 </refsect1>
934 </refentry>