---
name: "imageDescriptor"
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/imageDescriptor"
---

# imageDescriptor(3clc)

The image descriptor structure describes the type and dimensions of the image or image array and is defined as:

## NAME

imageDescriptor - The image descriptor structure describes the type and dimensions of the image or image array and is defined as:

###

| |
| --- |
| typedef struct \_cl\_image\_desc { cl\_mem\_object\_type image\_type; size\_t image\_width; size\_t image\_height; size\_t image\_depth; size\_t image\_array\_size; size\_t image\_row\_pitch; size\_t image\_slice\_pitch; cl\_uint num\_mip\_levels; cl\_uint num\_samples; cl\_mem buffer; } cl\_image\_desc; |

## MEMBERS

image\_type

Describes the image type and must be either **CL\_MEM\_OBJECT\_IMAGE1D**, **CL\_MEM\_OBJECT\_IMAGE1D\_BUFFER**, **CL\_MEM\_OBJECT\_IMAGE1D\_ARRAY**, **CL\_MEM\_OBJECT\_IMAGE2D**, **CL\_MEM\_OBJECT\_IMAGE2D\_ARRAY**, or **CL\_MEM\_OBJECT\_IMAGE3D**.

image\_width

The width of the image in pixels. For a 2D image and image array, the image width must be ≤ **CL\_DEVICE\_IMAGE2D\_MAX\_WIDTH**. For a 3D image, the image width must be ≤ **CL\_DEVICE\_IMAGE3D\_MAX\_WIDTH**. For a 1D image buffer, the image width must be ≤ **CL\_DEVICE\_IMAGE\_MAX\_BUFFER\_SIZE**. For a 1D image and 1D image array, the image width must be ≤ **CL\_DEVICE\_IMAGE2D\_MAX\_WIDTH**.

image\_height

The height of the image in pixels. This is only used if the image is a 2D, 3D or 2D image array. For a 2D image or image array, the image height must be ≤ **CL\_DEVICE\_IMAGE2D\_MAX\_HEIGHT**. For a 3D image, the image height must be ≤ **CL\_DEVICE\_IMAGE3D\_MAX\_HEIGHT**.

image\_depth

The depth of the image in pixels. This is only used if the image is a 3D image and must be a value ≥ 1 and ≤ **CL\_DEVICE\_IMAGE3D\_MAX\_DEPTH**.

image\_array\_size

The number of images in the image array. This is only used if the image is a 1D or 2D image array. The values for *image\_array\_size*, if specified, must be a value ≥ 1 and ≤ **CL\_DEVICE\_IMAGE\_MAX\_ARRAY\_SIZE**.

Note that reading and writing 2D image arrays from a kernel with *image\_array\_size* = 1 may be lower performance than 2D images.

image\_row\_pitch

The scan-line pitch in bytes. This must be 0 if *host\_ptr* is NULL and can be either 0 or ≥ image\_width \* size of element in bytes if *host\_ptr* is not NULL. If *host\_ptr* is not NULL and *image\_row\_pitch* = 0, *image\_row\_pitch* is calculated as *image\_width* \* size of element in bytes. If *image\_row\_pitch* is not 0, it must be a multiple of the image element size in bytes.

image\_slice\_pitch

The size in bytes of each 2D slice in the 3D image or the size in bytes of each image in a 1D or 2D image array. This must be 0 if *host\_ptr* is NULL. If *host\_ptr* is not NULL, *image\_slice\_pitch* can be either 0 or ≥ *image\_row\_pitch* \* *image\_height* for a 2D image array or 3D image and can be either 0 or ≥ *image\_row\_pitch* for a 1D image array. If *host\_ptr* is not NULL and *image\_slice\_pitch* = 0, *image\_slice\_pitch* is calculated as *image\_row\_pitch* \* *image\_height* for a 2D image array or 3D image and *image\_row\_pitch* for a 1D image array. If *image\_slice\_pitch* is not 0, it must be a multiple of the *image\_row\_pitch*.

num\_mip\_level, num\_samples

, Must be 0.

buffer

Refers to a valid buffer memory object if *image\_type* is **CL\_MEM\_OBJECT\_IMAGE1D\_BUFFER**. Otherwise it must be NULL. For a 1D image buffer object, the image pixels are taken from the buffer object's data store. When the contents of a buffer object's data store are modified, those changes are reflected in the contents of the 1D image buffer object and vice-versa at corresponding sychronization points. The *image\_width* \* size of element in bytes must be ≤ size of buffer object data store.

## NOTE

Concurrent reading from, writing to and copying between both a buffer object and 1D image buffer object associated with the buffer object is undefined. Only reading from both a buffer object and 1D image buffer object associated with the buffer object is defined.

## SPECIFICATION

**OpenCL Specification**\[1\]

## SEE ALSO

[**cl\_image\_format**(3clc)](/cl_image_format/3clc.md)

## AUTHORS

**The Khronos Group**

## COPYRIGHT

Copyright © 2007-2010 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 95, section 5.3.1.2 - Image Descriptor
