1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">[
4
<!ENTITY imageFunctionsInc SYSTEM "imageFunctionsInc.xml">
5
<!ENTITY imageMappingInc SYSTEM "imageMappingInc.xml">
11
<keyword>read_imagei (1D)</keyword>
16
<refentrytitle>read_imagei (1D)</refentrytitle>
20
<year>2007-2011</year>
21
<holder>The Khronos Group Inc.
22
Permission is hereby granted, free of charge, to any person obtaining a
23
copy of this software and/or associated documentation files (the
24
"Materials"), to deal in the Materials without restriction, including
25
without limitation the rights to use, copy, modify, merge, publish,
26
distribute, sublicense, and/or sell copies of the Materials, and to
27
permit persons to whom the Materials are furnished to do so, subject to
28
the condition that this copyright notice and permission notice shall be included
29
in all copies or substantial portions of the Materials.</holder>
32
<manvolnum>3</manvolnum>
35
<!-- ================================ SYNOPSIS -->
37
<refnamediv id="read_image1d">
38
<refname>read_image{i|ui} (1D)</refname>
41
Do an element lookup in the 1D image object, returning unnormalized signed integer and unsigned integer values.
45
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
49
<link xlink:href="vectorDataTypes.html">int4</link>
55
<link xlink:href="otherDataTypes.html">image1d_t</link>
56
<parameter>image</parameter>
59
<link xlink:href="sampler_t.html">sampler_t</link>
60
<parameter>sampler</parameter>
63
<link xlink:href="vectorDataTypes.html">int</link>
64
<parameter>coord</parameter>
72
<link xlink:href="vectorDataTypes.html">int4</link>
78
<link xlink:href="otherDataTypes.html">image1d_t</link>
79
<parameter>image</parameter>
82
<link xlink:href="sampler_t.html">sampler_t</link>
83
<parameter>sampler</parameter>
86
<link xlink:href="vectorDataTypes.html">float</link>
87
<parameter>coord</parameter>
95
<link xlink:href="vectorDataTypes.html">uint4</link>
101
<link xlink:href="otherDataTypes.html">image1d_t</link>
102
<parameter>image</parameter>
105
<link xlink:href="sampler_t.html">sampler_t</link>
106
<parameter>sampler</parameter>
109
<link xlink:href="vectorDataTypes.html">int</link>
110
<parameter>coord</parameter>
118
<link xlink:href="vectorDataTypes.html">uint4</link>
124
<link xlink:href="otherDataTypes.html">image1d_t</link>
125
<parameter>image</parameter>
128
<link xlink:href="sampler_t.html">sampler_t</link>
129
<parameter>sampler</parameter>
132
<link xlink:href="vectorDataTypes.html">float</link>
133
<parameter>coord</parameter>
138
<!-- SAMPLER-LESS FORMS -->
143
<link xlink:href="vectorDataTypes.html">int4</link>
149
<link xlink:href="otherDataTypes.html">image1d_t</link>
150
<parameter>image</parameter>
153
<link xlink:href="vectorDataTypes.html">int</link>
154
<parameter>coord</parameter>
162
<link xlink:href="vectorDataTypes.html">uint4</link>
168
<link xlink:href="otherDataTypes.html">image1d_t</link>
169
<parameter>image</parameter>
172
<link xlink:href="vectorDataTypes.html">int</link>
173
<parameter>coord</parameter>
181
<link xlink:href="vectorDataTypes.html">int4</link>
187
<link xlink:href="otherDataTypes.html">image1d_buffer_t</link>
188
<parameter>image</parameter>
191
<link xlink:href="vectorDataTypes.html">int</link>
192
<parameter>coord</parameter>
200
<link xlink:href="vectorDataTypes.html">uint4</link>
206
<link xlink:href="otherDataTypes.html">image1d_buffer_t</link>
207
<parameter>image</parameter>
210
<link xlink:href="vectorDataTypes.html">int</link>
211
<parameter>coord</parameter>
219
<link xlink:href="vectorDataTypes.html">int4</link>
225
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
226
<parameter>image</parameter>
229
<link xlink:href="vectorDataTypes.html">int2</link>
230
<parameter>coord</parameter>
238
<link xlink:href="vectorDataTypes.html">uint4</link>
244
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
245
<parameter>image</parameter>
248
<link xlink:href="vectorDataTypes.html">int2</link>
249
<parameter>coord</parameter>
259
<link xlink:href="vectorDataTypes.html">int4</link>
265
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
266
<parameter>image</parameter>
269
<link xlink:href="sampler_t.html">sampler_t</link>
270
<parameter>sampler</parameter>
273
<link xlink:href="vectorDataTypes.html">int2</link>
274
<parameter>coord</parameter>
282
<link xlink:href="vectorDataTypes.html">int4</link>
288
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
289
<parameter>image</parameter>
292
<link xlink:href="sampler_t.html">sampler_t</link>
293
<parameter>sampler</parameter>
296
<link xlink:href="vectorDataTypes.html">float2</link>
297
<parameter>coord</parameter>
305
<link xlink:href="vectorDataTypes.html">uint4</link>
311
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
312
<parameter>image</parameter>
315
<link xlink:href="sampler_t.html">sampler_t</link>
316
<parameter>sampler</parameter>
319
<link xlink:href="vectorDataTypes.html">int2</link>
320
<parameter>coord</parameter>
328
<link xlink:href="vectorDataTypes.html">uint4</link>
334
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
335
<parameter>image</parameter>
338
<link xlink:href="sampler_t.html">sampler_t</link>
339
<parameter>sampler</parameter>
342
<link xlink:href="vectorDataTypes.html">float2</link>
343
<parameter>coord</parameter>
349
<!-- ================================ DESCRIPTION -->
351
<refsect1 id="description"><title>Description</title>
353
For the forms that take an <type>image1d_t</type>, use the coordinate <emphasis>(coord.x,
354
coord.y)</emphasis> to do an element lookup in the 2D image object specified by
355
<varname>image</varname>.
359
For the forms that take an <type>image1d_array_t</type>, use <emphasis>coord.x</emphasis>
360
to do an element lookup in the 1D image identified by <emphasis>coord.y</emphasis>
361
in the 1D image array specified by <varname>image</varname>.
365
The samplerless read image functions behave exactly as the corresponding read
366
image functions that take integer coordinates and a sampler with filter mode
367
set to <constant>CLK_FILTER_NEAREST</constant>, normalized coordinates set
368
to <constant>CLK_NORMALIZED_COORDS_FALSE</constant> and addressing mode to
369
<constant>CLK_ADDRESS_NONE</constant>.
373
<function>read_imagei</function> and <function>read_imageui</function> return
374
unnormalized signed integer and unsigned integer values respectively. Each channel
375
will be stored in a 32-bit integer.
379
<function>read_imagei</function> can only be used with image objects created with
380
<varname>image_channel_data_type</varname> set to one of the following values:
381
<constant>CL_SIGNED_INT8</constant>, <constant>CL_SIGNED_INT16</constant>, or
382
<constant>CL_SIGNED_INT32</constant>. If the <varname>image_channel_data_type</varname>
383
is not one of the above values, the values returned by <function>read_imagei</function>
388
<function>read_imageui</function> can only be used with image objects created with
389
<varname>image_channel_data_type</varname> set to one of the following values:
390
<constant>CL_UNSIGNED_INT8</constant>, <constant>CL_UNSIGNED_INT16</constant>, and
391
<constant>CL_UNSIGNED_INT32</constant>. If the <varname>image_channel_data_type</varname>
392
is not one of the above values, the values returned by <function>read_imageui</function>
397
The <function>read_imagei</function> and <function>read_imageui</function> calls
398
support a nearest filter only. The <varname>filter_mode</varname> specified in
399
<varname>sampler</varname> must be set to <constant>CLK_FILTER_NEAREST</constant>;
400
otherwise the values returned are undefined.
404
Furthermore, the <function>read_imagei</function> returned are undefined.
405
and <function>read_imageui</function> calls that take integer coordinates
406
must use a returned are undefined. sampler with normalized coordinates set
407
to <constant>CLK_NORMALIZED_COORDS_FALSE</constant> and addressing returned
408
are undefined. mode set to <constant>CLK_ADDRESS_CLAMP_TO_EDGE</constant>,
409
<constant>CLK_ADDRESS_CLAMP</constant> or <constant>CLK_ADDRESS_NONE</constant>;
410
otherwise returned are undefined. the values returned are undefined. returned are
415
<!-- ================================ NOTES -->
417
<refsect1 id="notes"><title>Notes</title>
425
<!-- ================================ SPECIFICATION -->
426
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
428
<refsect1 id="specification"><title>Specification</title>
431
<imagedata fileref="pdficon_small1.gif" format="gif" />
434
<olink uri="imageFunctions">OpenCL Specification</olink>
438
<!-- ================================ ALSO SEE -->
440
<refsect1 id="seealso"><title>Also see</title>
442
<citerefentry href="imageFunctions"><refentrytitle>Image Functions</refentrytitle></citerefentry>
446
<!-- ============================== COPYRIGHT -->
447
<!-- Content included from copyright.inc.xsl -->
449
<refsect3 id="Copyright"><title></title>
451
<imagedata fileref="KhronosLogo.jpg" format="jpg" />