arm_compute v17.03.1
[platform/upstream/armcl.git] / documentation / scale_8cl.xhtml
1 <!-- 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"/>
7 <meta name="generator" content="Doxygen 1.8.11"/>
8 <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
9 <title>ARM Compute Library: src/core/CL/cl_kernels/scale.cl File Reference</title>
10 <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>
15 <script type="text/javascript" src="navtreedata.js"></script>
16 <script type="text/javascript" src="navtree.js"></script>
17 <script type="text/javascript">
18   $(document).ready(initResizable);
19   $(window).load(resizeHeight);
20 </script>
21 <link href="search/search.css" rel="stylesheet" type="text/css"/>
22 <script type="text/javascript" src="search/searchdata.js"></script>
23 <script type="text/javascript" src="search/search.js"></script>
24 <script type="text/javascript">
25   $(document).ready(function() { init_search(); });
26 </script>
27 <script type="text/x-mathjax-config">
28   MathJax.Hub.Config({
29     extensions: ["tex2jax.js"],
30     jax: ["input/TeX","output/HTML-CSS"],
31 });
32 </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
33 <link href="doxygen.css" rel="stylesheet" type="text/css" />
34 </head>
35 <body>
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
37 <div id="titlearea">
38 <table cellspacing="0" cellpadding="0">
39  <tbody>
40  <tr style="height: 56px;">
41   <td style="padding-left: 0.5em;">
42    <div id="projectname">ARM Compute Library
43    &#160;<span id="projectnumber">17.03.1</span>
44    </div>
45   </td>
46  </tr>
47  </tbody>
48 </table>
49 </div>
50 <!-- end header part -->
51 <!-- Generated by Doxygen 1.8.11 -->
52 <script type="text/javascript">
53 var searchBox = new SearchBox("searchBox", "search",false,'Search');
54 </script>
55   <div id="navrow1" class="tabs">
56     <ul class="tablist">
57       <li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
58       <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
59       <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
60       <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
61       <li>
62         <div id="MSearchBox" class="MSearchBoxInactive">
63         <span class="left">
64           <img id="MSearchSelect" src="search/mag_sel.png"
65                onmouseover="return searchBox.OnSearchSelectShow()"
66                onmouseout="return searchBox.OnSearchSelectHide()"
67                alt=""/>
68           <input type="text" id="MSearchField" value="Search" accesskey="S"
69                onfocus="searchBox.OnSearchFieldFocus(true)" 
70                onblur="searchBox.OnSearchFieldFocus(false)" 
71                onkeyup="searchBox.OnSearchFieldChange(event)"/>
72           </span><span class="right">
73             <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
74           </span>
75         </div>
76       </li>
77     </ul>
78   </div>
79   <div id="navrow2" class="tabs2">
80     <ul class="tablist">
81       <li><a href="files.xhtml"><span>File&#160;List</span></a></li>
82       <li><a href="globals.xhtml"><span>Globals</span></a></li>
83     </ul>
84   </div>
85 </div><!-- top -->
86 <div id="side-nav" class="ui-resizable side-nav-resizable">
87   <div id="nav-tree">
88     <div id="nav-tree-contents">
89       <div id="nav-sync" class="sync"></div>
90     </div>
91   </div>
92   <div id="splitbar" style="-moz-user-select:none;" 
93        class="ui-resizable-handle">
94   </div>
95 </div>
96 <script type="text/javascript">
97 $(document).ready(function(){initNavTree('scale_8cl.xhtml','');});
98 </script>
99 <div id="doc-content">
100 <!-- window showing the filter options -->
101 <div id="MSearchSelectWindow"
102      onmouseover="return searchBox.OnSearchSelectShow()"
103      onmouseout="return searchBox.OnSearchSelectHide()"
104      onkeydown="return searchBox.OnSearchSelectKey(event)">
105 </div>
106
107 <!-- iframe showing the search results (closed by default) -->
108 <div id="MSearchResultsWindow">
109 <iframe src="javascript:void(0)" frameborder="0" 
110         name="MSearchResults" id="MSearchResults">
111 </iframe>
112 </div>
113
114 <div class="header">
115   <div class="summary">
116 <a href="#func-members">Functions</a>  </div>
117   <div class="headertitle">
118 <div class="title">scale.cl File Reference</div>  </div>
119 </div><!--header-->
120 <div class="contents">
121 <div class="textblock"><code>#include &quot;<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>&quot;</code><br />
122 <code>#include &quot;<a class="el" href="warp__helpers_8h_source.xhtml">warp_helpers.h</a>&quot;</code><br />
123 </div>
124 <p><a href="scale_8cl_source.xhtml">Go to the source code of this file.</a></p>
125 <table class="memberdecls">
126 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
127 Functions</h2></td></tr>
128 <tr class="memitem:a55c710b814464d9b8982c4eb6ca04dee"><td class="memItemLeft" align="right" valign="top">const float8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="scale_8cl.xhtml#a55c710b814464d9b8982c4eb6ca04dee">transform_nearest</a> (const float2 coord, const float2 scale)</td></tr>
129 <tr class="memdesc:a55c710b814464d9b8982c4eb6ca04dee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transforms four 2D coordinates.  <a href="#a55c710b814464d9b8982c4eb6ca04dee">More...</a><br /></td></tr>
130 <tr class="separator:a55c710b814464d9b8982c4eb6ca04dee"><td class="memSeparator" colspan="2">&#160;</td></tr>
131 <tr class="memitem:a1990e87858b15b8fce3f63965fb9b86c"><td class="memItemLeft" align="right" valign="top">const float8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="scale_8cl.xhtml#a1990e87858b15b8fce3f63965fb9b86c">transform_bilinear</a> (const float2 coord, const float2 scale)</td></tr>
132 <tr class="memdesc:a1990e87858b15b8fce3f63965fb9b86c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transforms four 2D coordinates.  <a href="#a1990e87858b15b8fce3f63965fb9b86c">More...</a><br /></td></tr>
133 <tr class="separator:a1990e87858b15b8fce3f63965fb9b86c"><td class="memSeparator" colspan="2">&#160;</td></tr>
134 <tr class="memitem:aec1496e8c3bdb3630f92433b1820e713"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="scale_8cl.xhtml#aec1496e8c3bdb3630f92433b1820e713">scale_nearest_neighbour</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 float input_width, const float input_height, const float output_width, const float output_height)</td></tr>
135 <tr class="memdesc:aec1496e8c3bdb3630f92433b1820e713"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs an affine transformation on an image interpolating with the NEAREAST NEIGHBOUR method.  <a href="#aec1496e8c3bdb3630f92433b1820e713">More...</a><br /></td></tr>
136 <tr class="separator:aec1496e8c3bdb3630f92433b1820e713"><td class="memSeparator" colspan="2">&#160;</td></tr>
137 <tr class="memitem:a8d3a406833cc2a6e4eb51a43d5dcdc84"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="scale_8cl.xhtml#a8d3a406833cc2a6e4eb51a43d5dcdc84">scale_bilinear</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 float input_width, const float input_height, const float output_width, const float output_height)</td></tr>
138 <tr class="memdesc:a8d3a406833cc2a6e4eb51a43d5dcdc84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs an affine transformation on an image interpolating with the BILINEAR method.  <a href="#a8d3a406833cc2a6e4eb51a43d5dcdc84">More...</a><br /></td></tr>
139 <tr class="separator:a8d3a406833cc2a6e4eb51a43d5dcdc84"><td class="memSeparator" colspan="2">&#160;</td></tr>
140 </table>
141 <h2 class="groupheader">Function Documentation</h2>
142 <a class="anchor" id="a8d3a406833cc2a6e4eb51a43d5dcdc84"></a>
143 <div class="memitem">
144 <div class="memproto">
145       <table class="memname">
146         <tr>
147           <td class="memname">__kernel void scale_bilinear </td>
148           <td>(</td>
149           <td class="paramtype">__global uchar *&#160;</td>
150           <td class="paramname"><em>in_ptr</em>, </td>
151         </tr>
152         <tr>
153           <td class="paramkey"></td>
154           <td></td>
155           <td class="paramtype">uint&#160;</td>
156           <td class="paramname"><em>in_stride_x</em>, </td>
157         </tr>
158         <tr>
159           <td class="paramkey"></td>
160           <td></td>
161           <td class="paramtype">uint&#160;</td>
162           <td class="paramname"><em>in_step_x</em>, </td>
163         </tr>
164         <tr>
165           <td class="paramkey"></td>
166           <td></td>
167           <td class="paramtype">uint&#160;</td>
168           <td class="paramname"><em>in_stride_y</em>, </td>
169         </tr>
170         <tr>
171           <td class="paramkey"></td>
172           <td></td>
173           <td class="paramtype">uint&#160;</td>
174           <td class="paramname"><em>in_step_y</em>, </td>
175         </tr>
176         <tr>
177           <td class="paramkey"></td>
178           <td></td>
179           <td class="paramtype">uint&#160;</td>
180           <td class="paramname"><em>in_offset_first_element_in_bytes</em>, </td>
181         </tr>
182         <tr>
183           <td class="paramkey"></td>
184           <td></td>
185           <td class="paramtype">__global uchar *&#160;</td>
186           <td class="paramname"><em>out_ptr</em>, </td>
187         </tr>
188         <tr>
189           <td class="paramkey"></td>
190           <td></td>
191           <td class="paramtype">uint&#160;</td>
192           <td class="paramname"><em>out_stride_x</em>, </td>
193         </tr>
194         <tr>
195           <td class="paramkey"></td>
196           <td></td>
197           <td class="paramtype">uint&#160;</td>
198           <td class="paramname"><em>out_step_x</em>, </td>
199         </tr>
200         <tr>
201           <td class="paramkey"></td>
202           <td></td>
203           <td class="paramtype">uint&#160;</td>
204           <td class="paramname"><em>out_stride_y</em>, </td>
205         </tr>
206         <tr>
207           <td class="paramkey"></td>
208           <td></td>
209           <td class="paramtype">uint&#160;</td>
210           <td class="paramname"><em>out_step_y</em>, </td>
211         </tr>
212         <tr>
213           <td class="paramkey"></td>
214           <td></td>
215           <td class="paramtype">uint&#160;</td>
216           <td class="paramname"><em>out_offset_first_element_in_bytes</em>, </td>
217         </tr>
218         <tr>
219           <td class="paramkey"></td>
220           <td></td>
221           <td class="paramtype">const float&#160;</td>
222           <td class="paramname"><em>input_width</em>, </td>
223         </tr>
224         <tr>
225           <td class="paramkey"></td>
226           <td></td>
227           <td class="paramtype">const float&#160;</td>
228           <td class="paramname"><em>input_height</em>, </td>
229         </tr>
230         <tr>
231           <td class="paramkey"></td>
232           <td></td>
233           <td class="paramtype">const float&#160;</td>
234           <td class="paramname"><em>output_width</em>, </td>
235         </tr>
236         <tr>
237           <td class="paramkey"></td>
238           <td></td>
239           <td class="paramtype">const float&#160;</td>
240           <td class="paramname"><em>output_height</em>&#160;</td>
241         </tr>
242         <tr>
243           <td></td>
244           <td>)</td>
245           <td></td><td></td>
246         </tr>
247       </table>
248 </div><div class="memdoc">
249
250 <p>Performs an affine transformation on an image interpolating with the BILINEAR method. </p>
251 <dl class="params"><dt>Parameters</dt><dd>
252   <table class="params">
253     <tr><td class="paramdir">[in]</td><td class="paramname">in_ptr</td><td>Pointer to the source image. Supported data types: U8, S16. </td></tr>
254     <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>
255     <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>
256     <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>
257     <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>
258     <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 source image </td></tr>
259     <tr><td class="paramdir">[out]</td><td class="paramname">out_ptr</td><td>Pointer to the destination image. Supported data types: U8, S16. (Must be the same as the input) </td></tr>
260     <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>
261     <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>
262     <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>
263     <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>
264     <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>
265     <tr><td class="paramdir">[in]</td><td class="paramname">input_width</td><td>Input image width </td></tr>
266     <tr><td class="paramdir">[in]</td><td class="paramname">input_height</td><td>Input image height </td></tr>
267     <tr><td class="paramdir">[in]</td><td class="paramname">output_width</td><td>Output image width </td></tr>
268     <tr><td class="paramdir">[in]</td><td class="paramname">output_height</td><td>Output image height </td></tr>
269   </table>
270   </dd>
271 </dl>
272
273 <p>Definition at line <a class="el" href="scale_8cl_source.xhtml#l00110">110</a> of file <a class="el" href="scale_8cl_source.xhtml">scale.cl</a>.</p>
274
275 <p>References <a class="el" href="warp__helpers_8h_source.xhtml#l00080">bilinear_interpolate()</a>, <a class="el" href="warp__helpers_8h_source.xhtml#l00033">clamp_to_border()</a>, <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00076">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="warp__helpers_8h_source.xhtml#l00054">get_current_coords()</a>, <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>, and <a class="el" href="scale_8cl_source.xhtml#l00049">transform_bilinear()</a>.</p>
276 <div class="fragment"><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;{</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <a class="code" href="struct_image.xhtml">Image</a>        in  = <a class="code" href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>(in);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</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><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keyword">const</span> float2 r   = (float2)(input_width / output_width, input_height / output_height);</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keyword">const</span> float8 tc  = <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="scale_8cl.xhtml#a1990e87858b15b8fce3f63965fb9b86c">transform_bilinear</a>(<a class="code" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a>(), r), input_width, input_height);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    vstore4(<a class="code" href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a>(&amp;in, tc, input_width, input_height), 0, (__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)out.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;}</div><div class="ttc" id="warp__helpers_8h_xhtml_adbdf2ca9e8fe0b67f9359929ef743126"><div class="ttname"><a href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a></div><div class="ttdeci">const float8 clamp_to_border(float8 coords, const float width, const float height)</div><div class="ttdoc">Clamps the given coordinates to the borders. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00033">warp_helpers.h:33</a></div></div>
277 <div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div>
278 <div class="ttc" id="helpers_8h_xhtml_a4334a4a76f8e9628c0fb9e1acf616e2a"><div class="ttname"><a href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT_NO_STEP(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00076">helpers.h:76</a></div></div>
279 <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#l00073">helpers.h:73</a></div></div>
280 <div class="ttc" id="scale_8cl_xhtml_a1990e87858b15b8fce3f63965fb9b86c"><div class="ttname"><a href="scale_8cl.xhtml#a1990e87858b15b8fce3f63965fb9b86c">transform_bilinear</a></div><div class="ttdeci">const float8 transform_bilinear(const float2 coord, const float2 scale)</div><div class="ttdoc">Transforms four 2D coordinates. </div><div class="ttdef"><b>Definition:</b> <a href="scale_8cl_source.xhtml#l00049">scale.cl:49</a></div></div>
281 <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#l00095">helpers.h:95</a></div></div>
282 <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#l00097">helpers.h:97</a></div></div>
283 <div class="ttc" id="warp__helpers_8h_xhtml_a4caaeeb51ea58015267a9974675226d1"><div class="ttname"><a href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a></div><div class="ttdeci">const float2 get_current_coords()</div><div class="ttdoc">Returns the current thread coordinates. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00054">warp_helpers.h:54</a></div></div>
284 <div class="ttc" id="warp__helpers_8h_xhtml_abea9f226daf3e0ad741d03cf7417d353"><div class="ttname"><a href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a></div><div class="ttdeci">const DATA_TYPE4 bilinear_interpolate(const Image *in, const float8 coords, const float width, const float height)</div><div class="ttdoc">Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the ...</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00080">warp_helpers.h:80</a></div></div>
285 </div><!-- fragment -->
286 </div>
287 </div>
288 <a class="anchor" id="aec1496e8c3bdb3630f92433b1820e713"></a>
289 <div class="memitem">
290 <div class="memproto">
291       <table class="memname">
292         <tr>
293           <td class="memname">__kernel void scale_nearest_neighbour </td>
294           <td>(</td>
295           <td class="paramtype">__global uchar *&#160;</td>
296           <td class="paramname"><em>in_ptr</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_stride_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_step_x</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_stride_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_step_y</em>, </td>
321         </tr>
322         <tr>
323           <td class="paramkey"></td>
324           <td></td>
325           <td class="paramtype">uint&#160;</td>
326           <td class="paramname"><em>in_offset_first_element_in_bytes</em>, </td>
327         </tr>
328         <tr>
329           <td class="paramkey"></td>
330           <td></td>
331           <td class="paramtype">__global uchar *&#160;</td>
332           <td class="paramname"><em>out_ptr</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_stride_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_step_x</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_stride_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_step_y</em>, </td>
357         </tr>
358         <tr>
359           <td class="paramkey"></td>
360           <td></td>
361           <td class="paramtype">uint&#160;</td>
362           <td class="paramname"><em>out_offset_first_element_in_bytes</em>, </td>
363         </tr>
364         <tr>
365           <td class="paramkey"></td>
366           <td></td>
367           <td class="paramtype">const float&#160;</td>
368           <td class="paramname"><em>input_width</em>, </td>
369         </tr>
370         <tr>
371           <td class="paramkey"></td>
372           <td></td>
373           <td class="paramtype">const float&#160;</td>
374           <td class="paramname"><em>input_height</em>, </td>
375         </tr>
376         <tr>
377           <td class="paramkey"></td>
378           <td></td>
379           <td class="paramtype">const float&#160;</td>
380           <td class="paramname"><em>output_width</em>, </td>
381         </tr>
382         <tr>
383           <td class="paramkey"></td>
384           <td></td>
385           <td class="paramtype">const float&#160;</td>
386           <td class="paramname"><em>output_height</em>&#160;</td>
387         </tr>
388         <tr>
389           <td></td>
390           <td>)</td>
391           <td></td><td></td>
392         </tr>
393       </table>
394 </div><div class="memdoc">
395
396 <p>Performs an affine transformation on an image interpolating with the NEAREAST NEIGHBOUR method. </p>
397 <p>Input and output are single channel U8 or S16.</p>
398 <dl class="params"><dt>Parameters</dt><dd>
399   <table class="params">
400     <tr><td class="paramdir">[in]</td><td class="paramname">in_ptr</td><td>Pointer to the source image. Supported data types: U8, S16. </td></tr>
401     <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>
402     <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>
403     <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>
404     <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>
405     <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 source image </td></tr>
406     <tr><td class="paramdir">[out]</td><td class="paramname">out_ptr</td><td>Pointer to the destination image. Supported data types: U8, S16. (Must be the same as the input) </td></tr>
407     <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>
408     <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>
409     <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>
410     <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>
411     <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>
412     <tr><td class="paramdir">[in]</td><td class="paramname">input_width</td><td>Input image width </td></tr>
413     <tr><td class="paramdir">[in]</td><td class="paramname">input_height</td><td>Input image height </td></tr>
414     <tr><td class="paramdir">[in]</td><td class="paramname">output_width</td><td>Output image width </td></tr>
415     <tr><td class="paramdir">[in]</td><td class="paramname">output_height</td><td>Output image height </td></tr>
416   </table>
417   </dd>
418 </dl>
419
420 <p>Definition at line <a class="el" href="scale_8cl_source.xhtml#l00076">76</a> of file <a class="el" href="scale_8cl_source.xhtml">scale.cl</a>.</p>
421
422 <p>References <a class="el" href="warp__helpers_8h_source.xhtml#l00033">clamp_to_border()</a>, <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00076">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="warp__helpers_8h_source.xhtml#l00054">get_current_coords()</a>, <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>, <a class="el" href="warp__helpers_8h_source.xhtml#l00045">read_texels4()</a>, and <a class="el" href="scale_8cl_source.xhtml#l00034">transform_nearest()</a>.</p>
423 <div class="fragment"><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;{</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="struct_image.xhtml">Image</a>        in  = <a class="code" href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>(in);</div><div class="line"><a name="l00085"></a><span class="lineno">   85</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><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keyword">const</span> float2 r   = (float2)(input_width / output_width, input_height / output_height);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="keyword">const</span> float8 tc  = <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="scale_8cl.xhtml#a55c710b814464d9b8982c4eb6ca04dee">transform_nearest</a>(<a class="code" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a>(), r), input_width, input_height);</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    vstore4(<a class="code" href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a>(&amp;in, convert_int8(tc)), 0, (__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)out.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;}</div><div class="ttc" id="warp__helpers_8h_xhtml_adbdf2ca9e8fe0b67f9359929ef743126"><div class="ttname"><a href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a></div><div class="ttdeci">const float8 clamp_to_border(float8 coords, const float width, const float height)</div><div class="ttdoc">Clamps the given coordinates to the borders. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00033">warp_helpers.h:33</a></div></div>
424 <div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div>
425 <div class="ttc" id="helpers_8h_xhtml_a4334a4a76f8e9628c0fb9e1acf616e2a"><div class="ttname"><a href="helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT_NO_STEP(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00076">helpers.h:76</a></div></div>
426 <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#l00073">helpers.h:73</a></div></div>
427 <div class="ttc" id="scale_8cl_xhtml_a55c710b814464d9b8982c4eb6ca04dee"><div class="ttname"><a href="scale_8cl.xhtml#a55c710b814464d9b8982c4eb6ca04dee">transform_nearest</a></div><div class="ttdeci">const float8 transform_nearest(const float2 coord, const float2 scale)</div><div class="ttdoc">Transforms four 2D coordinates. </div><div class="ttdef"><b>Definition:</b> <a href="scale_8cl_source.xhtml#l00034">scale.cl:34</a></div></div>
428 <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#l00095">helpers.h:95</a></div></div>
429 <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#l00097">helpers.h:97</a></div></div>
430 <div class="ttc" id="warp__helpers_8h_xhtml_aba42442a4c991cdbb52727fa370676f1"><div class="ttname"><a href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a></div><div class="ttdeci">const DATA_TYPE4 read_texels4(const Image *in, const int8 coords)</div><div class="ttdoc">Reads four texels from the input image. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00045">warp_helpers.h:45</a></div></div>
431 <div class="ttc" id="warp__helpers_8h_xhtml_a4caaeeb51ea58015267a9974675226d1"><div class="ttname"><a href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a></div><div class="ttdeci">const float2 get_current_coords()</div><div class="ttdoc">Returns the current thread coordinates. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00054">warp_helpers.h:54</a></div></div>
432 </div><!-- fragment -->
433 </div>
434 </div>
435 <a class="anchor" id="a1990e87858b15b8fce3f63965fb9b86c"></a>
436 <div class="memitem">
437 <div class="memproto">
438 <table class="mlabels">
439   <tr>
440   <td class="mlabels-left">
441       <table class="memname">
442         <tr>
443           <td class="memname">const float8 transform_bilinear </td>
444           <td>(</td>
445           <td class="paramtype">const float2&#160;</td>
446           <td class="paramname"><em>coord</em>, </td>
447         </tr>
448         <tr>
449           <td class="paramkey"></td>
450           <td></td>
451           <td class="paramtype">const float2&#160;</td>
452           <td class="paramname"><em>scale</em>&#160;</td>
453         </tr>
454         <tr>
455           <td></td>
456           <td>)</td>
457           <td></td><td></td>
458         </tr>
459       </table>
460   </td>
461   <td class="mlabels-right">
462 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
463   </tr>
464 </table>
465 </div><div class="memdoc">
466
467 <p>Transforms four 2D coordinates. </p>
468 <p>This is used to map the output coordinates to the input coordinates.</p>
469 <dl class="params"><dt>Parameters</dt><dd>
470   <table class="params">
471     <tr><td class="paramdir">[in]</td><td class="paramname">coord</td><td>2D coordinates to transform. </td></tr>
472     <tr><td class="paramdir">[in]</td><td class="paramname">scale</td><td>input/output scale ratio</td></tr>
473   </table>
474   </dd>
475 </dl>
476 <dl class="section return"><dt>Returns</dt><dd>a float8 containing 4 2D transformed values in the input image. </dd></dl>
477
478 <p>Definition at line <a class="el" href="scale_8cl_source.xhtml#l00049">49</a> of file <a class="el" href="scale_8cl_source.xhtml">scale.cl</a>.</p>
479
480 <p>Referenced by <a class="el" href="scale_8cl_source.xhtml#l00110">scale_bilinear()</a>.</p>
481 <div class="fragment"><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;{</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keyword">const</span> float4 in_x_coords = (float4)(coord.s0, 1 + coord.s0, 2 + coord.s0, 3 + coord.s0);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">const</span> float4 new_x       = (in_x_coords + ((float4)(0.5f))) * (float4)(scale.s0) - (float4)(0.5f);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keyword">const</span> float4 new_y       = (float4)((coord.s1 + 0.5f) * scale.s1 - 0.5f);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keywordflow">return</span> (float8)(new_x.s0, new_y.s0, new_x.s1, new_y.s1, new_x.s2, new_y.s2, new_x.s3, new_y.s3);</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;}</div></div><!-- fragment -->
482 </div>
483 </div>
484 <a class="anchor" id="a55c710b814464d9b8982c4eb6ca04dee"></a>
485 <div class="memitem">
486 <div class="memproto">
487 <table class="mlabels">
488   <tr>
489   <td class="mlabels-left">
490       <table class="memname">
491         <tr>
492           <td class="memname">const float8 transform_nearest </td>
493           <td>(</td>
494           <td class="paramtype">const float2&#160;</td>
495           <td class="paramname"><em>coord</em>, </td>
496         </tr>
497         <tr>
498           <td class="paramkey"></td>
499           <td></td>
500           <td class="paramtype">const float2&#160;</td>
501           <td class="paramname"><em>scale</em>&#160;</td>
502         </tr>
503         <tr>
504           <td></td>
505           <td>)</td>
506           <td></td><td></td>
507         </tr>
508       </table>
509   </td>
510   <td class="mlabels-right">
511 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
512   </tr>
513 </table>
514 </div><div class="memdoc">
515
516 <p>Transforms four 2D coordinates. </p>
517 <p>This is used to map the output coordinates to the input coordinates.</p>
518 <dl class="params"><dt>Parameters</dt><dd>
519   <table class="params">
520     <tr><td class="paramdir">[in]</td><td class="paramname">coord</td><td>2D coordinates to transform. </td></tr>
521     <tr><td class="paramdir">[in]</td><td class="paramname">scale</td><td>input/output scale ratio</td></tr>
522   </table>
523   </dd>
524 </dl>
525 <dl class="section return"><dt>Returns</dt><dd>a float8 containing 4 2D transformed values in the input image. </dd></dl>
526
527 <p>Definition at line <a class="el" href="scale_8cl_source.xhtml#l00034">34</a> of file <a class="el" href="scale_8cl_source.xhtml">scale.cl</a>.</p>
528
529 <p>Referenced by <a class="el" href="scale_8cl_source.xhtml#l00076">scale_nearest_neighbour()</a>.</p>
530 <div class="fragment"><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;{</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="keyword">const</span> float4 in_x_coords = (float4)(coord.s0, 1 + coord.s0, 2 + coord.s0, 3 + coord.s0);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keyword">const</span> float4 new_x       = (in_x_coords + ((float4)(0.5f))) * (float4)(scale.s0);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keyword">const</span> float4 new_y       = (float4)((coord.s1 + 0.5f) * scale.s1);</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="keywordflow">return</span> (float8)(new_x.s0, new_y.s0, new_x.s1, new_y.s1, new_x.s2, new_y.s2, new_x.s3, new_y.s3);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;}</div></div><!-- fragment -->
531 </div>
532 </div>
533 </div><!-- contents -->
534 </div><!-- doc-content -->
535 <!-- start footer part -->
536 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
537   <ul>
538     <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_8c278f79c760e5c5fbd911f9870614c1.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_25885286e9dad4fa105b7b25a8031bbf.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="scale_8cl.xhtml">scale.cl</a></li>
539     <li class="footer">Generated on Fri Mar 24 2017 17:23:50 for ARM Compute Library by
540     <a href="http://www.doxygen.org/index.html">
541     <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
542   </ul>
543 </div>
544 </body>
545 </html>