[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

gluScaleImage Subroutine

Purpose

Scales an image to an arbitrary size.

Library

OpenGL C bindings library: libGL.a

C Syntax

int gluScaleImage(GLenum Format, 
   GLint WidthIn, 
   GLint HeightIn, 
   GLenum TypeIn, 
   const void *DataIn, 
   GLint WidthOut, 
   GLint HeightOut, 
   GLenum TypeOut, 
   void *DataOut)

Description

The gluScaleImage subroutine 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, the gluScaleImage subroutine 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 interpolated linearly to create the destination image.

A return value of zero indicates success; otherwise, a GLU error code is returned. (See the gluErrorString subroutine for standard GLU error codes.)

See the glReadPixels subroutine for a description of valid values for the Format, TypeIn, and TypeOut parameters.

Parameters

Format Specifies 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_LUMINANCE
  • GL_LUMINANCE_ALPHA
WidthIn, HeightIn Specify the width and height, respectively, of the source image that is scaled. Values are listed in map pixels.
TypeIn Specifies the data type for the DataIn parameter. The following symbolic values are valid:
  • GL_UNSIGNED_BYTE
  • GL_BYTE
  • GL_BITMAP
  • GL_UNSIGNED_SHORT
  • GL_SHORT
  • GL_UNSIGNED_INT
  • GL_INT
  • GL_FLOAT
DataIn Specifies a pointer to the source image.
WidthOut, HeightOut Specify the width and height, respectively, of the destination image.
TypeOut Specifies the data type for the DataOut parameter. The following symbolic values are valid:
  • GL_UNSIGNED_BYTE
  • GL_BYTE
  • GL_BITMAP
  • GL_UNSIGNED_SHORT
  • GL_SHORT
  • GL_UNSIGNED_INT
  • GL_INT
  • GL_FLOAT
DataOut Specifies a pointer to the destination image.

See the glReadPixels subroutine for a description of valid values for the Format, TypeIn, and TypeOut parameters.

Return Values

0 Indicates the scaling succeeded. If the subroutine fails, a GLU error code is returned. (See the gluErrorString subroutine for standard GLU error codes.)

Files

/usr/include/GL/gl.h Contains C language constraints, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glDrawPixels subroutine, glReadPixels subroutine, gluBuild1DMipmaps subroutine, gluBuild2DMipmaps subroutine, gluErrorString subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]