1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>gluBuild1DMipmapLevels</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GLU.xml" title="GLU"/><link rel="previous" href="gluBeginTrim.3G.xml" title="gluBeginTrim"/><link rel="next" href="gluBuild1DMipmaps.3G.xml" title="gluBuild1DMipmaps"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gluBuild1DMipmapLevels</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gluBeginTrim.3G.xml">Prev</a></td><th width="60%" align="center">GLU</th><td width="20%" align="right"><a accesskey="n" href="gluBuild1DMipmaps.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="gluBuild1DMipmapLevels.3G"/><div class="titlepage"/><div class="refnamediv"><a name="gluBuild1DMipmapLevels.3G-name"/><h2>Name</h2><p>gluBuild1DMipmapLevels, gluBuild1DMipmapLevelsb, gluBuild1DMipmapLevelsf, gluBuild1DMipmapLevelsi, gluBuild1DMipmapLevelss, gluBuild1DMipmapLevelsub, gluBuild1DMipmapLevelsui, gluBuild1DMipmapLevelsus — builds a subset of one-dimensional mipmap levels</p></div><div class="refsynopsisdiv"><a name="gluBuild1DMipmapLevels.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>GLint<tt>gluBuild1DMipmapLevels</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum<i><tt>target</tt></i>, GLint<i><tt>internalFormat</tt></i>, GLsizei<i><tt>width</tt></i>, GLenum<i><tt>format</tt></i>, GLenum<i><tt>type</tt></i>, GLint<i><tt>level</tt></i>, GLint<i><tt>base</tt></i>, GLint<i><tt>max</tt></i>, constvoid*<i><tt>data</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="gluBuild1DMipmapLevels.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>gluBuild1DMipmapLevels</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalFormat</tt></i>, <i><tt>width</tt></i>, <i><tt>format</tt></i>, <i><tt>type</tt></i>, <i><tt>level</tt></i>, <i><tt>base</tt></i>, <i><tt>max</tt></i>, <i><tt>data</tt></i>) →<tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>gluBuild1DMipmapLevelsb</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalFormat</tt></i>, <i><tt>format</tt></i>, <i><tt>level</tt></i>, <i><tt>base</tt></i>, <i><tt>max</tt></i>, <i><tt>data</tt></i>[][]) →<tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>gluBuild1DMipmapLevelsf</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalFormat</tt></i>, <i><tt>format</tt></i>, <i><tt>level</tt></i>, <i><tt>base</tt></i>, <i><tt>max</tt></i>, <i><tt>data</tt></i>[][]) →<tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>gluBuild1DMipmapLevelsi</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalFormat</tt></i>, <i><tt>format</tt></i>, <i><tt>level</tt></i>, <i><tt>base</tt></i>, <i><tt>max</tt></i>, <i><tt>data</tt></i>[][]) →<tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>gluBuild1DMipmapLevelss</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalFormat</tt></i>, <i><tt>format</tt></i>, <i><tt>level</tt></i>, <i><tt>base</tt></i>, <i><tt>max</tt></i>, <i><tt>data</tt></i>[][]) →<tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>gluBuild1DMipmapLevelsub</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalFormat</tt></i>, <i><tt>format</tt></i>, <i><tt>level</tt></i>, <i><tt>base</tt></i>, <i><tt>max</tt></i>, <i><tt>data</tt></i>[][]) →<tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>gluBuild1DMipmapLevelsui</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalFormat</tt></i>, <i><tt>format</tt></i>, <i><tt>level</tt></i>, <i><tt>base</tt></i>, <i><tt>max</tt></i>, <i><tt>data</tt></i>[][]) →<tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>gluBuild1DMipmapLevelsus</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>internalFormat</tt></i>, <i><tt>format</tt></i>, <i><tt>level</tt></i>, <i><tt>base</tt></i>, <i><tt>max</tt></i>, <i><tt>data</tt></i>[][]) →<tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="gluBuild1DMipmapLevels.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>target</tt></i></span></dt><dd>
Specifies the target texture. Must be <tt>GL_TEXTURE_1D</tt>.
</dd><dt><span class="term"><i><tt>internalFormat</tt></i></span></dt><dd>
Requests the internal storage format of the texture image. Must be 1, 2, 3, or 4 or one of the following
symbolic constants: <tt>GL_ALPHA</tt>, <tt>GL_ALPHA4</tt>,
<tt>GL_ALPHA8</tt>, <tt>GL_ALPHA12</tt>, <tt>GL_ALPHA16</tt>,
<tt>GL_LUMINANCE</tt>, <tt>GL_LUMINANCE4</tt>, <tt>GL_LUMINANCE8</tt>,
<tt>GL_LUMINANCE12</tt>, <tt>GL_LUMINANCE16</tt>,
<tt>GL_LUMINANCE_ALPHA</tt>, <tt>GL_LUMINANCE4_ALPHA4</tt>,
<tt>GL_LUMINANCE6_ALPHA2</tt>, <tt>GL_LUMINANCE8_ALPHA8</tt>,
<tt>GL_LUMINANCE12_ALPHA4</tt>, <tt>GL_LUMINANCE12_ALPHA12</tt>,
<tt>GL_LUMINANCE16_ALPHA16</tt>, <tt>GL_INTENSITY</tt>,
<tt>GL_INTENSITY4</tt>, <tt>GL_INTENSITY8</tt>,
<tt>GL_INTENSITY12</tt>, <tt>GL_INTENSITY16</tt>, <tt>GL_RGB</tt>,
<tt>GL_R3_G3_B2</tt>, <tt>GL_RGB4</tt>, <tt>GL_RGB5</tt>,
<tt>GL_RGB8</tt>, <tt>GL_RGB10</tt>, <tt>GL_RGB12</tt>,
<tt>GL_RGB16</tt>, <tt>GL_RGBA</tt>, <tt>GL_RGBA2</tt>,
<tt>GL_RGBA4</tt>, <tt>GL_RGB5_A1</tt>, <tt>GL_RGBA8</tt>,
<tt>GL_RGB10_A2</tt>, <tt>GL_RGBA12</tt> or <tt>GL_RGBA16</tt>.
</dd><dt><span class="term"><i><tt>width</tt></i></span></dt><dd>
Specifies the width in pixels of the texture image. This should be a power of 2.
</dd><dt><span class="term"><i><tt>format</tt></i></span></dt><dd>
Specifies the format of the pixel data. Must be one of: <tt>GL_COLOR_INDEX</tt>,
<tt>GL_DEPTH_COMPONENT</tt>, <tt>GL_RED</tt>, <tt>GL_GREEN</tt>,
<tt>GL_BLUE</tt>, <tt>GL_ALPHA</tt>, <tt>GL_RGB</tt>,
<tt>GL_RGBA</tt>, <tt>GL_BGR</tt>, <tt>GL_BGRA</tt>,
<tt>GL_LUMINANCE</tt>, or <tt>GL_LUMINANCE_ALPHA</tt>.
</dd><dt><span class="term"><i><tt>type</tt></i></span></dt><dd>
Specifies the data type for <i><tt>data</tt></i>. Must be one of:
<tt>GL_UNSIGNED_BYTE</tt>, <tt>GL_BYTE</tt>, <tt>GL_BITMAP</tt>,
<tt>GL_UNSIGNED_SHORT</tt>, <tt>GL_SHORT</tt>,
<tt>GL_UNSIGNED_INT</tt>, <tt>GL_INT</tt>, <tt>GL_FLOAT</tt>,
<tt>GL_UNSIGNED_BYTE_3_3_2</tt>, <tt>GL_UNSIGNED_BYTE_2_3_3_REV</tt>,
<tt>GL_UNSIGNED_SHORT_5_6_5</tt>, <tt>GL_UNSIGNED_SHORT_5_6_5_REV</tt>,
<tt>GL_UNSIGNED_SHORT_4_4_4_4</tt>, <tt>GL_UNSIGNED_SHORT_4_4_4_4_REV</tt>,
<tt>GL_UNSIGNED_SHORT_5_5_5_1</tt>, <tt>GL_UNSIGNED_SHORT_1_5_5_5_REV</tt>,
<tt>GL_UNSIGNED_INT_8_8_8_8</tt>, <tt>GL_UNSIGNED_INT_8_8_8_8_REV</tt>,
<tt>GL_UNSIGNED_INT_10_10_10_2</tt>, or <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt>.
</dd><dt><span class="term"><i><tt>level</tt></i></span></dt><dd>
Specifies the mipmap level of the image data.
</dd><dt><span class="term"><i><tt>base</tt></i></span></dt><dd>
Specifies the minimum mipmap level to pass to <a href="glTexImage1D.3G.xml"><tt>glTexImage1D</tt></a>.
</dd><dt><span class="term"><i><tt>max</tt></i></span></dt><dd>
Specifies the maximum mipmap level to pass to <a href="glTexImage1D.3G.xml"><tt>glTexImage1D</tt></a>.
</dd><dt><span class="term"><i><tt>data</tt></i></span></dt><dd>
Specifies a pointer to the image data in memory.
</dd></dl></div></div><div class="refsect1" lang="en"><a name="gluBuild1DMipmapLevels.3G-description"/><h2>Description</h2><p>
<tt>gluBuild1DMipmapLevels</tt> builds a subset of prefiltered one-dimensional texture maps of decreasing
resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives.
</p><p>
A return value of zero indicates success, otherwise a GLU error code is returned (see <a href="gluErrorString.3G.xml">gluErrorString</a>).
</p><p>
A series of mipmap levels from <i><tt>base</tt></i> to <i><tt>max</tt></i> is built by decimating
<i><tt>data</tt></i> in half until size 11 is reached. At each level, each texel in the halved mipmap
level is an average of the corresponding two texels in the larger mipmap level. <a href="glTexImage1D.3G.xml"><tt>glTexImage1D</tt></a> is called to load these mipmap levels from <i><tt>base</tt></i> to
<i><tt>max</tt></i>. If <i><tt>max</tt></i> is larger than the highest mipmap level for the texture of
the specified size, then a GLU error code is returned (see <a href="gluErrorString.3G.xml">gluErrorString</a>) and nothing is loaded.
</p><p>
For example, if <i><tt>level</tt></i> is 2 and <i><tt>width</tt></i> is 16, the following levels are
possible: 161, 81, 41, 21, 11. These correspond to levels 2 through 6 respectively.
If <i><tt>base</tt></i> is 3 and <i><tt>max</tt></i> is 5, then only mipmap levels 81, 41
and 21 are loaded. However, if <i><tt>max</tt></i> is 7 then an error is returned and nothing is loaded
since <i><tt>max</tt></i> is larger than the highest mipmap level which is, in this case, 6.
</p><p>
The highest mipmap level can be derived from the formula <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:msub>
<mml:mo>log</mml:mo>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mfenced separator=",">
<mml:mrow>
<mml:mi>width</mml:mi>
<mml:mo></mml:mo>
<mml:msup>
<mml:mn>2</mml:mn>
<mml:mi>level</mml:mi>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:math>.
</p><p>
See the <a href="glTexImage1D.3G.xml"><tt>glTexImage1D</tt></a> reference page for a description of the acceptable values
for <i><tt>type</tt></i> parameter. See the <a href="glDrawPixels.3G.xml"><tt>glDrawPixels</tt></a> reference page
for a description of the acceptable values for <i><tt>level</tt></i> parameter.
</p></div><div class="refsect1" lang="en"><a name="gluBuild1DMipmapLevels.3G-notes"/><h2>Notes</h2><p>
<tt>gluBuild1DMipmapLevels</tt> is only available if the GLU version is 1.3 or greater.
</p><p>
Formats <tt>GL_BGR</tt>, and <tt>GL_BGRA</tt>, and types
<tt>GL_UNSIGNED_BYTE_3_3_2</tt>, <tt>GL_UNSIGNED_BYTE_2_3_3_REV</tt>,
<tt>GL_UNSIGNED_SHORT_5_6_5</tt>, <tt>GL_UNSIGNED_SHORT_5_6_5_REV</tt>,
<tt>GL_UNSIGNED_SHORT_4_4_4_4</tt>, <tt>GL_UNSIGNED_SHORT_4_4_4_4_REV</tt>,
<tt>GL_UNSIGNED_SHORT_5_5_5_1</tt>, <tt>GL_UNSIGNED_SHORT_1_5_5_5_REV</tt>,
<tt>GL_UNSIGNED_INT_8_8_8_8</tt>, <tt>GL_UNSIGNED_INT_8_8_8_8_REV</tt>,
<tt>GL_UNSIGNED_INT_10_10_10_2</tt>, and <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt> are only
available if the GL version is 1.2 or greater.
</p></div><div class="refsect1" lang="en"><a name="gluBuild1DMipmapLevels.3G-errors"/><h2>Errors</h2><p>
<tt>GLU_INVALID_VALUE</tt> is returned if <i><tt>level</tt></i> > <i><tt>base</tt></i>,
<i><tt>base</tt></i> < 0, <i><tt>max</tt></i> < <i><tt>base</tt></i> or
<i><tt>max</tt></i> is > the highest mipmap level for <i><tt>data</tt></i>.
</p><p>
<tt>GLU_INVALID_VALUE</tt> is returned if <i><tt>width</tt></i> is < 1.
</p><p>
<tt>GLU_INVALID_ENUM</tt> is returned if <i><tt>internalFormat</tt></i>,
<i><tt>format</tt></i>, or <i><tt>type</tt></i> are not legal.
</p><p>
<tt>GLU_INVALID_OPERATION</tt> is returned if <i><tt>type</tt></i> is
<tt>GL_UNSIGNED_BYTE_3_3_2</tt> or <tt>GL_UNSIGNED_BYTE_2_3_3_REV</tt> and
<i><tt>format</tt></i> is not <tt>GL_RGB</tt>.
</p><p>
<tt>GLU_INVALID_OPERATION</tt> is returned if <i><tt>type</tt></i> is
<tt>GL_UNSIGNED_SHORT_5_6_5</tt> or <tt>GL_UNSIGNED_SHORT_5_6_5_REV</tt> and
<i><tt>format</tt></i> is not <tt>GL_RGB</tt>.
</p><p>
<tt>GLU_INVALID_OPERATION</tt> is returned if <i><tt>type</tt></i> is
<tt>GL_UNSIGNED_SHORT_4_4_4_4</tt> or <tt>GL_UNSIGNED_SHORT_4_4_4_4_REV</tt> and
<i><tt>format</tt></i> is neither <tt>GL_RGBA</tt> nor <tt>GL_BGRA</tt>.
</p><p>
<tt>GLU_INVALID_OPERATION</tt> is returned if <i><tt>type</tt></i> is
<tt>GL_UNSIGNED_SHORT_5_5_5_1</tt> or <tt>GL_UNSIGNED_SHORT_1_5_5_5_REV</tt> and
<i><tt>format</tt></i> is neither <tt>GL_RGBA</tt> nor <tt>GL_BGRA</tt>.
</p><p>
<tt>GLU_INVALID_OPERATION</tt> is returned if <i><tt>type</tt></i> is
<tt>GL_UNSIGNED_INT_8_8_8_8</tt> or <tt>GL_UNSIGNED_INT_8_8_8_8_REV</tt> and
<i><tt>format</tt></i> is neither <tt>GL_RGBA</tt> nor <tt>GL_BGRA</tt>.
</p><p>
<tt>GLU_INVALID_OPERATION</tt> is returned if <i><tt>type</tt></i> is
<tt>GL_UNSIGNED_INT_10_10_10_2</tt> or <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt> and
<i><tt>format</tt></i> is neither <tt>GL_RGBA</tt> nor <tt>GL_BGRA</tt>.
</p></div><div class="refsect1" lang="en"><a name="gluBuild1DMipmapLevels.3G-see_also"/><h2>See Also</h2><p>
<span class="simplelist"><a href="glDrawPixels.3G.xml">glDrawPixels</a>, <a href="glTexImage1D.3G.xml">glTexImage1D</a>, <a href="glTexImage2D.3G.xml">glTexImage2D</a>, <a href="glTexImage3D.3G.xml">glTexImage3D</a>, <a href="gluBuild1DMipmaps.3G.xml">gluBuild1DMipmaps</a>, <a href="gluBuild2DMipmaps.3G.xml">gluBuild2DMipmaps</a>, <a href="gluBuild3DMipmaps.3G.xml">gluBuild3DMipmaps</a>, <a href="gluErrorString.3G.xml">gluErrorString</a>, <a href="glGetTexImage.3G.xml">glGetTexImage</a>, <a href="glGetTexLevelParameter.3G.xml">glGetTexLevelParameter</a>, <a href="gluBuild2DMipmapLevels.3G.xml">gluBuild2DMipmapLevels</a>, <a href="gluBuild3DMipmapLevels.3G.xml">gluBuild3DMipmapLevels</a></span>
</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gluBeginTrim.3G.xml">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="reference-GLU.xml">Up</a></td><td width="40%" align="right"><a accesskey="n" href="gluBuild1DMipmaps.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gluBeginTrim</td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top">gluBuild1DMipmaps</td></tr></table></div></body></html>
|