include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / man4 / xhtml / glTexImage1D.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
3 <!-- saved from url=(0013)about:internet -->
4 <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glTexImage1D - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glTexImage1D"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glTexImage1D — specify a one-dimensional texture image</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glTexImage1D</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">level</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">internalFormat</var>, </td></tr><tr><td> </td><td>GLsizei  </td><td><var class="pdparam">width</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">border</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">format</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">type</var>, </td></tr><tr><td> </td><td>const GLvoid *  </td><td><var class="pdparam">data</var><code>)</code>;</td></tr></table></div></div><p>
5 </p><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p>
6 Specifies the target texture.
7 Must be <code class="constant">GL_TEXTURE_1D</code> or <code class="constant">GL_PROXY_TEXTURE_1D</code>.
8 </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p>
9 Specifies the level-of-detail number.
10 Level 0 is the base image level.
11 Level <span class="emphasis"><em>n</em></span> is the <span class="emphasis"><em>n</em></span>th mipmap reduction image.
12 </p></dd><dt><span class="term"><em class="parameter"><code>internalFormat</code></em></span></dt><dd><p>
13 Specifies the number of color components in the texture.
14 Must be one of base internal formats given in Table 1,
15 one of the sized internal formats given in Table 2, or one
16 of the compressed internal formats given in Table 3, below.
17 </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em></span></dt><dd><p>
18 Specifies the width of the texture image.
19 All implementations support texture images that are at least 1024 texels
20 wide. The height of the 1D texture image is 1.
21 </p></dd><dt><span class="term"><em class="parameter"><code>border</code></em></span></dt><dd><p>
22 This value must be 0.
23 </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p>
24 Specifies the format of the pixel data.
25 The following symbolic values are accepted:
26 <code class="constant">GL_RED</code>,
27 <code class="constant">GL_RG</code>,
28 <code class="constant">GL_RGB</code>,
29 <code class="constant">GL_BGR</code>,
30 <code class="constant">GL_RGBA</code>, and
31 <code class="constant">GL_BGRA</code>.
32 </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p>
33 Specifies the data type of the pixel data.
34 The following symbolic values are accepted:
35 <code class="constant">GL_UNSIGNED_BYTE</code>,
36 <code class="constant">GL_BYTE</code>,
37 <code class="constant">GL_UNSIGNED_SHORT</code>,
38 <code class="constant">GL_SHORT</code>,
39 <code class="constant">GL_UNSIGNED_INT</code>,
40 <code class="constant">GL_INT</code>,
41 <code class="constant">GL_FLOAT</code>,
42 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
43 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
44 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>,
45 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>,
46 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
47 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
48 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
49 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
50 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
51 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
52 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and
53 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>.
54 </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
55 Specifies a pointer to the image data in memory.
56 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
57 Texturing maps a portion of a specified texture image
58 onto each graphical primitive for which texturing is enabled.
59 To enable and disable one-dimensional texturing, call <a href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>
60 and <a href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument <code class="constant">GL_TEXTURE_1D</code>.
61 </p><p>
62 Texture images are defined with <code class="function">glTexImage1D</code>.
63 The arguments describe the parameters of the texture image,
64 such as width,
65 width of the border,
66 level-of-detail number
67 (see <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>),
68 and the internal resolution and format used to store the image.
69 The last three arguments describe how the image is represented in
70 memory.
71 </p><p>
72 If <em class="parameter"><code>target</code></em> is <code class="constant">GL_PROXY_TEXTURE_1D</code>, no data is read from <em class="parameter"><code>data</code></em>, but
73 all of the texture image state is recalculated, checked for
74 consistency, and checked against the implementation's capabilities.
75 If the implementation cannot handle a texture of the
76 requested texture size, it sets all of the image state to 0,
77 but does not generate an error (see <a href="glGetError.xml"><span class="citerefentry"><span class="refentrytitle">glGetError</span></span></a>). To query for an
78 entire mipmap array, use an image array level greater than or equal to
79 1.
80 </p><p>
81 If <em class="parameter"><code>target</code></em> is <code class="constant">GL_TEXTURE_1D</code>,
82 data is read from <em class="parameter"><code>data</code></em> as a sequence of signed or unsigned bytes,
83 shorts,
84 or longs,
85 or single-precision floating-point values,
86 depending on <em class="parameter"><code>type</code></em>.
87 These values are grouped into sets of one,
88 two,
89 three,
90 or four values,
91 depending on <em class="parameter"><code>format</code></em>,
92 to form elements.
93 Each data byte is treated as eight 1-bit elements,
94 with bit ordering determined by <code class="constant">GL_UNPACK_LSB_FIRST</code>
95 (see <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>).
96 </p><p>
97 If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target
98 (see <a href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a texture image is
99 specified, <em class="parameter"><code>data</code></em> is treated as a byte offset into the buffer object's data store.
100 </p><p>
101 The first element corresponds to the left end of the texture array.
102 Subsequent elements progress left-to-right through the remaining texels
103 in the texture array.
104 The final element corresponds to the right end of the texture array.
105 </p><p>
106 <em class="parameter"><code>format</code></em> determines the composition of each element in <em class="parameter"><code>data</code></em>.
107 It can assume one of these symbolic values:
108 </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_RED</code></span></dt><dd><p>
109 Each element is a single red component.
110 The GL converts it to floating point and assembles it into an RGBA element
111 by attaching 0 for green and blue, and 1 for alpha.
112 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
113 added to the signed bias <code class="constant">GL_c_BIAS</code>,
114 and clamped to the range [0,1].
115 </p></dd><dt><span class="term"><code class="constant">GL_RG</code></span></dt><dd><p>
116 Each element is a single red/green double
117 The GL converts it to floating point and assembles it into an RGBA element
118 by attaching 0 for blue, and 1 for alpha.
119 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
120 added to the signed bias <code class="constant">GL_c_BIAS</code>,
121 and clamped to the range [0,1].
122 </p></dd><dt><span class="term"><code class="constant">GL_RGB</code></span></dt><dd></dd><dt><span class="term"><code class="constant">GL_BGR</code></span></dt><dd><p>
123 Each element is an RGB triple.
124 The GL converts it to floating point and assembles it into an RGBA element
125 by attaching 1 for alpha.
126 Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
127 added to the signed bias <code class="constant">GL_c_BIAS</code>,
128 and clamped to the range [0,1].
129 </p></dd><dt><span class="term"><code class="constant">GL_RGBA</code></span></dt><dd></dd><dt><span class="term"><code class="constant">GL_BGRA</code></span></dt><dd><p>
130 Each element contains all four components.
131 Each component is multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
132 added to the signed bias <code class="constant">GL_c_BIAS</code>,
133 and clamped to the range [0,1].
134 </p></dd><dt><span class="term"><code class="constant">GL_DEPTH_COMPONENT</code></span></dt><dd><p>
135 Each element is a single depth value.
136 The GL converts it to floating point, multiplies by the signed scale factor
137 <code class="constant">GL_DEPTH_SCALE</code>, adds the signed bias <code class="constant">GL_DEPTH_BIAS</code>,
138 and clamps to the range [0,1].
139 </p></dd></dl></div><p>
140 If an application wants to store the texture at a certain
141 resolution or in a certain format, it can request the resolution
142 and format with <em class="parameter"><code>internalFormat</code></em>. The GL will choose an internal
143 representation that closely approximates that requested by <em class="parameter"><code>internalFormat</code></em>, but
144 it may not match exactly.
145 (The representations specified by <code class="constant">GL_RED</code>, <code class="constant">GL_RG</code>,
146 <code class="constant">GL_RGB</code> and <code class="constant">GL_RGBA</code> must match exactly.)
147 </p><p>
148 <em class="parameter"><code>internalFormat</code></em> may be one of the base internal formats shown in
149 Table 1, below
150 </p><p>
151 </p><div class="table"><a id="id4869699"></a><p class="title"><b>Table 1. Base Internal Formats</b></p><table summary="Base Internal Formats" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
152 Base Internal Format
153 </strong></span></th><th align="left"><span class="bold"><strong>
154 RGBA, Depth and Stencil Values
155 </strong></span></th><th align="left"><span class="bold"><strong>
156 Internal Components
157 </strong></span></th></tr></thead><tbody><tr><td align="left"><code class="constant">GL_DEPTH_COMPONENT</code></td><td align="left">Depth</td><td align="left">D</td></tr><tr><td align="left"><code class="constant">GL_DEPTH_STENCIL</code></td><td align="left">Depth, Stencil</td><td align="left">D, S</td></tr><tr><td align="left"><code class="constant">GL_RED</code></td><td align="left">Red</td><td align="left">R</td></tr><tr><td align="left"><code class="constant">GL_RG</code></td><td align="left">Red, Green</td><td align="left">R, G</td></tr><tr><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Red, Green, Blue</td><td align="left">R, G, B</td></tr><tr><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Red, Green, Blue, Alpha</td><td align="left">R, G, B, A</td></tr></tbody></table></div><p>
158 </p><p>
159 <em class="parameter"><code>internalFormat</code></em> may also be one of the sized internal formats
160 shown in Table 2, below
161 </p><p>
162 </p><div class="table"><a id="id4856514"></a><p class="title"><b>Table 2. Sized Internal Formats</b></p><table summary="Sized Internal Formats" border="1"><colgroup><col align="left" /><col align="left" /><col align="center" /><col align="center" /><col align="center" /><col align="center" /><col align="center" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
163 Sized Internal Format
164 </strong></span></th><th align="left"><span class="bold"><strong>
165 Base Internal Format
166 </strong></span></th><th align="left"><span class="bold"><strong>
167 Red Bits
168 </strong></span></th><th align="left"><span class="bold"><strong>
169 Green Bits
170 </strong></span></th><th align="left"><span class="bold"><strong>
171 Blue Bits
172 </strong></span></th><th align="left"><span class="bold"><strong>
173 Alpha Bits
174 </strong></span></th><th align="left"><span class="bold"><strong>
175 Shared Bits
176 </strong></span></th></tr></thead><tbody><tr><td align="left"><code class="constant">GL_R8</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R8_SNORM</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">s8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16_SNORM</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">s16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG8</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">8</td><td align="center">8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG8_SNORM</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">s8</td><td align="center">s8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">16</td><td align="center">16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16_SNORM</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">s16</td><td align="center">s16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R3_G3_B2</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">3</td><td align="center">3</td><td align="center">2</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB4</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">4</td><td align="center">4</td><td align="center">4</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB5</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">5</td><td align="center">5</td><td align="center">5</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB8</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB8_SNORM</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">s8</td><td align="center">s8</td><td align="center">s8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB10</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">10</td><td align="center">10</td><td align="center">10</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB12</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">12</td><td align="center">12</td><td align="center">12</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB16_SNORM</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">16</td><td align="center">16</td><td align="center">16</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA2</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">2</td><td align="center">2</td><td align="center">2</td><td align="center">2</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA4</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">4</td><td align="center">4</td><td align="center">4</td><td align="center">4</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB5_A1</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">5</td><td align="center">5</td><td align="center">5</td><td align="center">1</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA8</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA8_SNORM</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">s8</td><td align="center">s8</td><td align="center">s8</td><td align="center">s8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB10_A2</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">10</td><td align="center">10</td><td align="center">10</td><td align="center">2</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB10_A2UI</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">ui10</td><td align="center">ui10</td><td align="center">ui10</td><td align="center">ui2</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA12</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">12</td><td align="center">12</td><td align="center">12</td><td align="center">12</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA16</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">16</td><td align="center">16</td><td align="center">16</td><td align="center">16</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_SRGB8</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_SRGB8_ALPHA8</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center">8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16F</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">f16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16F</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">f16</td><td align="center">f16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB16F</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">f16</td><td align="center">f16</td><td align="center">f16</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA16F</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">f16</td><td align="center">f16</td><td align="center">f16</td><td align="center">f16</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R32F</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">f32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG32F</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">f32</td><td align="center">f32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB32F</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">f32</td><td align="center">f32</td><td align="center">f32</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA32F</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">f32</td><td align="center">f32</td><td align="center">f32</td><td align="center">f32</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R11F_G11F_B10F</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">f11</td><td align="center">f11</td><td align="center">f10</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB9_E5</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">9</td><td align="center">9</td><td align="center">9</td><td align="center"> </td><td align="center">5</td></tr><tr><td align="left"><code class="constant">GL_R8I</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">i8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R8UI</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">ui8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16I</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">i16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R16UI</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">ui16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R32I</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">i32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_R32UI</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="center">ui32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG8I</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">i8</td><td align="center">i8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG8UI</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">ui8</td><td align="center">ui8</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16I</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">i16</td><td align="center">i16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG16UI</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">ui16</td><td align="center">ui16</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG32I</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">i32</td><td align="center">i32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RG32UI</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="center">ui32</td><td align="center">ui32</td><td align="center"> </td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB8I</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">i8</td><td align="center">i8</td><td align="center">i8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB8UI</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">ui8</td><td align="center">ui8</td><td align="center">ui8</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB16I</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">i16</td><td align="center">i16</td><td align="center">i16</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB16UI</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">ui16</td><td align="center">ui16</td><td align="center">ui16</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB32I</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">i32</td><td align="center">i32</td><td align="center">i32</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGB32UI</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="center">ui32</td><td align="center">ui32</td><td align="center">ui32</td><td align="center"> </td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA8I</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">i8</td><td align="center">i8</td><td align="center">i8</td><td align="center">i8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA8UI</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">ui8</td><td align="center">ui8</td><td align="center">ui8</td><td align="center">ui8</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA16I</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">i16</td><td align="center">i16</td><td align="center">i16</td><td align="center">i16</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA16UI</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">ui16</td><td align="center">ui16</td><td align="center">ui16</td><td align="center">ui16</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA32I</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">i32</td><td align="center">i32</td><td align="center">i32</td><td align="center">i32</td><td align="center"> </td></tr><tr><td align="left"><code class="constant">GL_RGBA32UI</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="center">ui32</td><td align="center">ui32</td><td align="center">ui32</td><td align="center">ui32</td><td align="center"> </td></tr></tbody></table></div><p>
177 </p><p>
178 Finally, <em class="parameter"><code>internalFormat</code></em> may also be one of the generic or compressed
179 compressed texture formats shown in Table 3 below
180 </p><p>
181 </p><div class="table"><a id="id4876999"></a><p class="title"><b>Table 3. Compressed Internal Formats</b></p><table summary="Compressed Internal Formats" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left"><span class="bold"><strong>
182 Compressed Internal Format
183 </strong></span></th><th align="left"><span class="bold"><strong>
184 Base Internal Format
185 </strong></span></th><th align="left"><span class="bold"><strong>
186 Type
187 </strong></span></th></tr></thead><tbody><tr><td align="left"><code class="constant">GL_COMPRESSED_RED</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RG</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGB</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGBA</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SRGB</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SRGB_ALPHA</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Generic</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RED_RGTC1</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SIGNED_RED_RGTC1</code></td><td align="left"><code class="constant">GL_RED</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RG_RGTC2</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SIGNED_RG_RGTC2</code></td><td align="left"><code class="constant">GL_RG</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGBA_BPTC_UNORM</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM</code></td><td align="left"><code class="constant">GL_RGBA</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Specific</td></tr><tr><td align="left"><code class="constant">GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT</code></td><td align="left"><code class="constant">GL_RGB</code></td><td align="left">Specific</td></tr></tbody></table></div><p>
188 </p><p>
189 If the <em class="parameter"><code>internalFormat</code></em> parameter is one of the generic compressed formats,
190 <code class="constant">GL_COMPRESSED_RED</code>, <code class="constant">GL_COMPRESSED_RG</code>,
191 <code class="constant">GL_COMPRESSED_RGB</code>, or
192 <code class="constant">GL_COMPRESSED_RGBA</code>, 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.
193 </p><p>
194 If the <em class="parameter"><code>internalFormat</code></em> parameter is
195 <code class="constant">GL_SRGB</code>,
196 <code class="constant">GL_SRGB8</code>,
197 <code class="constant">GL_SRGB_ALPHA</code>or
198 <code class="constant">GL_SRGB8_ALPHA8</code>, the texture is treated as if the red, green, or blue components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component
199 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
200 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
201 <mml:mi mathvariant="italic">s</mml:mi>
202 </mml:msub>
203 </mml:math>
204 to a linear component
205 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
206 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
207 <mml:mi mathvariant="italic">l</mml:mi>
208 </mml:msub>
209 </mml:math>
210 is:
211 </p><p>
212 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
213 <mml:mrow>
214 <mml:msub>
215 <mml:mi mathvariant="italic">c</mml:mi>
216 <mml:mi mathvariant="italic">l</mml:mi>
217 </mml:msub>
218 <mml:mo>=</mml:mo>
219 <mml:mrow>
220 <mml:mo>{</mml:mo>
221
222 <mml:mtable columnalign="left">
223 <mml:mtr>
224 <mml:mtd columnalign="left">
225 <mml:mfrac>
226 <mml:msub>
227 <mml:mi mathvariant="italic">c</mml:mi>
228 <mml:mi mathvariant="italic">s</mml:mi>
229 </mml:msub>
230 <mml:mn>12.92</mml:mn>
231 </mml:mfrac>
232 </mml:mtd>
233 <mml:mtd columnalign="left">
234 <mml:mrow>
235 <mml:mspace width="1ex"></mml:mspace>
236 <mml:mo>if</mml:mo>
237 <mml:mspace width="1ex"></mml:mspace>
238 </mml:mrow>
239 <mml:msub>
240 <mml:mi mathvariant="italic">c</mml:mi>
241 <mml:mi mathvariant="italic">s</mml:mi>
242 </mml:msub>
243 <mml:mo></mml:mo>
244 <mml:mn>0.04045</mml:mn>
245 </mml:mtd>
246 </mml:mtr>
247 <mml:mtr>
248 <mml:mtd columnalign="left">
249 <mml:msup>
250 <mml:mrow>
251 <mml:mo>(</mml:mo>
252 <mml:mfrac>
253 <mml:mrow>
254 <mml:msub>
255 <mml:mi>c</mml:mi>
256 <mml:mi>s</mml:mi>
257 </mml:msub>
258 <mml:mo>+</mml:mo>
259 <mml:mn>0.055</mml:mn>
260 </mml:mrow>
261 <mml:mn>1.055</mml:mn>
262 </mml:mfrac>
263 <mml:mo>)</mml:mo>
264 </mml:mrow>
265 <mml:mn>2.4</mml:mn>
266 </mml:msup>
267 </mml:mtd>
268 <mml:mtd columnalign="left">
269 <mml:mrow>
270 <mml:mspace width="1ex"></mml:mspace>
271 <mml:mo>if</mml:mo>
272 <mml:mspace width="1ex"></mml:mspace>
273 </mml:mrow>
274 <mml:msub>
275 <mml:mi mathvariant="italic">c</mml:mi>
276 <mml:mi mathvariant="italic">s</mml:mi>
277 </mml:msub>
278 <mml:mo>&gt;</mml:mo>
279 <mml:mn>0.04045</mml:mn>
280 </mml:mtd>
281 </mml:mtr>
282 </mml:mtable>
283 </mml:mrow>
284 </mml:mrow>
285 </mml:math>
286 </p><p>
287 Assume
288 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
289 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
290 <mml:mi mathvariant="italic">s</mml:mi>
291 </mml:msub>
292 </mml:math>
293 is the sRGB component in the range [0,1].
294 </p><p>
295 Use the <code class="constant">GL_PROXY_TEXTURE_1D</code> target to try out a resolution and
296 format. The implementation will
297 update and recompute its best match for the requested storage resolution
298 and format. To then query this state, call <a href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>.
299 If the texture cannot be accommodated, texture state is set to 0.
300 </p><p>
301 A one-component texture image uses only the red component of the RGBA
302 color from <em class="parameter"><code>data</code></em>.
303 A two-component image uses the R and A values.
304 A three-component image uses the R, G, and B values.
305 A four-component image uses all of the RGBA components.
306 </p><p>
307 Image-based shadowing can be enabled by comparing texture r coordinates to depth texture values to generate a boolean result. See <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a> for details on texture comparison.
308 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
309 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> modes affect texture images.
310 </p><p>
311 <em class="parameter"><code>data</code></em> may be a null pointer. In this case texture memory is
312 allocated to accommodate a texture of width <em class="parameter"><code>width</code></em>.
313 You can then download subtextures to initialize the
314 texture memory. The image is undefined if the program tries to apply
315 an uninitialized portion of the texture image to a primitive.
316 </p><p>
317 <code class="function">glTexImage1D</code> specifies the one-dimensional texture for the current texture unit,
318 specified with <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
319 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
320 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not <code class="constant">GL_TEXTURE_1D</code>
321 or <code class="constant">GL_PROXY_TEXTURE_1D</code>.
322 </p><p>
323 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>format</code></em> is not an accepted
324 format constant. Format constants other than <code class="constant">GL_STENCIL_INDEX</code>
325 are accepted.
326 </p><p>
327 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant.
328 </p><p>
329 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0.
330 </p><p>
331 <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater than
332 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
333
334 <mml:mrow>
335 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
336 <mml:mn>2</mml:mn>
337 </mml:msub>
338 <mml:mo></mml:mo>
339 <mml:mfenced open="(" close=")">
340 <mml:mi mathvariant="italic">max</mml:mi>
341 </mml:mfenced>
342 </mml:mrow>
343 </mml:math>,
344 where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
345 </p><p>
346 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>internalFormat</code></em> is not
347 one of the accepted resolution and format symbolic constants.
348 </p><p>
349 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than 0
350 or greater than <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
351 </p><p>
352 <code class="constant">GL_INVALID_VALUE</code> is generated if non-power-of-two textures are not supported and the <em class="parameter"><code>width</code></em> cannot be represented as
353 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
354
355 <mml:mrow>
356 <mml:msup><mml:mn>2</mml:mn>
357 <mml:mi mathvariant="italic">n</mml:mi>
358 </mml:msup>
359 <mml:mo>+</mml:mo>
360 <mml:mrow>
361 <mml:mn>2</mml:mn>
362 <mml:mo></mml:mo>
363 <mml:mfenced open="(" close=")">
364 <mml:mi mathvariant="italic">border</mml:mi>
365 </mml:mfenced>
366 </mml:mrow>
367 </mml:mrow>
368 </mml:math>
369 for some integer value of <span class="emphasis"><em>n</em></span>.
370 </p><p>
371 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>border</code></em> is not 0 or 1.
372 </p><p>
373 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
374 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
375 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
376 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or
377 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>
378 and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>.
379 </p><p>
380 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
381 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
382 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
383 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
384 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
385 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
386 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
387 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or
388 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>
389 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>.
390 </p><p>
391 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>format</code></em> is
392 <code class="constant">GL_DEPTH_COMPONENT</code> and <em class="parameter"><code>internalFormat</code></em> is not
393 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
394 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>.
395 </p><p>
396 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>internalFormat</code></em> is
397 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
398 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>, and <em class="parameter"><code>format</code></em> is
399 not <code class="constant">GL_DEPTH_COMPONENT</code>.
400 </p><p>
401 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
402 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
403 </p><p>
404 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
405 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer
406 object such that the memory reads required would exceed the data store size.
407 </p><p>
408 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
409 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible
410 into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>.
411 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
412 <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>
413 </p><p>
414 <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PIXEL_UNPACK_BUFFER_BINDING</code>
415 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
416 <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
417 <a href="glCompressedTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage1D</span></span></a>,
418 <a href="glCompressedTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage1D</span></span></a>,
419 <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
420 <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
421 <a href="glGetCompressedTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetCompressedTexImage</span></span></a>,
422 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
423 <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
424 <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
425 <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>,
426 <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
427 <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>,
428 <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
429 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
430 Copyright <span class="trademark"></span>© 1991-2006 Silicon Graphics, Inc.
431 Copyright <span class="trademark"></span>© 2011 Khronos Group.
432 This document is licensed under the SGI
433 Free Software B License. For details, see
434 <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
435 </p></div></div></body></html>