<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?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>
    </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>
                    Specifies the target texture.
                    Must be <code class="constant">GL_TEXTURE_1D</code> or <code class="constant">GL_PROXY_TEXTURE_1D</code>.
                </p></dd><dt><span class="term"><em class="parameter"><code>level</code></em></span></dt><dd><p>
                    Specifies the level-of-detail number.
                    Level 0 is the base image level.
                    Level <span class="emphasis"><em>n</em></span> is the <span class="emphasis"><em>n</em></span>th mipmap reduction image.
                </p></dd><dt><span class="term"><em class="parameter"><code>internalFormat</code></em></span></dt><dd><p>
                    Specifies the number of color components in the texture.
                    Must be one of base internal formats given in Table 1,
                    one of the sized internal formats given in Table 2, or one
                    of the compressed internal formats given in Table 3, below.
                </p></dd><dt><span class="term"><em class="parameter"><code>width</code></em></span></dt><dd><p>
                    Specifies the width of the texture image. 
                    All implementations support texture images that are at least 1024 texels
                    wide. The height of the 1D texture image is 1.
                </p></dd><dt><span class="term"><em class="parameter"><code>border</code></em></span></dt><dd><p>
                This value must be 0.
              </p></dd><dt><span class="term"><em class="parameter"><code>format</code></em></span></dt><dd><p>
                    Specifies the format of the pixel data.
                    The following symbolic values are accepted:
                    <code class="constant">GL_RED</code>,
                    <code class="constant">GL_RG</code>,
                    <code class="constant">GL_RGB</code>,
                    <code class="constant">GL_BGR</code>,
                    <code class="constant">GL_RGBA</code>, and
                    <code class="constant">GL_BGRA</code>.
                </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p>
                    Specifies the data type of the pixel data.
                    The following symbolic values are accepted:
                    <code class="constant">GL_UNSIGNED_BYTE</code>,
                    <code class="constant">GL_BYTE</code>,
                    <code class="constant">GL_UNSIGNED_SHORT</code>,
                    <code class="constant">GL_SHORT</code>,
                    <code class="constant">GL_UNSIGNED_INT</code>,
                    <code class="constant">GL_INT</code>,
                    <code class="constant">GL_FLOAT</code>,
                    <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
                    <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
                    <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>,
                    <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>,
                    <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
                    <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
                    <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
                    <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
                    <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
                    <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
                    <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, and
                    <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>.
                </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
                    Specifies a pointer to the image data in memory.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            Texturing maps a portion of a specified texture image
            onto each graphical primitive for which texturing is enabled.
            To enable and disable one-dimensional texturing, call <a href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>
            and <a href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument <code class="constant">GL_TEXTURE_1D</code>.
        </p><p>
            Texture images are defined with <code class="function">glTexImage1D</code>.
            The arguments describe the parameters of the texture image,
            such as width,
            width of the border,
            level-of-detail number
            (see <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>),
            and the internal resolution and format used to store the image.
            The last three arguments describe how the image is represented in
            memory.
        </p><p>
            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
            all of the texture image state is recalculated, checked for
            consistency, and checked against the implementation's capabilities.
            If the implementation cannot handle a texture of the
            requested texture size, it sets all of the image state to 0,
            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
            entire mipmap array, use an image array level greater than or equal to
            1.
        </p><p>
            If <em class="parameter"><code>target</code></em> is <code class="constant">GL_TEXTURE_1D</code>,
            data is read from <em class="parameter"><code>data</code></em> as a sequence of signed or unsigned bytes,
            shorts,
            or longs,
            or single-precision floating-point values,
            depending on <em class="parameter"><code>type</code></em>.
            These values are grouped into sets of one,
            two,
            three,
            or four values,
            depending on <em class="parameter"><code>format</code></em>,
            to form elements.
            Each data byte is treated as eight 1-bit elements,
            with bit ordering determined by <code class="constant">GL_UNPACK_LSB_FIRST</code>
            (see <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>).
        </p><p>
            If a non-zero named buffer object is bound to the <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target 
            (see <a href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>) while a texture image is
            specified, <em class="parameter"><code>data</code></em> is treated as a byte offset into the buffer object's data store.
        </p><p>
            The first element corresponds to the left end of the texture array.
            Subsequent elements progress left-to-right through the remaining texels
            in the texture array.
            The final element corresponds to the right end of the texture array.
        </p><p>
            <em class="parameter"><code>format</code></em> determines the composition of each element in <em class="parameter"><code>data</code></em>.
            It can assume one of these symbolic values:
        </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_RED</code></span></dt><dd><p>
                        Each element is a single red component.
                        The GL converts it to floating point and assembles it into an RGBA element
                        by attaching 0 for green and blue, and 1 for alpha.
                        Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
                        added to the signed bias <code class="constant">GL_c_BIAS</code>,
                        and clamped to the range [0,1].
                    </p></dd><dt><span class="term"><code class="constant">GL_RG</code></span></dt><dd><p>
                        Each element is a single red/green double
                        The GL converts it to floating point and assembles it into an RGBA element
                        by attaching 0 for blue, and 1 for alpha.
                        Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
                        added to the signed bias <code class="constant">GL_c_BIAS</code>,
                        and clamped to the range [0,1].
                    </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>
                        Each element is an RGB triple.
                        The GL converts it to floating point and assembles it into an RGBA element
                        by attaching 1 for alpha.
                        Each component is then multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
                        added to the signed bias <code class="constant">GL_c_BIAS</code>,
                        and clamped to the range [0,1].
                    </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>
                        Each element contains all four components.
                        Each component is multiplied by the signed scale factor <code class="constant">GL_c_SCALE</code>,
                        added to the signed bias <code class="constant">GL_c_BIAS</code>,
                        and clamped to the range [0,1].
                    </p></dd><dt><span class="term"><code class="constant">GL_DEPTH_COMPONENT</code></span></dt><dd><p>
                        Each element is a single depth value.
                        The GL converts it to floating point, multiplies by the signed scale factor
                        <code class="constant">GL_DEPTH_SCALE</code>, adds the signed bias <code class="constant">GL_DEPTH_BIAS</code>,
                        and clamps to the range [0,1].
                    </p></dd></dl></div><p>
            If an application wants to store the texture at a certain
            resolution or in a certain format, it can request the resolution
            and format with <em class="parameter"><code>internalFormat</code></em>. The GL will choose an internal
            representation that closely approximates that requested by <em class="parameter"><code>internalFormat</code></em>, but
            it may not match exactly.
            (The representations specified by <code class="constant">GL_RED</code>, <code class="constant">GL_RG</code>,
            <code class="constant">GL_RGB</code> and <code class="constant">GL_RGBA</code> must match exactly.)
        </p><p>
            <em class="parameter"><code>internalFormat</code></em> may be one of the base internal formats shown in
            Table 1, below
        </p><p>
            </p><div class="table"><a id="id4879556"></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>
            Base Internal Format
            </strong></span></th><th align="left"><span class="bold"><strong>
            RGBA, Depth and Stencil Values
            </strong></span></th><th align="left"><span class="bold"><strong>
            Internal Components
            </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>
        </p><p>
            <em class="parameter"><code>internalFormat</code></em> may also be one of the sized internal formats
            shown in Table 2, below
        </p><p>
            </p><div class="table"><a id="id4875737"></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>
            Sized Internal Format
            </strong></span></th><th align="left"><span class="bold"><strong>
            Base Internal Format
            </strong></span></th><th align="left"><span class="bold"><strong>
            Red Bits
            </strong></span></th><th align="left"><span class="bold"><strong>
            Green Bits
            </strong></span></th><th align="left"><span class="bold"><strong>
            Blue Bits
            </strong></span></th><th align="left"><span class="bold"><strong>
            Alpha Bits
            </strong></span></th><th align="left"><span class="bold"><strong>
            Shared Bits
            </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>
        </p><p>
            Finally, <em class="parameter"><code>internalFormat</code></em> may also be one of the generic or compressed
            compressed texture formats shown in Table 3 below
        </p><p>
            </p><div class="table"><a id="id4856219"></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>
            Compressed Internal Format
            </strong></span></th><th align="left"><span class="bold"><strong>
            Base Internal Format
            </strong></span></th><th align="left"><span class="bold"><strong>
            Type
            </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>
        </p><p>
        	If the <em class="parameter"><code>internalFormat</code></em> parameter is one of the generic compressed formats,
        	<code class="constant">GL_COMPRESSED_RED</code>, <code class="constant">GL_COMPRESSED_RG</code>,
        	<code class="constant">GL_COMPRESSED_RGB</code>, or
        	<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.
        </p><p>
            If the <em class="parameter"><code>internalFormat</code></em> parameter is 			
            <code class="constant">GL_SRGB</code>,
			<code class="constant">GL_SRGB8</code>,
			<code class="constant">GL_SRGB_ALPHA</code>or
			<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 
			<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                    <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
                    <mml:mi mathvariant="italic">s</mml:mi>
                    </mml:msub>
            </mml:math>
			to a linear component 
			<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                    <mml:msub><mml:mi mathvariant="italic">c</mml:mi>
                    <mml:mi mathvariant="italic">l</mml:mi>
                    </mml:msub>
            </mml:math>
            is:
		</p><p>
			<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
			<mml:mrow>
				<mml:msub>
				  <mml:mi mathvariant="italic">c</mml:mi>
				  <mml:mi mathvariant="italic">l</mml:mi>
				</mml:msub>
				<mml:mo>=</mml:mo>
				<mml:mrow>
				  <mml:mo>{</mml:mo>
			
				  <mml:mtable columnalign="left">
					<mml:mtr>
					  <mml:mtd columnalign="left">
						<mml:mfrac>
						  <mml:msub>
							<mml:mi mathvariant="italic">c</mml:mi>
							<mml:mi mathvariant="italic">s</mml:mi>
						  </mml:msub>
						  <mml:mn>12.92</mml:mn>
						</mml:mfrac>
					  </mml:mtd>
					  <mml:mtd columnalign="left">
						<mml:mrow>
						  <mml:mspace width="1ex"></mml:mspace>
						  <mml:mo>if</mml:mo>
						  <mml:mspace width="1ex"></mml:mspace>
						</mml:mrow>
						<mml:msub>
						  <mml:mi mathvariant="italic">c</mml:mi>
						  <mml:mi mathvariant="italic">s</mml:mi>
						</mml:msub>
						<mml:mo>≤</mml:mo>
						<mml:mn>0.04045</mml:mn>
					  </mml:mtd>
					</mml:mtr>
					<mml:mtr>
					<mml:mtd columnalign="left">
					<mml:msup>
					  <mml:mrow>
						<mml:mo>(</mml:mo>
						<mml:mfrac>
						  <mml:mrow>
							<mml:msub>
							  <mml:mi>c</mml:mi>
							  <mml:mi>s</mml:mi>
							</mml:msub>
							<mml:mo>+</mml:mo>
							<mml:mn>0.055</mml:mn>
						  </mml:mrow>
						  <mml:mn>1.055</mml:mn>
						</mml:mfrac>
						<mml:mo>)</mml:mo>
					  </mml:mrow>
					  <mml:mn>2.4</mml:mn>
					</mml:msup>
					</mml:mtd>
          			  <mml:mtd columnalign="left">
						<mml:mrow>
						  <mml:mspace width="1ex"></mml:mspace>
						  <mml:mo>if</mml:mo>
						  <mml:mspace width="1ex"></mml:mspace>
						</mml:mrow>
						<mml:msub>
						  <mml:mi mathvariant="italic">c</mml:mi>
						  <mml:mi mathvariant="italic">s</mml:mi>
						</mml:msub>
						<mml:mo>&gt;</mml:mo>
						<mml:mn>0.04045</mml:mn>
					  </mml:mtd>
					</mml:mtr>
				  </mml:mtable>
				</mml:mrow>
				</mml:mrow>
			</mml:math>
		</p><p>
			Assume 		
			<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:msub><mml:mi mathvariant="italic">c</mml:mi>
								<mml:mi mathvariant="italic">s</mml:mi>
								</mml:msub>
						</mml:math>
			is the sRGB component in the range [0,1].
       </p><p>
            Use the <code class="constant">GL_PROXY_TEXTURE_1D</code> target to try out a resolution and
            format. The implementation will
            update and recompute its best match for the requested storage resolution
            and format. To then query this state, call <a href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a>.
            If the texture cannot be accommodated, texture state is set to 0.
        </p><p>
            A one-component texture image uses only the red component of the RGBA
            color from <em class="parameter"><code>data</code></em>.
            A two-component image uses the R and A values.
            A three-component image uses the R, G, and B values.
            A four-component image uses all of the RGBA components.
        </p><p>
            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.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a> modes affect texture images.
        </p><p>
            <em class="parameter"><code>data</code></em> may be a null pointer. In this case texture memory is
            allocated to accommodate a texture of width <em class="parameter"><code>width</code></em>.
            You can then download subtextures to initialize the
            texture memory. The image is undefined if the program tries to apply
            an uninitialized portion of the texture image to a primitive.
        </p><p>
            <code class="function">glTexImage1D</code> specifies the one-dimensional texture for the current texture unit,
            specified with <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <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>
            or <code class="constant">GL_PROXY_TEXTURE_1D</code>.
        </p><p>
            <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>format</code></em> is not an accepted
            format constant.  Format constants other than <code class="constant">GL_STENCIL_INDEX</code>
            are accepted.
        </p><p>
            <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>type</code></em> is not a type constant.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>level</code></em> is less than 0.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> may be generated if <em class="parameter"><code>level</code></em> is greater than 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mrow>
                    <mml:msub><mml:mi mathvariant="italic">log</mml:mi>
                    <mml:mn>2</mml:mn>
                    </mml:msub>
                    <mml:mo>⁡</mml:mo>
                    <mml:mfenced open="(" close=")">
                        <mml:mi mathvariant="italic">max</mml:mi>
                    </mml:mfenced>
                </mml:mrow>
            </mml:math>,
            where <span class="emphasis"><em>max</em></span> is the returned value of <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>internalFormat</code></em> is not 
            one of the accepted resolution and format symbolic constants.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>width</code></em> is less than 0
            or greater than <code class="constant">GL_MAX_TEXTURE_SIZE</code>.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>border</code></em> is not 0.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
            <code class="constant">GL_UNSIGNED_BYTE_3_3_2</code>,
            <code class="constant">GL_UNSIGNED_BYTE_2_3_3_REV</code>,
            <code class="constant">GL_UNSIGNED_SHORT_5_6_5</code>, or
            <code class="constant">GL_UNSIGNED_SHORT_5_6_5_REV</code>
            and <em class="parameter"><code>format</code></em> is not <code class="constant">GL_RGB</code>.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>type</code></em> is one of
            <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4</code>,
            <code class="constant">GL_UNSIGNED_SHORT_4_4_4_4_REV</code>,
            <code class="constant">GL_UNSIGNED_SHORT_5_5_5_1</code>,
            <code class="constant">GL_UNSIGNED_SHORT_1_5_5_5_REV</code>,
            <code class="constant">GL_UNSIGNED_INT_8_8_8_8</code>,
            <code class="constant">GL_UNSIGNED_INT_8_8_8_8_REV</code>,
            <code class="constant">GL_UNSIGNED_INT_10_10_10_2</code>, or
            <code class="constant">GL_UNSIGNED_INT_2_10_10_10_REV</code>
            and <em class="parameter"><code>format</code></em> is neither <code class="constant">GL_RGBA</code> nor <code class="constant">GL_BGRA</code>.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>format</code></em> is
            <code class="constant">GL_DEPTH_COMPONENT</code> and <em class="parameter"><code>internalFormat</code></em> is not
            <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
            <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>internalFormat</code></em> is
            <code class="constant">GL_DEPTH_COMPONENT</code>, <code class="constant">GL_DEPTH_COMPONENT16</code>,
            <code class="constant">GL_DEPTH_COMPONENT24</code>, or <code class="constant">GL_DEPTH_COMPONENT32</code>, and <em class="parameter"><code>format</code></em> is
            not <code class="constant">GL_DEPTH_COMPONENT</code>.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
            <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the buffer object's data store is currently mapped.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
            <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and the data would be unpacked from the buffer 
            object such that the memory reads required would exceed the data store size.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if a non-zero buffer object name is bound to the
            <code class="constant">GL_PIXEL_UNPACK_BUFFER</code> target and <em class="parameter"><code>data</code></em> is not evenly divisible 
            into the number of bytes needed to store in memory a datum indicated by <em class="parameter"><code>type</code></em>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a href="glGetTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexImage</span></span></a>
        </p><p>
            <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>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a href="glActiveTexture.xml"><span class="citerefentry"><span class="refentrytitle">glActiveTexture</span></span></a>,
            <a href="glCompressedTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexImage1D</span></span></a>,
            <a href="glCompressedTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCompressedTexSubImage1D</span></span></a>,
            <a href="glCopyTexImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage1D</span></span></a>,
            <a href="glCopyTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage1D</span></span></a>,
            <a href="glGetCompressedTexImage.xml"><span class="citerefentry"><span class="refentrytitle">glGetCompressedTexImage</span></span></a>,
            <a href="glPixelStore.xml"><span class="citerefentry"><span class="refentrytitle">glPixelStore</span></span></a>,
            <a href="glTexImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage2D</span></span></a>,
            <a href="glTexImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexImage3D</span></span></a>,
            <a href="glTexSubImage1D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage1D</span></span></a>,
            <a href="glTexSubImage2D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage2D</span></span></a>,
            <a href="glTexSubImage3D.xml"><span class="citerefentry"><span class="refentrytitle">glTexSubImage3D</span></span></a>,
            <a href="glTexParameter.xml"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 1991-2006 Silicon Graphics, Inc.
            Copyright <span class="trademark"></span>© 2011 Khronos Group.
            This document is licensed under the SGI
            Free Software B License. For details, see
            <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></body></html>
