blob: ed6d7cfee88f2da98d40441b95494a3f66604c97 [file] [log] [blame]
Anthony Barbier871448e2017-03-24 14:54:29 +00001<!-- HTML header for doxygen 1.8.9.1-->
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4<head>
5<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6<meta http-equiv="X-UA-Compatible" content="IE=9"/>
Kaizen8938bd32017-09-28 14:38:23 +01007<meta name="generator" content="Doxygen 1.8.6"/>
Anthony Barbier871448e2017-03-24 14:54:29 +00008<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
Anthony Barbierdbdab852017-06-23 15:42:00 +01009<title>Compute Library: src/core/CL/cl_kernels/threshold.cl File Reference</title>
Anthony Barbier871448e2017-03-24 14:54:29 +000010<link href="tabs.css" rel="stylesheet" type="text/css"/>
11<script type="text/javascript" src="jquery.js"></script>
12<script type="text/javascript" src="dynsections.js"></script>
13<link href="navtree.css" rel="stylesheet" type="text/css"/>
14<script type="text/javascript" src="resize.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000015<script type="text/javascript" src="navtree.js"></script>
16<script type="text/javascript">
17 $(document).ready(initResizable);
18 $(window).load(resizeHeight);
19</script>
20<link href="search/search.css" rel="stylesheet" type="text/css"/>
Anthony Barbier871448e2017-03-24 14:54:29 +000021<script type="text/javascript" src="search/search.js"></script>
22<script type="text/javascript">
Kaizen8938bd32017-09-28 14:38:23 +010023 $(document).ready(function() { searchBox.OnSelectItem(0); });
Anthony Barbier871448e2017-03-24 14:54:29 +000024</script>
25<script type="text/x-mathjax-config">
26 MathJax.Hub.Config({
27 extensions: ["tex2jax.js"],
28 jax: ["input/TeX","output/HTML-CSS"],
29});
Kaizen8938bd32017-09-28 14:38:23 +010030</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000031<link href="doxygen.css" rel="stylesheet" type="text/css" />
32</head>
33<body>
34<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
35<div id="titlearea">
36<table cellspacing="0" cellpadding="0">
37 <tbody>
38 <tr style="height: 56px;">
39 <td style="padding-left: 0.5em;">
Anthony Barbierdbdab852017-06-23 15:42:00 +010040 <div id="projectname">Compute Library
Kaizenbf8b01d2017-10-12 14:26:51 +010041 &#160;<span id="projectnumber">17.10</span>
Anthony Barbier871448e2017-03-24 14:54:29 +000042 </div>
43 </td>
44 </tr>
45 </tbody>
46</table>
47</div>
48<!-- end header part -->
Kaizen8938bd32017-09-28 14:38:23 +010049<!-- Generated by Doxygen 1.8.6 -->
Anthony Barbier871448e2017-03-24 14:54:29 +000050<script type="text/javascript">
51var searchBox = new SearchBox("searchBox", "search",false,'Search');
52</script>
53 <div id="navrow1" class="tabs">
54 <ul class="tablist">
55 <li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
Anthony Barbierdbdab852017-06-23 15:42:00 +010056 <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +000057 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
58 <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
59 <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
60 <li>
61 <div id="MSearchBox" class="MSearchBoxInactive">
62 <span class="left">
63 <img id="MSearchSelect" src="search/mag_sel.png"
64 onmouseover="return searchBox.OnSearchSelectShow()"
65 onmouseout="return searchBox.OnSearchSelectHide()"
66 alt=""/>
67 <input type="text" id="MSearchField" value="Search" accesskey="S"
68 onfocus="searchBox.OnSearchFieldFocus(true)"
69 onblur="searchBox.OnSearchFieldFocus(false)"
70 onkeyup="searchBox.OnSearchFieldChange(event)"/>
71 </span><span class="right">
72 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
73 </span>
74 </div>
75 </li>
76 </ul>
77 </div>
78 <div id="navrow2" class="tabs2">
79 <ul class="tablist">
80 <li><a href="files.xhtml"><span>File&#160;List</span></a></li>
81 <li><a href="globals.xhtml"><span>Globals</span></a></li>
82 </ul>
83 </div>
84</div><!-- top -->
85<div id="side-nav" class="ui-resizable side-nav-resizable">
86 <div id="nav-tree">
87 <div id="nav-tree-contents">
88 <div id="nav-sync" class="sync"></div>
89 </div>
90 </div>
91 <div id="splitbar" style="-moz-user-select:none;"
92 class="ui-resizable-handle">
93 </div>
94</div>
95<script type="text/javascript">
96$(document).ready(function(){initNavTree('threshold_8cl.xhtml','');});
97</script>
98<div id="doc-content">
99<!-- window showing the filter options -->
100<div id="MSearchSelectWindow"
101 onmouseover="return searchBox.OnSearchSelectShow()"
102 onmouseout="return searchBox.OnSearchSelectHide()"
103 onkeydown="return searchBox.OnSearchSelectKey(event)">
Kaizen8938bd32017-09-28 14:38:23 +0100104<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000105
106<!-- iframe showing the search results (closed by default) -->
107<div id="MSearchResultsWindow">
108<iframe src="javascript:void(0)" frameborder="0"
109 name="MSearchResults" id="MSearchResults">
110</iframe>
111</div>
112
113<div class="header">
114 <div class="summary">
115<a href="#func-members">Functions</a> </div>
116 <div class="headertitle">
117<div class="title">threshold.cl File Reference</div> </div>
118</div><!--header-->
119<div class="contents">
Kaizen8938bd32017-09-28 14:38:23 +0100120<div class="textblock"><code>#include &quot;<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>&quot;</code><br/>
Anthony Barbier871448e2017-03-24 14:54:29 +0000121</div>
122<p><a href="threshold_8cl_source.xhtml">Go to the source code of this file.</a></p>
123<table class="memberdecls">
124<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
125Functions</h2></td></tr>
126<tr class="memitem:a6c8801a257e3e3d80af8b60967975d42"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threshold_8cl.xhtml#a6c8801a257e3e3d80af8b60967975d42">threshold_binary</a> (__global uchar *in_ptr, uint in_stride_x, uint in_step_x, uint in_stride_y, uint in_step_y, uint in_offset_first_element_in_bytes, __global uchar *out_ptr, uint out_stride_x, uint out_step_x, uint out_stride_y, uint out_step_y, uint out_offset_first_element_in_bytes, const uchar false_val, const uchar true_val, const uchar threshold)</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100127<tr class="memdesc:a6c8801a257e3e3d80af8b60967975d42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform binary thresholding on an image. <a href="#a6c8801a257e3e3d80af8b60967975d42">More...</a><br/></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000128<tr class="separator:a6c8801a257e3e3d80af8b60967975d42"><td class="memSeparator" colspan="2">&#160;</td></tr>
129<tr class="memitem:a2e3f1b089d9b33880c9bb6e98f294bba"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threshold_8cl.xhtml#a2e3f1b089d9b33880c9bb6e98f294bba">threshold_range</a> (__global uchar *in_ptr, uint in_stride_x, uint in_step_x, uint in_stride_y, uint in_step_y, uint in_offset_first_element_in_bytes, __global uchar *out_ptr, uint out_stride_x, uint out_step_x, uint out_stride_y, uint out_step_y, uint out_offset_first_element_in_bytes, const uchar false_val, const uchar true_val, const uchar lower, const uchar upper)</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100130<tr class="memdesc:a2e3f1b089d9b33880c9bb6e98f294bba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform range thresholding on an image. <a href="#a2e3f1b089d9b33880c9bb6e98f294bba">More...</a><br/></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000131<tr class="separator:a2e3f1b089d9b33880c9bb6e98f294bba"><td class="memSeparator" colspan="2">&#160;</td></tr>
132</table>
133<h2 class="groupheader">Function Documentation</h2>
134<a class="anchor" id="a6c8801a257e3e3d80af8b60967975d42"></a>
135<div class="memitem">
136<div class="memproto">
137 <table class="memname">
138 <tr>
139 <td class="memname">__kernel void threshold_binary </td>
140 <td>(</td>
141 <td class="paramtype">__global uchar *&#160;</td>
142 <td class="paramname"><em>in_ptr</em>, </td>
143 </tr>
144 <tr>
145 <td class="paramkey"></td>
146 <td></td>
147 <td class="paramtype">uint&#160;</td>
148 <td class="paramname"><em>in_stride_x</em>, </td>
149 </tr>
150 <tr>
151 <td class="paramkey"></td>
152 <td></td>
153 <td class="paramtype">uint&#160;</td>
154 <td class="paramname"><em>in_step_x</em>, </td>
155 </tr>
156 <tr>
157 <td class="paramkey"></td>
158 <td></td>
159 <td class="paramtype">uint&#160;</td>
160 <td class="paramname"><em>in_stride_y</em>, </td>
161 </tr>
162 <tr>
163 <td class="paramkey"></td>
164 <td></td>
165 <td class="paramtype">uint&#160;</td>
166 <td class="paramname"><em>in_step_y</em>, </td>
167 </tr>
168 <tr>
169 <td class="paramkey"></td>
170 <td></td>
171 <td class="paramtype">uint&#160;</td>
172 <td class="paramname"><em>in_offset_first_element_in_bytes</em>, </td>
173 </tr>
174 <tr>
175 <td class="paramkey"></td>
176 <td></td>
177 <td class="paramtype">__global uchar *&#160;</td>
178 <td class="paramname"><em>out_ptr</em>, </td>
179 </tr>
180 <tr>
181 <td class="paramkey"></td>
182 <td></td>
183 <td class="paramtype">uint&#160;</td>
184 <td class="paramname"><em>out_stride_x</em>, </td>
185 </tr>
186 <tr>
187 <td class="paramkey"></td>
188 <td></td>
189 <td class="paramtype">uint&#160;</td>
190 <td class="paramname"><em>out_step_x</em>, </td>
191 </tr>
192 <tr>
193 <td class="paramkey"></td>
194 <td></td>
195 <td class="paramtype">uint&#160;</td>
196 <td class="paramname"><em>out_stride_y</em>, </td>
197 </tr>
198 <tr>
199 <td class="paramkey"></td>
200 <td></td>
201 <td class="paramtype">uint&#160;</td>
202 <td class="paramname"><em>out_step_y</em>, </td>
203 </tr>
204 <tr>
205 <td class="paramkey"></td>
206 <td></td>
207 <td class="paramtype">uint&#160;</td>
208 <td class="paramname"><em>out_offset_first_element_in_bytes</em>, </td>
209 </tr>
210 <tr>
211 <td class="paramkey"></td>
212 <td></td>
213 <td class="paramtype">const uchar&#160;</td>
214 <td class="paramname"><em>false_val</em>, </td>
215 </tr>
216 <tr>
217 <td class="paramkey"></td>
218 <td></td>
219 <td class="paramtype">const uchar&#160;</td>
220 <td class="paramname"><em>true_val</em>, </td>
221 </tr>
222 <tr>
223 <td class="paramkey"></td>
224 <td></td>
225 <td class="paramtype">const uchar&#160;</td>
226 <td class="paramname"><em>threshold</em>&#160;</td>
227 </tr>
228 <tr>
229 <td></td>
230 <td>)</td>
231 <td></td><td></td>
232 </tr>
233 </table>
234</div><div class="memdoc">
235
236<p>Perform binary thresholding on an image. </p>
237<dl class="params"><dt>Parameters</dt><dd>
238 <table class="params">
239 <tr><td class="paramdir">[in]</td><td class="paramname">in_ptr</td><td>Pointer to the source image </td></tr>
240 <tr><td class="paramdir">[in]</td><td class="paramname">in_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
241 <tr><td class="paramdir">[in]</td><td class="paramname">in_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
242 <tr><td class="paramdir">[in]</td><td class="paramname">in_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
243 <tr><td class="paramdir">[in]</td><td class="paramname">in_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
244 <tr><td class="paramdir">[in]</td><td class="paramname">in_offset_first_element_in_bytes</td><td>The offset of the first element in the first source image </td></tr>
245 <tr><td class="paramdir">[out]</td><td class="paramname">out_ptr</td><td>Pointer to the destination image </td></tr>
246 <tr><td class="paramdir">[in]</td><td class="paramname">out_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr>
247 <tr><td class="paramdir">[in]</td><td class="paramname">out_step_x</td><td>dst_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
248 <tr><td class="paramdir">[in]</td><td class="paramname">out_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr>
249 <tr><td class="paramdir">[in]</td><td class="paramname">out_step_y</td><td>dst_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
250 <tr><td class="paramdir">[in]</td><td class="paramname">out_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr>
251 <tr><td class="paramdir">[in]</td><td class="paramname">false_val</td><td>False value </td></tr>
252 <tr><td class="paramdir">[in]</td><td class="paramname">true_val</td><td>True value </td></tr>
253 <tr><td class="paramdir">[in]</td><td class="paramname">threshold</td><td>The thresold value </td></tr>
254 </table>
255 </dd>
256</dl>
257
258<p>Definition at line <a class="el" href="threshold_8cl_source.xhtml#l00044">44</a> of file <a class="el" href="threshold_8cl_source.xhtml">threshold.cl</a>.</p>
259
Kaizenbf8b01d2017-10-12 14:26:51 +0100260<p>References <a class="el" href="helpers_8h_source.xhtml#l00096">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00136">Image::ptr</a>.</p>
Kaizen8938bd32017-09-28 14:38:23 +0100261<div class="fragment"><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;{</div>
262<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="comment">// Get pixels pointer</span></div>
263<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> in = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(in);</div>
264<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> out = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(out);</div>
265<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div>
266<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">// Load data</span></div>
267<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; uchar16 in_data = vload16(0, in.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div>
268<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div>
269<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="comment">// Perform binary thresholding</span></div>
270<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; in_data = select((uchar16)false_val, (uchar16)true_val, in_data &gt; (uchar16)<a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a6cae310822a46019ba25a00ddb0f7e62">threshold</a>);</div>
271<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div>
272<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="comment">// Store result</span></div>
273<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; vstore16(in_data, 0, out.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div>
274<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;}</div>
Kaizenbf8b01d2017-10-12 14:26:51 +0100275<div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00096">helpers.h:96</a></div></div>
276<div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00134">helpers.h:134</a></div></div>
277<div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00136">helpers.h:136</a></div></div>
Kaizen8938bd32017-09-28 14:38:23 +0100278<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_1_1reference_xhtml_a6cae310822a46019ba25a00ddb0f7e62"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a6cae310822a46019ba25a00ddb0f7e62">arm_compute::test::validation::reference::threshold</a></div><div class="ttdeci">SimpleTensor&lt; T &gt; threshold(const SimpleTensor&lt; T &gt; &amp;src, T threshold, T false_value, T true_value, ThresholdType type, T upper)</div><div class="ttdef"><b>Definition:</b> <a href="_c_p_p_2_threshold_8cpp_source.xhtml#l00035">Threshold.cpp:35</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000279</div><!-- fragment -->
280</div>
281</div>
282<a class="anchor" id="a2e3f1b089d9b33880c9bb6e98f294bba"></a>
283<div class="memitem">
284<div class="memproto">
285 <table class="memname">
286 <tr>
287 <td class="memname">__kernel void threshold_range </td>
288 <td>(</td>
289 <td class="paramtype">__global uchar *&#160;</td>
290 <td class="paramname"><em>in_ptr</em>, </td>
291 </tr>
292 <tr>
293 <td class="paramkey"></td>
294 <td></td>
295 <td class="paramtype">uint&#160;</td>
296 <td class="paramname"><em>in_stride_x</em>, </td>
297 </tr>
298 <tr>
299 <td class="paramkey"></td>
300 <td></td>
301 <td class="paramtype">uint&#160;</td>
302 <td class="paramname"><em>in_step_x</em>, </td>
303 </tr>
304 <tr>
305 <td class="paramkey"></td>
306 <td></td>
307 <td class="paramtype">uint&#160;</td>
308 <td class="paramname"><em>in_stride_y</em>, </td>
309 </tr>
310 <tr>
311 <td class="paramkey"></td>
312 <td></td>
313 <td class="paramtype">uint&#160;</td>
314 <td class="paramname"><em>in_step_y</em>, </td>
315 </tr>
316 <tr>
317 <td class="paramkey"></td>
318 <td></td>
319 <td class="paramtype">uint&#160;</td>
320 <td class="paramname"><em>in_offset_first_element_in_bytes</em>, </td>
321 </tr>
322 <tr>
323 <td class="paramkey"></td>
324 <td></td>
325 <td class="paramtype">__global uchar *&#160;</td>
326 <td class="paramname"><em>out_ptr</em>, </td>
327 </tr>
328 <tr>
329 <td class="paramkey"></td>
330 <td></td>
331 <td class="paramtype">uint&#160;</td>
332 <td class="paramname"><em>out_stride_x</em>, </td>
333 </tr>
334 <tr>
335 <td class="paramkey"></td>
336 <td></td>
337 <td class="paramtype">uint&#160;</td>
338 <td class="paramname"><em>out_step_x</em>, </td>
339 </tr>
340 <tr>
341 <td class="paramkey"></td>
342 <td></td>
343 <td class="paramtype">uint&#160;</td>
344 <td class="paramname"><em>out_stride_y</em>, </td>
345 </tr>
346 <tr>
347 <td class="paramkey"></td>
348 <td></td>
349 <td class="paramtype">uint&#160;</td>
350 <td class="paramname"><em>out_step_y</em>, </td>
351 </tr>
352 <tr>
353 <td class="paramkey"></td>
354 <td></td>
355 <td class="paramtype">uint&#160;</td>
356 <td class="paramname"><em>out_offset_first_element_in_bytes</em>, </td>
357 </tr>
358 <tr>
359 <td class="paramkey"></td>
360 <td></td>
361 <td class="paramtype">const uchar&#160;</td>
362 <td class="paramname"><em>false_val</em>, </td>
363 </tr>
364 <tr>
365 <td class="paramkey"></td>
366 <td></td>
367 <td class="paramtype">const uchar&#160;</td>
368 <td class="paramname"><em>true_val</em>, </td>
369 </tr>
370 <tr>
371 <td class="paramkey"></td>
372 <td></td>
373 <td class="paramtype">const uchar&#160;</td>
374 <td class="paramname"><em>lower</em>, </td>
375 </tr>
376 <tr>
377 <td class="paramkey"></td>
378 <td></td>
379 <td class="paramtype">const uchar&#160;</td>
380 <td class="paramname"><em>upper</em>&#160;</td>
381 </tr>
382 <tr>
383 <td></td>
384 <td>)</td>
385 <td></td><td></td>
386 </tr>
387 </table>
388</div><div class="memdoc">
389
390<p>Perform range thresholding on an image. </p>
391<dl class="params"><dt>Parameters</dt><dd>
392 <table class="params">
393 <tr><td class="paramdir">[in]</td><td class="paramname">in_ptr</td><td>Pointer to the source image </td></tr>
394 <tr><td class="paramdir">[in]</td><td class="paramname">in_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
395 <tr><td class="paramdir">[in]</td><td class="paramname">in_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
396 <tr><td class="paramdir">[in]</td><td class="paramname">in_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
397 <tr><td class="paramdir">[in]</td><td class="paramname">in_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
398 <tr><td class="paramdir">[in]</td><td class="paramname">in_offset_first_element_in_bytes</td><td>The offset of the first element in the first source image </td></tr>
399 <tr><td class="paramdir">[out]</td><td class="paramname">out_ptr</td><td>Pointer to the destination image </td></tr>
400 <tr><td class="paramdir">[in]</td><td class="paramname">out_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr>
401 <tr><td class="paramdir">[in]</td><td class="paramname">out_step_x</td><td>dst_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
402 <tr><td class="paramdir">[in]</td><td class="paramname">out_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr>
403 <tr><td class="paramdir">[in]</td><td class="paramname">out_step_y</td><td>dst_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
404 <tr><td class="paramdir">[in]</td><td class="paramname">out_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr>
405 <tr><td class="paramdir">[in]</td><td class="paramname">false_val</td><td>False value </td></tr>
406 <tr><td class="paramdir">[in]</td><td class="paramname">true_val</td><td>True value </td></tr>
407 <tr><td class="paramdir">[in]</td><td class="paramname">lower</td><td>Lower threshold </td></tr>
408 <tr><td class="paramdir">[in]</td><td class="paramname">upper</td><td>Upper threshold </td></tr>
409 </table>
410 </dd>
411</dl>
412
413<p>Definition at line <a class="el" href="threshold_8cl_source.xhtml#l00084">84</a> of file <a class="el" href="threshold_8cl_source.xhtml">threshold.cl</a>.</p>
414
Kaizenbf8b01d2017-10-12 14:26:51 +0100415<p>References <a class="el" href="helpers_8h_source.xhtml#l00096">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00136">Image::ptr</a>.</p>
Kaizen8938bd32017-09-28 14:38:23 +0100416<div class="fragment"><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;{</div>
417<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// Get pixels pointer</span></div>
418<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> in = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(in);</div>
419<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> out = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(out);</div>
420<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div>
421<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="comment">// Load data</span></div>
422<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; uchar16 in_data = vload16(0, in.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div>
423<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div>
424<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="comment">// Perform range thresholding</span></div>
425<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; in_data = select((uchar16)true_val, (uchar16)false_val, in_data &gt; (uchar16)upper || in_data &lt; (uchar16)lower);</div>
426<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
427<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="comment">// Store result</span></div>
428<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; vstore16(in_data, 0, out.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div>
429<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;}</div>
Kaizenbf8b01d2017-10-12 14:26:51 +0100430<div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00096">helpers.h:96</a></div></div>
431<div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00134">helpers.h:134</a></div></div>
432<div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00136">helpers.h:136</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000433</div><!-- fragment -->
434</div>
435</div>
436</div><!-- contents -->
437</div><!-- doc-content -->
438<!-- start footer part -->
439<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
440 <ul>
Kaizen8938bd32017-09-28 14:38:23 +0100441 <li class="navelem"><a class="el" href="dir_55b5a5006e943fb664ff8cff3cfe7768.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_f6c3ae42d7e27145d0a3c3e38ca1c000.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_1b7ae9123c88e650426d50d95c19d414.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_b7c3d80b0dadb2139bc73b7161751c12.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="threshold_8cl.xhtml">threshold.cl</a></li>
Kaizenbf8b01d2017-10-12 14:26:51 +0100442 <li class="footer">Generated on Thu Oct 12 2017 14:26:35 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000443 <a href="http://www.doxygen.org/index.html">
Kaizen8938bd32017-09-28 14:38:23 +0100444 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000445 </ul>
446</div>
447</body>
448</html>