update upstream sources
[clinton/guile-figl.git] / upstream-doc / man4 / xhtml / glTexImage1D.xml
CommitLineData
7faf1d71
AW
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.
c7b31271 112 Each component is clamped to the range [0,1].
7faf1d71
AW
113 </p></dd><dt><span class="term"><code class="constant">GL_RG</code></span></dt><dd><p>
114 Each element is a single red/green double
115 The GL converts it to floating point and assembles it into an RGBA element
116 by attaching 0 for blue, and 1 for alpha.
c7b31271 117 Each component is clamped to the range [0,1].
7faf1d71
AW
118 </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>
119 Each element is an RGB triple.
120 The GL converts it to floating point and assembles it into an RGBA element
121 by attaching 1 for alpha.
c7b31271 122 Each component is clamped to the range [0,1].
7faf1d71
AW
123 </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>
124 Each element contains all four components.
c7b31271 125 Each component clamped to the range [0,1].
7faf1d71
AW
126 </p></dd><dt><span class="term"><code class="constant">GL_DEPTH_COMPONENT</code></span></dt><dd><p>
127 Each element is a single depth value.
c7b31271 128 The GL converts it to floating point and clamps to the range [0,1].
7faf1d71
AW
129 </p></dd></dl></div><p>
130 If an application wants to store the texture at a certain
131 resolution or in a certain format, it can request the resolution
132 and format with <em class="parameter"><code>internalFormat</code></em>. The GL will choose an internal
133 representation that closely approximates that requested by <em class="parameter"><code>internalFormat</code></em>, but
134 it may not match exactly.
135 (The representations specified by <code class="constant">GL_RED</code>, <code class="constant">GL_RG</code>,
136 <code class="constant">GL_RGB</code> and <code class="constant">GL_RGBA</code> must match exactly.)
137 </p><p>
138 <em class="parameter"><code>internalFormat</code></em> may be one of the base internal formats shown in
139 Table 1, below
140 </p><p>
c7b31271 141 </p><div class="table"><a id="id4879508"></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>
7faf1d71
AW
142 Base Internal Format
143 </strong></span></th><th align="left"><span class="bold"><strong>
144 RGBA, Depth and Stencil Values
145 </strong></span></th><th align="left"><span class="bold"><strong>
146 Internal Components
147 </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>
148 </p><p>
149 <em class="parameter"><code>internalFormat</code></em> may also be one of the sized internal formats
150 shown in Table 2, below
151 </p><p>
c7b31271 152 </p><div class="table"><a id="id4875278"></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>
7faf1d71
AW
153 Sized Internal Format
154 </strong></span></th><th align="left"><span class="bold"><strong>
155 Base Internal Format
156 </strong></span></th><th align="left"><span class="bold"><strong>
157 Red Bits
158 </strong></span></th><th align="left"><span class="bold"><strong>
159 Green Bits
160 </strong></span></th><th align="left"><span class="bold"><strong>
161 Blue Bits
162 </strong></span></th><th align="left"><span class="bold"><strong>
163 Alpha Bits
164 </strong></span></th><th align="left"><span class="bold"><strong>
165 Shared Bits
166 </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>
167 </p><p>
168 Finally, <em class="parameter"><code>internalFormat</code></em> may also be one of the generic or compressed
169 compressed texture formats shown in Table 3 below
170 </p><p>
c7b31271 171 </p><div class="table"><a id="id4867162"></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>
7faf1d71
AW
172 Compressed Internal Format
173 </strong></span></th><th align="left"><span class="bold"><strong>
174 Base Internal Format
175 </strong></span></th><th align="left"><span class="bold"><strong>
176 Type
177 </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>
178 </p><p>
179 If the <em class="parameter"><code>internalFormat</code></em> parameter is one of the generic compressed formats,
180 <code class="constant">GL_COMPRESSED_RED</code>, <code class="constant">GL_COMPRESSED_RG</code>,
181 <code class="constant">GL_COMPRESSED_RGB</code>, or
182 <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.
183 </p><p>
184 If the <em class="parameter"><code>internalFormat</code></em> parameter is
185 <code class="constant">GL_SRGB</code>,
186 <code class="constant">GL_SRGB8</code>,
187 <code class="constant">GL_SRGB_ALPHA</code>or
188 <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
189 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
190 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
191 <mml:mi mathvariant="italic">s</mml:mi>
192 </mml:msub>
193 </mml:math>
194 to a linear component
195 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
196 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
197 <mml:mi mathvariant="italic">l</mml:mi>
198 </mml:msub>
199 </mml:math>
200 is:
201 </p><p>
202 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
203 <mml:mrow>
204 <mml:msub>
205 <mml:mi mathvariant="italic">c</mml:mi>
206 <mml:mi mathvariant="italic">l</mml:mi>
207 </mml:msub>
208 <mml:mo>=</mml:mo>
209 <mml:mrow>
210 <mml:mo>{</mml:mo>
211
212 <mml:mtable columnalign="left">
213 <mml:mtr>
214 <mml:mtd columnalign="left">
215 <mml:mfrac>
216 <mml:msub>
217 <mml:mi mathvariant="italic">c</mml:mi>
218 <mml:mi mathvariant="italic">s</mml:mi>
219 </mml:msub>
220 <mml:mn>12.92</mml:mn>
221 </mml:mfrac>
222 </mml:mtd>
223 <mml:mtd columnalign="left">
224 <mml:mrow>
225 <mml:mspace width="1ex"></mml:mspace>
226 <mml:mo>if</mml:mo>
227 <mml:mspace width="1ex"></mml:mspace>
228 </mml:mrow>
229 <mml:msub>
230 <mml:mi mathvariant="italic">c</mml:mi>
231 <mml:mi mathvariant="italic">s</mml:mi>
232 </mml:msub>
233 <mml:mo>≤</mml:mo>
234 <mml:mn>0.04045</mml:mn>
235 </mml:mtd>
236 </mml:mtr>
237 <mml:mtr>
238 <mml:mtd columnalign="left">
239 <mml:msup>
240 <mml:mrow>
241 <mml:mo>(</mml:mo>
242 <mml:mfrac>
243 <mml:mrow>
244 <mml:msub>
245 <mml:mi>c</mml:mi>
246 <mml:mi>s</mml:mi>
247 </mml:msub>
248 <mml:mo>+</mml:mo>
249 <mml:mn>0.055</mml:mn>
250 </mml:mrow>
251 <mml:mn>1.055</mml:mn>
252 </mml:mfrac>
253 <mml:mo>)</mml:mo>
254 </mml:mrow>
255 <mml:mn>2.4</mml:mn>
256 </mml:msup>
257 </mml:mtd>
258 <mml:mtd columnalign="left">
259 <mml:mrow>
260 <mml:mspace width="1ex"></mml:mspace>
261 <mml:mo>if</mml:mo>
262 <mml:mspace width="1ex"></mml:mspace>
263 </mml:mrow>
264 <mml:msub>
265 <mml:mi mathvariant="italic">c</mml:mi>
266 <mml:mi mathvariant="italic">s</mml:mi>
267 </mml:msub>
268 <mml:mo>&gt;</mml:mo>
269 <mml:mn>0.04045</mml:mn>
270 </mml:mtd>
271 </mml:mtr>
272 </mml:mtable>
273 </mml:mrow>
274 </mml:mrow>
275 </mml:math>
276 </p><p>
277 Assume
278 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
279 <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
280 <mml:mi mathvariant="italic">s</mml:mi>
281 </mml:msub>
282 </mml:math>
283 is the sRGB component in the range [0,1].
284 </p><p>
285 Use the <code class="constant">GL_PROXY_TEXTURE_1D</code> target to try out a resolution and
286 format. The implementation will
287 update and recompute its best match for the requested storage resolution
288 and format. To then query this state, call <a href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>.
289 If the texture cannot be accommodated, texture state is set to 0.
290 </p><p>
291 A one-component texture image uses only the red component of the RGBA
292 color from <em class="parameter"><code>data</code></em>.
293 A two-component image uses the R and A values.
294 A three-component image uses the R, G, and B values.
295 A four-component image uses all of the RGBA components.
296 </p><p>
297 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.
298 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
299 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> modes affect texture images.
300 </p><p>
301 <em class="parameter"><code>data</code></em> may be a null pointer. In this case texture memory is
302 allocated to accommodate a texture of width <em class="parameter"><code>width</code></em>.
303 You can then download subtextures to initialize the
304 texture memory. The image is undefined if the program tries to apply
305 an uninitialized portion of the texture image to a primitive.
306 </p><p>
307 <code class="function">glTexImage1D</code> specifies the one-dimensional texture for the current texture unit,
308 specified with <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
309 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
310 <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>
311 or <code class="constant">GL_PROXY_TEXTURE_1D</code>.
312 </p><p>
313 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>format</code></em> is not an accepted
314 format constant. Format constants other than <code class="constant">GL_STENCIL_INDEX</code>
315 are accepted.
316 </p><p>
317 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant.
318 </p><p>
319 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0.
320 </p><p>
321 <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater than
322 <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
323
324 <mml:mrow>
325 <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
326 <mml:mn>2</mml:mn>
327 </mml:msub>
328 <mml:mo>⁡</mml:mo>
329 <mml:mfenced open="(" close=")">
330 <mml:mi mathvariant="italic">max</mml:mi>
331 </mml:mfenced>
332 </mml:mrow>
333 </mml:math>,
334 where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
335 </p><p>
336 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>internalFormat</code></em> is not
337 one of the accepted resolution and format symbolic constants.
338 </p><p>
339 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than 0
340 or greater than <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
341 </p><p>
c7b31271 342 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>border</code></em> is not 0.
7faf1d71
AW
343 </p><p>
344 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
345 <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
346 <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
347 <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or
348 <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>
349 and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>.
350 </p><p>
351 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
352 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
353 <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
354 <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
355 <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
356 <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
357 <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
358 <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or
359 <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>
360 and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>.
361 </p><p>
362 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>format</code></em> is
363 <code class="constant">GL_DEPTH_COMPONENT</code> and <em class="parameter"><code>internalFormat</code></em> is not
364 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
365 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>.
366 </p><p>
367 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>internalFormat</code></em> is
368 <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
369 <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>, and <em class="parameter"><code>format</code></em> is
370 not <code class="constant">GL_DEPTH_COMPONENT</code>.
371 </p><p>
372 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
373 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
374 </p><p>
375 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
376 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer
377 object such that the memory reads required would exceed the data store size.
378 </p><p>
379 <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
380 <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible
381 into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>.
382 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
383 <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>
384 </p><p>
385 <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>
386 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
387 <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
388 <a href="glCompressedTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage1D</span></span></a>,
389 <a href="glCompressedTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage1D</span></span></a>,
390 <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
391 <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
392 <a href="glGetCompressedTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetCompressedTexImage</span></span></a>,
393 <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
394 <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
395 <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
396 <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>,
397 <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
398 <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>,
399 <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
400 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
401 Copyright <span class="trademark"></span>© 1991-2006 Silicon Graphics, Inc.
c7b31271 402 Copyright <span class="trademark"></span>© 2011-2013 Khronos Group.
7faf1d71
AW
403 This document is licensed under the SGI
404 Free Software B License. For details, see
405 <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
406 </p></div></div></body></html>