---
name: "icetSetColorFormat"
section: "3"
platform: "linux"
package: "paraview"
version: "5.13.2+dfsg-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/icetSetColorFormat"
---

# icetSetColorFormat(3)

## NAME

**icetSetColorFormat**,**icetSetDepthFormat**-- specifies the buffer formats for **IceT** to use when creating images

## Synopsis

\#include \<IceT.h\>

| | | |
| --- | --- | --- |
| void **icetSetColorFormat**( | IceTEnum | *color\_format* ); |
| void **icetSetDepthFormat**( | IceTEnum | *depth\_format* ); |

## Description

When **IceT** creates image objects, it uses the formats specified by **icetSetColorFormat**and **icetSetDepthFormat**.These will be the formats of images passed to drawing callbacks (specified by **icetDrawCallback** or **icetGLDrawCallback**) and of images returned from frame drawing functions (**icetDrawFrame** or **icetGLDrawFrame**). It is also the format expected for image buffers passed to **icetCompositeImage**.

The following *color\_format*s are valid for use in **icetSetColorFormat**.

- **ICET\_IMAGE\_COLOR\_RGBA\_UBYTE**

   Each entry is an RGBA color tuple. Each component is valued in the range from 0 to 255 and is stored as an 8-bit integer. The buffer will always be allocated on memory boundaries such that each color value can be treated as a single 32-bit integer.

- **ICET\_IMAGE\_COLOR\_RGBA\_FLOAT**

   Each entry is an RGBA color tuple. Each component is in the range from 0.0 to 1.0 and is stored as a 32-bit float.

- **ICET\_IMAGE\_COLOR\_RGB\_FLOAT**

   Each entry is an RGB color triple. Each component is in the range from 0.0 to 1.0 and is stored as a 32-bit float. Note that there is no alpha channel, so the color blending composite mode will not work with this color format.

- **ICET\_IMAGE\_COLOR\_NONE**

   No color values are stored in the image.

The following *depth\_format*s are valid for use in **icetSetDepthFormat**.

- **ICET\_IMAGE\_DEPTH\_FLOAT**

   Each entry is in the range from 0.0 (near plane) to 1.0 (far plane) and is stored as a 32-bit float.

- **ICET\_IMAGE\_DEPTH\_NONE**

   No depth values are stored in the image.

The color and depth formats are stored in the **ICET\_COLOR\_FORMAT** and **ICET\_DEPTH\_FORMAT** state variables, respectively.

## Errors

- **ICET\_INVALID\_OPERATION**

   **icetSetColorFormat**or **icetSetDepthFormat**was called while **IceT** was drawing a frame. This probably means that you called icetSetColorFormat in a drawing callback. You cannot do that. Call this function before starting the draw operation.

- **ICET\_INVALID\_ENUM**

   The *color\_format* or *depth\_format* given is invalid.

## Warnings

None.

## Bugs

None known.

## Notes

Calling either **icetSetColorFormat**or **icetSetDepthFormat**does *not* change the format of any existing images. It only changes any subsequently created images.

The color format must be set before calling **icetDrawFrame**, **icetGLDrawFrame**, or **icetCompositeImage**. Doing otherwise would create inconsistencies in the images created and composited together.

## Copyright

Copyright (C)2010 Sandia Corporation

Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.

This source code is released under the New BSD License.

## See Also

[*icetImageGetColorFormat*(3)](/icetImageGetColorFormat/3.md), [*icetImageGetDepthFormat*(3)](/icetImageGetDepthFormat/3.md)
