---
name: "gluScaleImage"
section: "3x"
platform: "linux"
package: "xlibmesa-glu-dev"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/gluScaleImage"
---

# gluScaleImage(3x)

scale an image to an arbitrary size

## NAME

**gluScaleImage** - scale an image to an arbitrary size

## C SPECIFICATION

GLint **gluScaleImage**( GLenum *format*,

```
	GLsizei wIn,
	GLsizei hIn,
	GLenum typeIn,
	const void *dataIn,
	GLsizei wOut,
	GLsizei hOut,
	GLenum typeOut,
	GLvoid* dataOut )
```

delim $$

## PARAMETERS

- *format*

  Specifies the  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**, **GL\_BGRA**, **GL\_LUMINANCE**, and **GL\_LUMINANCE\_ALPHA**.

- *wIn*, *hIn*

  Specify in pixels the width and height, respectively, of the source image.

- *typeIn*

  Specifies the data type for *dataIn*. Must be one of **GL\_UNSIGNED\_BYTE**, **GL\_BYTE**, **GL\_BITMAP**, **GL\_UNSIGNED\_SHORT**, **GL\_SHORT**, **GL\_UNSIGNED\_INT**, **GL\_INT**,  **GL\_FLOAT**,  **GL\_UNSIGNED\_BYTE\_3\_3\_2**, **GL\_UNSIGNED\_BYTE\_2\_3\_3\_REV**, **GL\_UNSIGNED\_SHORT\_5\_6\_5**, **GL\_UNSIGNED\_SHORT\_5\_6\_5\_REV**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4\_REV**, **GL\_UNSIGNED\_SHORT\_5\_5\_5\_1**, **GL\_UNSIGNED\_SHORT\_1\_5\_5\_5\_REV**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8\_REV**, **GL\_UNSIGNED\_INT\_10\_10\_10\_2**, and **GL\_UNSIGNED\_INT\_2\_10\_10\_10\_REV**.

- *dataIn*

  Specifies a pointer to the source image.

- *wOut*, *hOut*

  Specify the width and height, respectively, in pixels of the destination image.

- *typeOut*

  Specifies the data type for *dataOut*. Must be one of **GL\_UNSIGNED\_BYTE**, **GL\_BYTE**, **GL\_BITMAP**, **GL\_UNSIGNED\_SHORT**, **GL\_SHORT**, **GL\_UNSIGNED\_INT**, **GL\_INT**,  **GL\_FLOAT**, **GL\_UNSIGNED\_BYTE\_3\_3\_2**, **GL\_UNSIGNED\_BYTE\_2\_3\_3\_REV**, **GL\_UNSIGNED\_SHORT\_5\_6\_5**, **GL\_UNSIGNED\_SHORT\_5\_6\_5\_REV**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4\_REV**, **GL\_UNSIGNED\_SHORT\_5\_5\_5\_1**, **GL\_UNSIGNED\_SHORT\_1\_5\_5\_5\_REV**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8\_REV**, **GL\_UNSIGNED\_INT\_10\_10\_10\_2**, or **GL\_UNSIGNED\_INT\_2\_10\_10\_10\_REV**.

- *dataOut*

  Specifies a pointer to the destination image.

## DESCRIPTION

**gluScaleImage** 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.

A return value of zero indicates success, otherwise a GLU error code is returned (see **gluErrorString**).

See the **glReadPixels** reference page for a description of the acceptable values for the *format*, *typeIn*, and *typeOut* parameters.

## NOTES

Formats **GL\_BGR**, and **GL\_BGRA**, and types  **GL\_UNSIGNED\_BYTE\_3\_3\_2**, **GL\_UNSIGNED\_BYTE\_2\_3\_3\_REV**, **GL\_UNSIGNED\_SHORT\_5\_6\_5**, **GL\_UNSIGNED\_SHORT\_5\_6\_5\_REV**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4\_REV**, **GL\_UNSIGNED\_SHORT\_5\_5\_5\_1**, **GL\_UNSIGNED\_SHORT\_1\_5\_5\_5\_REV**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8\_REV**, **GL\_UNSIGNED\_INT\_10\_10\_10\_2**, and **GL\_UNSIGNED\_INT\_2\_10\_10\_10\_REV** are only available if the GL version  is 1.2 or greater.

## ERRORS

**GLU\_INVALID\_VALUE** is returned if *wIn*, *hIn*, *wOut*, or *hOut* is negative.

**GLU\_INVALID\_ENUM** is returned if *format*, *typeIn*, or *typeOut* is not legal.

**GLU\_INVALID\_OPERATION** is returned if *typeIn* or *typeOut* is  **GL\_UNSIGNED\_BYTE\_3\_3\_2** or **GL\_UNSIGNED\_BYTE\_2\_3\_3\_REV**  and *format* is not **GL\_RGB**.

**GLU\_INVALID\_OPERATION** is returned if *typeIn* or *typeOut* is  **GL\_UNSIGNED\_SHORT\_5\_6\_5** or **GL\_UNSIGNED\_SHORT\_5\_6\_5\_REV**  and *format* is not **GL\_RGB**.

**GLU\_INVALID\_OPERATION** is returned if *typeIn* or *typeOut* is **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4** or **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4\_REV**  and *format* is neither **GL\_RGBA** nor **GL\_BGRA**.

**GLU\_INVALID\_OPERATION** is returned if *typeIn* or *typeOut* is **GL\_UNSIGNED\_SHORT\_5\_5\_5\_1** or **GL\_UNSIGNED\_SHORT\_1\_5\_5\_5\_REV** and *format* is neither **GL\_RGBA** nor **GL\_BGRA**.

**GLU\_INVALID\_OPERATION** is returned if *typeIn* or *typeOut* is **GL\_UNSIGNED\_INT\_8\_8\_8\_8** or **GL\_UNSIGNED\_INT\_8\_8\_8\_8\_REV**  and *format* is neither **GL\_RGBA** nor **GL\_BGRA**.

**GLU\_INVALID\_OPERATION** is returned if *typeIn* or *typeOut* is **GL\_UNSIGNED\_INT\_10\_10\_10\_2** or **GL\_UNSIGNED\_INT\_2\_10\_10\_10\_REV** and *format* is neither **GL\_RGBA** nor **GL\_BGRA**.

## SEE ALSO

**glDrawPixels(3G)**, **glReadPixels(3G)**, **gluBuild1DMipmaps(3G)**, **gluBuild2DMipmaps(3G)**,  **gluBuild3DMipmaps(3G)**,  **gluErrorString(3G)**
