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

# glGetHistogram(3x)

get histogram table

## NAME

**glGetHistogram** - get histogram table

## C SPECIFICATION

void **glGetHistogram**( GLenum *target*,

```
	GLboolean reset,
	GLenum format,
	GLenum type,
	GLvoid *values )
```

## PARAMETERS

- *target*

  Must be **GL\_HISTOGRAM**.

- *reset*

  If **GL\_TRUE**, each component counter that is actually returned is reset to zero.  (Other counters are unaffected.) If **GL\_FALSE**, none of the counters in the histogram table is modified.

- *format*

  The  of values to be returned in *values*. Must be one of **GL\_RED**, **GL\_GREEN**, **GL\_BLUE**, **GL\_ALPHA**, **GL\_RGB**, **GL\_BGR**, **GL\_RGBA**, **GL\_BGRA**, **GL\_LUMINANCE**, or **GL\_LUMINANCE\_ALPHA**.

- *type*

  The type of values to be returned in *values*. Symbolic constants **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** are accepted.

- *values*

  A pointer to storage for the returned histogram table.

## DESCRIPTION

**glGetHistogram** returns the current histogram table as a one-dimensional image with the same width as the histogram. No pixel transfer operations are performed on this image, but pixel storage modes that are applicable to 1D images are honored.

Color components that are requested in the specified *format*, but which are not included in the internal  of the histogram, are returned as zero. The assignments of internal color components to the components requested by *format* are:

| | |
| --- | --- |
| **Internal Component** | **Resulting Component** |
| Red | Red |
| Green | Green |
| Blue | Blue |
| Alpha | Alpha |
| Luminance | Red |

## NOTES

**glGetHistogram** is present only if **GL\_ARB\_imaging** is returned when **glGetString** is called with an argument of **GL\_EXTENSIONS**.

## ERRORS

**GL\_INVALID\_ENUM** is generated if *target* is not **GL\_HISTOGRAM**.

**GL\_INVALID\_ENUM** is generated if *format* is not one of the allowable values.

**GL\_INVALID\_ENUM** is generated if *type* is not one of the allowable values.

**GL\_INVALID\_OPERATION** is generated if **glGetHistogram** is executed between the execution of **glBegin** and the corresponding execution of **glEnd**.

**GL\_INVALID\_OPERATION** is generated if *type* is one of **GL\_UNSIGNED\_BYTE\_3\_3\_2**, **GL\_UNSIGNED\_BYTE\_2\_3\_3\_REV**, **GL\_UNSIGNED\_SHORT\_5\_6\_5**, or **GL\_UNSIGNED\_SHORT\_5\_6\_5\_REV** and *format* is not **GL\_RGB**.

**GL\_INVALID\_OPERATION** is generated if *type* is one of **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** and *format* is neither **GL\_RGBA** nor **GL\_BGRA**.

## SEE ALSO

**glHistogram(3G)**, **glResetHistogram(3G)**, **glGetHistogramParameter(3G)**
