---
name: "get_image_channel_data_type"
section: "3clc"
platform: "linux"
package: "opencl-1.2-man-doc"
version: "1.0~svn33624-5.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/get_image_channel_data_type"
---

# get\_image\_channel\_data\_type(3clc)

Return the channel data type.

## NAME

get\_image\_channel\_data\_type - Return the channel data type.

##

**int get\_image\_channel\_data\_type(image1d\_t** *image***);**

**int get\_image\_channel\_data\_type(image1d\_buffer\_t** *image***);**

**int get\_image\_channel\_data\_type(image2d\_t** *image***);**

**int get\_image\_channel\_data\_type(image3d\_t** *image***);**

**int get\_image\_channel\_data\_type(image1d\_array\_t** *image***);**

**int get\_image\_channel\_data\_type(image2d\_array\_t** *image***);**

## DESCRIPTION

Return the channel data type. Valid values are:

```
CLK_SNORM_INT8
CLK_SNORM_INT16
CLK_UNORM_INT8
CLK_UNORM_INT16
CLK_UNORM_SHORT_565
CLK_UNORM_SHORT_555
CLK_UNORM_SHORT_101010
CLK_SIGNED_INT8
CLK_SIGNED_INT16
CLK_SIGNED_INT32
CLK_UNSIGNED_INT8
CLK_UNSIGNED_INT16
CLK_UNSIGNED_INT32
CLK_HALF_FLOAT
CLK_FLOAT
```

## NOTES

The values returned by **get\_image\_channel\_order** as shown above with the **CLK\_** prefixes correspond to the **CL\_** prefixes used to describe the image channel order and data type in the table of supported names and values in [**clCreateSubBuffer**(3clc)](/clCreateSubBuffer/3clc.md) and list of supported Image Channel Order Values for [**clCreateImage**(3clc)](/clCreateImage/3clc.md). For example, both **CL\_UNORM\_INT8** and **CLK\_UNORM\_INT8** refer to an image channel data type that is an unnormalized unsigned 8-bit integer.

The following table describes the mapping of the number of channels of an image element to the appropriate components in the float4, int4 or uint4 vector data type for the color values returned by **read\_image{f\|i\|ui}** or supplied to **write\_image{f\|i\|ui}**. The unmapped components will be set to **0.0** for red, green and blue channels and will be set to **1.0** for the alpha channel.

| | |
| --- | --- |
| **Channel Order** | **float4, int4 or unsigned int4 components of channel data** |
| **CL\_R**, **CL\_Rx** | **(r, 0.0, 0.0, 1.0)** |
| **CL\_A** | **(0.0, 0.0, 0.0, a)** |
| **CL\_RG**, **CL\_RGx** | **(r, g, 0.0, 1.0)** |
| **CL\_RA** | **(r, 0.0, 0.0, a)** |
| **CL\_RGB**, **CL\_RGBx** | **(r, g, b, 1.0)** |
| **CL\_RGBA, CL\_BGRA, CL\_ARGB** | **(r, g, b, a)** |
| **CL\_INTENSITY** | **(I, I, I, I)** |
| **CL\_LUMINANCE** | **(L, L, L, 1.0)** |

A kernel that uses a sampler with the **CL\_ADDRESS\_CLAMP** addressing mode with multiple images may result in additional samplers being used internally by an implementation. If the same sampler is used with multiple images called via [**read\_imagef2d**(3clc)](/read_imagef2d/3clc.md), then it is possible that an implementation may need to allocate an additional sampler to handle the different border color values that may be needed depending on the image formats being used. These implementation allocated samplers will count against the maximum sampler values supported by the device and given by **CL\_DEVICE\_MAX\_SAMPLERS**. Enqueuing a kernel that requires more samplers than the implementation can support will result in a **CL\_OUT\_OF\_RESOURCES** error being returned.

## SPECIFICATION

**OpenCL Specification**\[1\]

## SEE ALSO

[**imageFunctions**(3clc)](/imageFunctions/3clc.md)

## AUTHORS

**The Khronos Group**

## COPYRIGHT

Copyright © 2007-2011 The Khronos Group Inc.\
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.

## NOTES

- 1\.

  OpenCL Specification

  page 292, section 6.12.14 - Image Read and Write Functions
