Rediger

Del via


gluScaleImage function

The gluScaleImage function scales an image to an arbitrary size.

Syntax

int WINAPI gluScaleImage(
         GLenum format,
         GLint  widthin,
         GLint  heightin,
         GLenum typein,
   const void   *datain,
         GLint  widthout,
         GLint  heightout,
         GLenum typeout,
         void   *dataout
);

Parameters

format

The format of the pixel data. The following symbolic values are valid: GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR_EXT, GL_BGRA_EXT, GL_LUMINANCE, and GL_LUMINANCE_ALPHA.

widthin

The width of the source image that is scaled.

heightin

The height of the source image that is scaled.

typein

The data type for datain. Must be one of the following: GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT.

datain

A pointer to the source image.

widthout

The width of the destination image.

heightout

The height of the destination image.

typeout

The data type for dataout. Must be one of the following: GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT.

dataout

A pointer to the destination image.

Return value

If the function succeeds, the return value is zero.

If the function fails, the return value is a GLU error code (see gluErrorString).

Remarks

The gluScaleImage function scales a pixel image using the appropriate pixel store modes to unpack data from the source image and pack data into the destination image.

When shrinking an image, gluScaleImage 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.

For a description of the acceptable values for the format, typein, and typeout parameters, see glReadPixels.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Glu.h
Library
Glu32.lib
DLL
Glu32.dll

See also

glDrawPixels

glReadPixels

gluBuild1DMipmaps

gluBuild2DMipmaps

gluErrorString