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_imageh (1D, Half)</keyword>
16
<refentrytitle>read_image (1D, Half)</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_imageh (1D, Half)</refname>
41
Do an element lookup in the 1D image object, returning half floating-point values.
45
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
49
<link xlink:href="vectorDataTypes.html">half4</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">half4</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>
92
<!-- SAMPLER-LESS FORMS -->
97
<link xlink:href="vectorDataTypes.html">half4</link>
103
<link xlink:href="otherDataTypes.html">image1d_t</link>
104
<parameter>image</parameter>
107
<link xlink:href="vectorDataTypes.html">int</link>
108
<parameter>coord</parameter>
116
<link xlink:href="vectorDataTypes.html">half4</link>
122
<link xlink:href="otherDataTypes.html">image1d_buffer_t</link>
123
<parameter>image</parameter>
126
<link xlink:href="vectorDataTypes.html">int</link>
127
<parameter>coord</parameter>
135
<link xlink:href="vectorDataTypes.html">half4</link>
141
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
142
<parameter>image</parameter>
145
<link xlink:href="vectorDataTypes.html">int2</link>
146
<parameter>coord</parameter>
156
<link xlink:href="vectorDataTypes.html">half4</link>
162
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
163
<parameter>image</parameter>
166
<link xlink:href="sampler_t.html">sampler_t</link>
167
<parameter>sampler</parameter>
170
<link xlink:href="vectorDataTypes.html">int2</link>
171
<parameter>coord</parameter>
179
<link xlink:href="vectorDataTypes.html">half4</link>
185
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
186
<parameter>image</parameter>
189
<link xlink:href="sampler_t.html">sampler_t</link>
190
<parameter>sampler</parameter>
193
<link xlink:href="vectorDataTypes.html">float4</link>
194
<parameter>coord</parameter>
200
<!-- ================================ DESCRIPTION -->
202
<refsect1 id="description"><title>Description</title>
204
For forms that take <type>an</type> image1d_t, use the coordinate <emphasis>(x,
205
y)</emphasis> to do an element lookup in the 1D image object specified by
206
<varname>image</varname>.
210
For forms that take an <type>image1d_array_t</type>, Use <emphasis>coord.x</emphasis>
211
to do an element lookup in the 1D image identified by <emphasis>coord.y</emphasis>
212
in the 1D image array specified by <varname>image</varname>.
216
The samplerless read image functions behave exactly as the corresponding read
217
image functions that take integer coordinates and a sampler with filter mode
218
set to <constant>CLK_FILTER_NEAREST</constant>, normalized coordinates set
219
to <constant>CLK_NORMALIZED_COORDS_FALSE</constant> and addressing mode to
220
<constant>CLK_ADDRESS_NONE</constant>.
224
<function>read_imageh</function> returns half floating-point values in the range
225
[0.0... 1.0] for image objects created with <varname>image_channel_data_type</varname>
226
set to one of the predefined packed formats or <constant>CL_UNORM_INT8</constant>
227
or <constant>CL_UNORM_INT16</constant>.
231
<function>read_imageh</function> returns half floating-point values in the range
232
[-1.0... 1.0] for image objects created with <varname>image_channel_data_type</varname>
233
set to <constant>CL_SNORM_INT8</constant>, or <constant>CL_SNORM_INT16</constant>.
237
<function>read_imageh</function> returns half floating-point values for
238
image objects created with <varname>image_channel_data_type</varname> set to
239
<constant>CL_HALF_FLOAT</constant>.
243
The <function>read_imageh</function> calls that take integer coordinates must
244
use a sampler with filter mode set to <constant>CLK_FILTER_NEAREST</constant>,
245
normalized coordinates set to <constant>CLK_NORMALIZED_COORDS_FALSE</constant>
246
and addressing mode set to <constant>CLK_ADDRESS_CLAMP_TO_EDGE</constant>,
247
<constant>CLK_ADDRESS_CLAMP</constant> or <constant>CLK_ADDRESS_NONE</constant>;
248
otherwise the values returned are undefined.
252
Values returned by <function>read_imageh</function> for image objects with
253
<varname>image_channel_data_type</varname> values not specified in the description
258
<!-- ================================ NOTES -->
259
<refsect1 id="notes"><title>Notes</title>
261
General information about the <function>read_image</function>* functions follows.
270
<!-- ================================ EXAMPLE -->
271
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
273
<refsect2 id="example1">
278
<informaltable frame="none">
279
<tgroup cols="1" align="left" colsep="0" rowsep="0">
280
<colspec colname="col1" colnum="1" />
284
Example goes here - it will be set in "code" type with white space preserved.
293
<!-- ================================ SPECIFICATION -->
294
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page -->
296
<refsect1 id="specification"><title>Specification</title>
299
<imagedata fileref="pdficon_small1.gif" format="gif" />
302
<olink uri="imageFunctionsHalf">OpenCL Specification</olink>
307
<!-- ================================ ALSO SEE -->
309
<refsect1 id="seealso"><title>Also see</title>
311
<citerefentry href="imageFunctions"><refentrytitle>Image Functions</refentrytitle></citerefentry>
315
<!-- ============================== COPYRIGHT -->
316
<!-- Content included from copyright.inc.xsl -->
318
<refsect3 id="Copyright"><title></title>
320
<imagedata fileref="KhronosLogo.jpg" format="jpg" />