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">
10
<keyword>read_imageh (2D, Half)</keyword>
15
<refentrytitle>read_image (2D, Half)</refentrytitle>
19
<year>2007-2011</year>
20
<holder>The Khronos Group Inc.
21
Permission is hereby granted, free of charge, to any person obtaining a
22
copy of this software and/or associated documentation files (the
23
"Materials"), to deal in the Materials without restriction, including
24
without limitation the rights to use, copy, modify, merge, publish,
25
distribute, sublicense, and/or sell copies of the Materials, and to
26
permit persons to whom the Materials are furnished to do so, subject to
27
the condition that this copyright notice and permission notice shall be included
28
in all copies or substantial portions of the Materials.</holder>
31
<manvolnum>3</manvolnum>
34
<!-- ================================ SYNOPSIS -->
36
<refnamediv id="read_image2d">
37
<refname>read_imageh (2D, Half)</refname>
40
Do an element lookup in the 2D image object, returning half floating-point values.
44
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
48
<link xlink:href="vectorDataTypes.html">half4</link>
54
<link xlink:href="otherDataTypes.html">image2d_t</link>
55
<parameter>image</parameter>
58
<link xlink:href="sampler_t.html">sampler_t</link>
59
<parameter>sampler</parameter>
62
<link xlink:href="vectorDataTypes.html">int2</link>
63
<parameter>coord</parameter>
71
<link xlink:href="vectorDataTypes.html">half4</link>
77
<link xlink:href="otherDataTypes.html">image2d_t</link>
78
<parameter>image</parameter>
81
<link xlink:href="sampler_t.html">sampler_t</link>
82
<parameter>sampler</parameter>
85
<link xlink:href="vectorDataTypes.html">float2</link>
86
<parameter>coord</parameter>
91
<!-- SAMPLER-LESS FORMS -->
96
<link xlink:href="vectorDataTypes.html">half4</link>
102
<link xlink:href="otherDataTypes.html">image2d_t</link>
103
<parameter>image</parameter>
106
<link xlink:href="vectorDataTypes.html">int2</link>
107
<parameter>coord</parameter>
115
<link xlink:href="vectorDataTypes.html">half4</link>
121
<link xlink:href="otherDataTypes.html">image2d_array_t</link>
122
<parameter>image</parameter>
125
<link xlink:href="vectorDataTypes.html">int4</link>
126
<parameter>coord</parameter>
136
<link xlink:href="vectorDataTypes.html">half4</link>
142
<link xlink:href="otherDataTypes.html">image2d_array_t</link>
143
<parameter>image</parameter>
146
<link xlink:href="sampler_t.html">sampler_t</link>
147
<parameter>sampler</parameter>
150
<link xlink:href="vectorDataTypes.html">int4</link>
151
<parameter>coord</parameter>
159
<link xlink:href="vectorDataTypes.html">half4</link>
165
<link xlink:href="otherDataTypes.html">image2d_array_t</link>
166
<parameter>image</parameter>
169
<link xlink:href="sampler_t.html">sampler_t</link>
170
<parameter>sampler</parameter>
173
<link xlink:href="vectorDataTypes.html">float4</link>
174
<parameter>coord</parameter>
180
<!-- ================================ DESCRIPTION -->
182
<refsect1 id="description"><title>Description</title>
184
For the forms that take an <type>image2d_t</type>, use the coordinate <emphasis>(x,
185
y)</emphasis> to do an element lookup in the 2D image object specified by
186
<varname>image</varname>.
190
For the forms that take an <type>image2d_array_t</type>, Use
191
<emphasis>coord.xy</emphasis> to do an element lookup in the 2D image identified by
192
<emphasis>coord.z</emphasis> in the 2D image array specified by <varname>image</varname>.
196
The samplerless read image functions behave exactly as the corresponding read
197
image functions that take integer coordinates and a sampler with filter mode
198
set to <constant>CLK_FILTER_NEAREST</constant>, normalized coordinates set
199
to <constant>CLK_NORMALIZED_COORDS_FALSE</constant> and addressing mode to
200
<constant>CLK_ADDRESS_NONE</constant>.
204
<function>read_imageh</function> returns half floating-point values in the range
205
[0.0... 1.0] for image objects created with <varname>image_channel_data_type</varname>
206
set to one of the predefined packed formats or <constant>CL_UNORM_INT8</constant>
207
or <constant>CL_UNORM_INT16</constant>.
211
<function>read_imageh</function> returns half floating-point values in the range
212
[-1.0... 1.0] for image objects created with <varname>image_channel_data_type</varname>
213
set to <constant>CL_SNORM_INT8</constant>, or <constant>CL_SNORM_INT16</constant>.
217
<function>read_imageh</function> returns half floating-point values for
218
image objects created with <varname>image_channel_data_type</varname> set to
219
<constant>CL_HALF_FLOAT</constant>.
223
The <function>read_imageh</function> calls that take integer coordinates must
224
use a sampler with filter mode set to <constant>CLK_FILTER_NEAREST</constant>,
225
normalized coordinates set to <constant>CLK_NORMALIZED_COORDS_FALSE</constant>
226
and addressing mode set to <constant>CLK_ADDRESS_CLAMP_TO_EDGE</constant>,
227
<constant>CLK_ADDRESS_CLAMP</constant> or <constant>CLK_ADDRESS_NONE</constant>;
228
otherwise the values returned are undefined.
232
Values returned by <function>read_imageh</function> for image objects with
233
<varname>image_channel_data_type</varname> values not specified in the description
238
<!-- ================================ NOTES -->
239
<refsect1 id="notes"><title>Notes</title>
242
General information about the <function>read_image</function>* functions follows.
251
<!-- ================================ EXAMPLE -->
252
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
254
<refsect2 id="example1">
259
<informaltable frame="none">
260
<tgroup cols="1" align="left" colsep="0" rowsep="0">
261
<colspec colname="col1" colnum="1" />
265
Example goes here - it will be set in "code" type with white space preserved.
274
<!-- ================================ SPECIFICATION -->
275
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page -->
277
<refsect1 id="specification"><title>Specification</title>
280
<imagedata fileref="pdficon_small1.gif" format="gif" />
283
<olink uri="imageFunctionsHalf">OpenCL Specification</olink>
287
<!-- ================================ ALSO SEE -->
289
<refsect1 id="seealso"><title>Also see</title>
291
<citerefentry href="imageFunctions"><refentrytitle>Image Functions</refentrytitle></citerefentry>
295
<!-- ============================== COPYRIGHT -->
296
<!-- Content included from copyright.inc.xsl -->
298
<refsect3 id="Copyright"><title></title>
300
<imagedata fileref="KhronosLogo.jpg" format="jpg" />