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_imagef (1D)</keyword>
16
<refentrytitle>read_imagef (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_image2d">
38
<refname>read_imagef (1D)</refname>
41
Do an element lookup in the 1D image object, returning floating-point values.
45
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
49
<link xlink:href="vectorDataTypes.html">float4</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">float4</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">float4</link>
101
<link xlink:href="otherDataTypes.html">image1d_t</link>
102
<parameter>image</parameter>
105
<link xlink:href="vectorDataTypes.html">int</link>
106
<parameter>coord</parameter>
114
<link xlink:href="vectorDataTypes.html">float4</link>
120
<link xlink:href="otherDataTypes.html">image1d_buffer_t</link>
121
<parameter>image</parameter>
124
<link xlink:href="vectorDataTypes.html">int</link>
125
<parameter>coord</parameter>
133
<link xlink:href="vectorDataTypes.html">float4</link>
139
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
140
<parameter>image</parameter>
143
<link xlink:href="vectorDataTypes.html">int2</link>
144
<parameter>coord</parameter>
152
<link xlink:href="vectorDataTypes.html">float4</link>
158
<link xlink:href="otherDataTypes.html">image1d_array_t</link>
159
<parameter>image</parameter>
162
<link xlink:href="sampler_t.html">sampler_t</link>
163
<parameter>sampler</parameter>
166
<link xlink:href="vectorDataTypes.html">float4</link>
167
<parameter>coord</parameter>
173
<!-- ================================ DESCRIPTION -->
175
<refsect1 id="description"><title>Functions to read 1D images and image arrays</title>
177
For forms that take <type>image1d_t</type>, use <emphasis>coord</emphasis> to do an
178
element lookup in the 1D image object specified by <varname>image</varname>.
182
For forms that take <type>image1d_array_t</type>, use <emphasis>coord.x</emphasis>
183
to do an element lookup in the 1D image identified by <emphasis>coord.y</emphasis>
184
in the 1D image array specified by <varname>image</varname>.
188
The samplerless read image functions behave exactly as the corresponding read
189
image functions that take integer coordinates and a sampler with filter mode
190
set to <constant>CLK_FILTER_NEAREST</constant>, normalized coordinates set
191
to <constant>CLK_NORMALIZED_COORDS_FALSE</constant> and addressing mode to
192
<constant>CLK_ADDRESS_NONE</constant>.
196
<function>read_imagef</function> returns floating-point values in the range
197
[0.0... 1.0] for image objects created with <varname>image_channel_data_type</varname>
198
set to one of the predefined packed formats or <constant>CL_UNORM_INT8</constant>
199
or <constant>CL_UNORM_INT16</constant>.
203
<function>read_imagef</function> returns floating-point values in the range [-1.0... 1.0]
204
for image objects created with <varname>image_channel_data_type</varname> set to
205
<constant>CL_SNORM_INT8</constant>, or <constant>CL_SNORM_INT16</constant>.
209
<function>read_imagef</function> returns floating-point values for image objects created
210
with <varname>image_channel_data_type</varname> set to <constant>CL_HALF_FLOAT</constant>
211
or <constant>CL_FLOAT</constant>.
215
The <function>read_imagef</function> calls that take integer coordinates must
216
use a sampler with filter mode set to <constant>CLK_FILTER_NEAREST</constant>,
217
normalized coordinates set to <constant>CLK_NORMALIZED_COORDS_FALSE</constant>
218
and addressing mode set to <constant>CLK_ADDRESS_CLAMP_TO_EDGE</constant>,
219
<constant>CLK_ADDRESS_CLAMP</constant> or <constant>CLK_ADDRESS_NONE</constant>;
220
otherwise the values returned are undefined.
224
Values returned by <function>read_imagef</function> for image objects with
225
<varname>image_channel_data_type</varname> values not specified in the description
230
<!-- ================================ NOTES -->
231
<refsect1 id="notes"><title>Notes</title>
234
General information about the <function>read_image</function>* functions follows.
243
<!-- ================================ SPECIFICATION -->
244
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
246
<refsect1 id="specification"><title>Specification</title>
249
<imagedata fileref="pdficon_small1.gif" format="gif" />
252
<olink uri="imageFunctions">OpenCL Specification</olink>
256
<!-- ================================ ALSO SEE -->
258
<refsect1 id="seealso"><title>Also see</title>
260
<citerefentry href="imageFunctions"><refentrytitle>Image Functions</refentrytitle></citerefentry>
264
<!-- ============================== COPYRIGHT -->
265
<!-- Content included from copyright.inc.xsl -->
267
<refsect3 id="Copyright"><title></title>
269
<imagedata fileref="KhronosLogo.jpg" format="jpg" />