<?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>gluScaleImage</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="gluQuadricTexture.3G.xml" title="gluQuadricTexture"/><link rel="next" href="gluSphere.3G.xml" title="gluSphere"/></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">gluScaleImage</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gluQuadricTexture.3G.xml">Prev</a> </td><th width="60%" align="center">GLU</th><td width="20%" align="right"> <a accesskey="n" href="gluSphere.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="gluScaleImage.3G"/><div class="titlepage"/><div class="refnamediv"><a name="gluScaleImage.3G-name"/><h2>Name</h2><p>gluScaleImage, gluScaleImageb, gluScaleImagef, gluScaleImagei, gluScaleImages, gluScaleImageub, gluScaleImageui, gluScaleImageus &#8212; scale an image to an arbitrary size</p></div><div class="refsynopsisdiv"><a name="gluScaleImage.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>GLint <tt>gluScaleImage</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>format</tt></i>, GLsizei <i><tt>wIn</tt></i>, GLsizei <i><tt>hIn</tt></i>, GLenum <i><tt>typeIn</tt></i>, const void *<i><tt>dataIn</tt></i>, GLsizei <i><tt>wOut</tt></i>, GLsizei <i><tt>hOut</tt></i>, GLenum <i><tt>typeOut</tt></i>, GLvoid* <i><tt>dataOut</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="gluScaleImage.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>gluScaleImage</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>format</tt></i>, <i><tt>wIn</tt></i>, <i><tt>hIn</tt></i>, <i><tt>typeIn</tt></i>, <i><tt>dataIn</tt></i>, <i><tt>wOut</tt></i>, <i><tt>hOut</tt></i>, <i><tt>typeOut</tt></i>) &#8594; <i><tt>dataOut</tt></i></code></td></tr><tr><td valign="top"><code><tt>gluScaleImageb</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>format</tt></i>, <i><tt>dataIn</tt></i>, <i><tt>wOut</tt></i>, <i><tt>hOut</tt></i>) &#8594; <i><tt>dataOut</tt></i></code></td></tr><tr><td valign="top"><code><tt>gluScaleImagef</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>format</tt></i>, <i><tt>dataIn</tt></i>, <i><tt>wOut</tt></i>, <i><tt>hOut</tt></i>) &#8594; <i><tt>dataOut</tt></i></code></td></tr><tr><td valign="top"><code><tt>gluScaleImagei</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>format</tt></i>, <i><tt>dataIn</tt></i>, <i><tt>wOut</tt></i>, <i><tt>hOut</tt></i>) &#8594; <i><tt>dataOut</tt></i></code></td></tr><tr><td valign="top"><code><tt>gluScaleImages</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>format</tt></i>, <i><tt>dataIn</tt></i>, <i><tt>wOut</tt></i>, <i><tt>hOut</tt></i>) &#8594; <i><tt>dataOut</tt></i></code></td></tr><tr><td valign="top"><code><tt>gluScaleImageub</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>format</tt></i>, <i><tt>dataIn</tt></i>, <i><tt>wOut</tt></i>, <i><tt>hOut</tt></i>) &#8594; <i><tt>dataOut</tt></i></code></td></tr><tr><td valign="top"><code><tt>gluScaleImageui</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>format</tt></i>, <i><tt>dataIn</tt></i>, <i><tt>wOut</tt></i>, <i><tt>hOut</tt></i>) &#8594; <i><tt>dataOut</tt></i></code></td></tr><tr><td valign="top"><code><tt>gluScaleImageus</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>format</tt></i>, <i><tt>dataIn</tt></i>, <i><tt>wOut</tt></i>, <i><tt>hOut</tt></i>) &#8594; <i><tt>dataOut</tt></i></code></td></tr></table></div><div class="refsect1" lang="en"><a name="gluScaleImage.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>format</tt></i></span></dt><dd>
						Specifies the format of the pixel data. The following symbolic values are valid:
						<tt>GL_COLOR_INDEX</tt>, <tt>GL_STENCIL_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>, and <tt>GL_LUMINANCE_ALPHA</tt>.
					</dd><dt><span class="term"><i><tt>wIn</tt></i>, <i><tt>hIn</tt></i></span></dt><dd>
						Specify in pixels the width and height, respectively, of the source image.
					</dd><dt><span class="term"><i><tt>typeIn</tt></i></span></dt><dd>
						Specifies the data type for <i><tt>dataIn</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>, and <tt>GL_UNSIGNED_INT_2_10_10_10_REV</tt>.
					</dd><dt><span class="term"><i><tt>dataIn</tt></i></span></dt><dd>
						Specifies a pointer to the source image.
					</dd><dt><span class="term"><i><tt>wOut</tt></i>, <i><tt>hOut</tt></i></span></dt><dd>
						Specify the width and height, respectively, in pixels of the destination image.
					</dd><dt><span class="term"><i><tt>typeOut</tt></i></span></dt><dd>
						Specifies the data type for <i><tt>dataOut</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>dataOut</tt></i></span></dt><dd>
						Specifies a pointer to the destination image.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="gluScaleImage.3G-description"/><h2>Description</h2><p>
			<tt>gluScaleImage</tt> scales a pixel image using the appropriate pixel store modes to unpack data from the
			source image and pack data into the destination image.
		</p><p>
			When shrinking an image, <tt>gluScaleImage</tt> uses a box filter to sample the source image and create
			pixels for the destination image. When magnifying an image, the pixels from the source image are linearly interpolated
			to create the destination image.
		</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>
			See the <a href="glReadPixels.3G.xml"><tt>glReadPixels</tt></a> reference page for a description of the acceptable values
			for the <i><tt>format</tt></i>, <i><tt>typeIn</tt></i>, and <i><tt>typeOut</tt></i> parameters.
		</p></div><div class="refsect1" lang="en"><a name="gluScaleImage.3G-notes"/><h2>Notes</h2><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="gluScaleImage.3G-errors"/><h2>Errors</h2><p>
			<tt>GLU_INVALID_VALUE</tt> is returned if <i><tt>wIn</tt></i>, <i><tt>hIn</tt></i>,
			<i><tt>wOut</tt></i>, or <i><tt>hOut</tt></i> is negative.
		</p><p>
			<tt>GLU_INVALID_ENUM</tt> is returned if <i><tt>format</tt></i>, <i><tt>typeIn</tt></i>, or
			<i><tt>typeOut</tt></i> is not legal.
		</p><p>
			<tt>GLU_INVALID_OPERATION</tt> is returned if <i><tt>typeIn</tt></i> or
			<i><tt>typeOut</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>typeIn</tt></i> or
			<i><tt>typeOut</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>typeIn</tt></i> or
			<i><tt>typeOut</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>typeIn</tt></i> or
			<i><tt>typeOut</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>typeIn</tt></i> or
			<i><tt>typeOut</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>typeIn</tt></i> or
			<i><tt>typeOut</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="gluScaleImage.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glDrawPixels.3G.xml">glDrawPixels</a>, <a href="glReadPixels.3G.xml">glReadPixels</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></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gluQuadricTexture.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="gluSphere.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gluQuadricTexture </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> gluSphere</td></tr></table></div></body></html>