arm_compute v17.05
[platform/upstream/armcl.git] / documentation / warp__affine_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/warp_affine.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.05</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('warp__affine_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">warp_affine.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="warp__affine_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:aecca3f284d1acabfa6d1bd8905dc036e"><td class="memItemLeft" align="right" valign="top">const float8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__affine_8cl.xhtml#aecca3f284d1acabfa6d1bd8905dc036e">build_affine_mtx</a> ()</td></tr>
129 <tr class="memdesc:aecca3f284d1acabfa6d1bd8905dc036e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a vector of floats contaning the matrix coefficients.  <a href="#aecca3f284d1acabfa6d1bd8905dc036e">More...</a><br /></td></tr>
130 <tr class="separator:aecca3f284d1acabfa6d1bd8905dc036e"><td class="memSeparator" colspan="2">&#160;</td></tr>
131 <tr class="memitem:a78e971ccef9598f9545f344d3a90a312"><td class="memItemLeft" align="right" valign="top">const float8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__affine_8cl.xhtml#a78e971ccef9598f9545f344d3a90a312">apply_affine_transform</a> (const float2 coord, const float8 mtx)</td></tr>
132 <tr class="memdesc:a78e971ccef9598f9545f344d3a90a312"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transforms 4 2D coordinates using the formula:  <a href="#a78e971ccef9598f9545f344d3a90a312">More...</a><br /></td></tr>
133 <tr class="separator:a78e971ccef9598f9545f344d3a90a312"><td class="memSeparator" colspan="2">&#160;</td></tr>
134 <tr class="memitem:a716ebd98bb81a3addb7f4d769e118dd9"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__affine_8cl.xhtml#a716ebd98bb81a3addb7f4d769e118dd9">warp_affine_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 int width, const int height)</td></tr>
135 <tr class="memdesc:a716ebd98bb81a3addb7f4d769e118dd9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs an affine transform on an image interpolating with the NEAREAST NEIGHBOUR method.  <a href="#a716ebd98bb81a3addb7f4d769e118dd9">More...</a><br /></td></tr>
136 <tr class="separator:a716ebd98bb81a3addb7f4d769e118dd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
137 <tr class="memitem:a4a77d9bbbc01353083729a076cedc38c"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__affine_8cl.xhtml#a4a77d9bbbc01353083729a076cedc38c">warp_affine_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 int width, const int height)</td></tr>
138 <tr class="memdesc:a4a77d9bbbc01353083729a076cedc38c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs an affine transform on an image interpolating with the BILINEAR method.  <a href="#a4a77d9bbbc01353083729a076cedc38c">More...</a><br /></td></tr>
139 <tr class="separator:a4a77d9bbbc01353083729a076cedc38c"><td class="memSeparator" colspan="2">&#160;</td></tr>
140 </table>
141 <h2 class="groupheader">Function Documentation</h2>
142 <a class="anchor" id="a78e971ccef9598f9545f344d3a90a312"></a>
143 <div class="memitem">
144 <div class="memproto">
145 <table class="mlabels">
146   <tr>
147   <td class="mlabels-left">
148       <table class="memname">
149         <tr>
150           <td class="memname">const float8 apply_affine_transform </td>
151           <td>(</td>
152           <td class="paramtype">const float2&#160;</td>
153           <td class="paramname"><em>coord</em>, </td>
154         </tr>
155         <tr>
156           <td class="paramkey"></td>
157           <td></td>
158           <td class="paramtype">const float8&#160;</td>
159           <td class="paramname"><em>mtx</em>&#160;</td>
160         </tr>
161         <tr>
162           <td></td>
163           <td>)</td>
164           <td></td><td></td>
165         </tr>
166       </table>
167   </td>
168   <td class="mlabels-right">
169 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
170   </tr>
171 </table>
172 </div><div class="memdoc">
173
174 <p>Transforms 4 2D coordinates using the formula: </p>
175 <p>x0 = M[1][1] * x + M[1][2] * y + M[1][3] y0 = M[2][1] * x + M[2][2] * y + M[2][3]</p>
176 <dl class="params"><dt>Parameters</dt><dd>
177   <table class="params">
178     <tr><td class="paramdir">[in]</td><td class="paramname">coord</td><td>2D coordinate to transform. </td></tr>
179     <tr><td class="paramdir">[in]</td><td class="paramname">mtx</td><td>affine matrix</td></tr>
180   </table>
181   </dd>
182 </dl>
183 <dl class="section return"><dt>Returns</dt><dd>a int8 containing 4 2D transformed values. </dd></dl>
184
185 <p>Definition at line <a class="el" href="warp__affine_8cl_source.xhtml#l00043">43</a> of file <a class="el" href="warp__affine_8cl_source.xhtml">warp_affine.cl</a>.</p>
186
187 <p>Referenced by <a class="el" href="warp__affine_8cl_source.xhtml#l00111">warp_affine_bilinear()</a>, and <a class="el" href="warp__affine_8cl_source.xhtml#l00079">warp_affine_nearest_neighbour()</a>.</p>
188 <div class="fragment"><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;{</div><div class="line"><a name="l00045"></a><span class="lineno">   45</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="l00046"></a><span class="lineno">   46</span>&#160;    <span class="comment">// transform [x,x+1,x+2,x+3]</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keyword">const</span> float4 new_x = mad(<span class="comment">/*A*/</span> in_x_coords, (float4)(mtx.s0) <span class="comment">/*B*/</span>, mad((float4)(coord.s1), (float4)(mtx.s2), (float4)(mtx.s4)));</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="comment">// transform [y,y+1,y+2,y+3]</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keyword">const</span> float4 new_y = mad(in_x_coords, (float4)(mtx.s1), mad((float4)(coord.s1), (float4)(mtx.s3), (float4)(mtx.s5)));</div><div class="line"><a name="l00050"></a><span class="lineno">   50</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="l00051"></a><span class="lineno">   51</span>&#160;}</div></div><!-- fragment -->
189 </div>
190 </div>
191 <a class="anchor" id="aecca3f284d1acabfa6d1bd8905dc036e"></a>
192 <div class="memitem">
193 <div class="memproto">
194 <table class="mlabels">
195   <tr>
196   <td class="mlabels-left">
197       <table class="memname">
198         <tr>
199           <td class="memname">const float8 build_affine_mtx </td>
200           <td>(</td>
201           <td class="paramname"></td><td>)</td>
202           <td></td>
203         </tr>
204       </table>
205   </td>
206   <td class="mlabels-right">
207 <span class="mlabels"><span class="mlabel">inline</span></span>  </td>
208   </tr>
209 </table>
210 </div><div class="memdoc">
211
212 <p>Returns a vector of floats contaning the matrix coefficients. </p>
213
214 <p>Definition at line <a class="el" href="warp__affine_8cl_source.xhtml#l00028">28</a> of file <a class="el" href="warp__affine_8cl_source.xhtml">warp_affine.cl</a>.</p>
215
216 <p>Referenced by <a class="el" href="warp__affine_8cl_source.xhtml#l00111">warp_affine_bilinear()</a>, and <a class="el" href="warp__affine_8cl_source.xhtml#l00079">warp_affine_nearest_neighbour()</a>.</p>
217 <div class="fragment"><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;{</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <span class="keywordflow">return</span> (float8)(MAT0, MAT1, MAT2, MAT3, MAT4, MAT5, 0, 0);</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;}</div></div><!-- fragment -->
218 </div>
219 </div>
220 <a class="anchor" id="a4a77d9bbbc01353083729a076cedc38c"></a>
221 <div class="memitem">
222 <div class="memproto">
223       <table class="memname">
224         <tr>
225           <td class="memname">__kernel void warp_affine_bilinear </td>
226           <td>(</td>
227           <td class="paramtype">__global uchar *&#160;</td>
228           <td class="paramname"><em>in_ptr</em>, </td>
229         </tr>
230         <tr>
231           <td class="paramkey"></td>
232           <td></td>
233           <td class="paramtype">uint&#160;</td>
234           <td class="paramname"><em>in_stride_x</em>, </td>
235         </tr>
236         <tr>
237           <td class="paramkey"></td>
238           <td></td>
239           <td class="paramtype">uint&#160;</td>
240           <td class="paramname"><em>in_step_x</em>, </td>
241         </tr>
242         <tr>
243           <td class="paramkey"></td>
244           <td></td>
245           <td class="paramtype">uint&#160;</td>
246           <td class="paramname"><em>in_stride_y</em>, </td>
247         </tr>
248         <tr>
249           <td class="paramkey"></td>
250           <td></td>
251           <td class="paramtype">uint&#160;</td>
252           <td class="paramname"><em>in_step_y</em>, </td>
253         </tr>
254         <tr>
255           <td class="paramkey"></td>
256           <td></td>
257           <td class="paramtype">uint&#160;</td>
258           <td class="paramname"><em>in_offset_first_element_in_bytes</em>, </td>
259         </tr>
260         <tr>
261           <td class="paramkey"></td>
262           <td></td>
263           <td class="paramtype">__global uchar *&#160;</td>
264           <td class="paramname"><em>out_ptr</em>, </td>
265         </tr>
266         <tr>
267           <td class="paramkey"></td>
268           <td></td>
269           <td class="paramtype">uint&#160;</td>
270           <td class="paramname"><em>out_stride_x</em>, </td>
271         </tr>
272         <tr>
273           <td class="paramkey"></td>
274           <td></td>
275           <td class="paramtype">uint&#160;</td>
276           <td class="paramname"><em>out_step_x</em>, </td>
277         </tr>
278         <tr>
279           <td class="paramkey"></td>
280           <td></td>
281           <td class="paramtype">uint&#160;</td>
282           <td class="paramname"><em>out_stride_y</em>, </td>
283         </tr>
284         <tr>
285           <td class="paramkey"></td>
286           <td></td>
287           <td class="paramtype">uint&#160;</td>
288           <td class="paramname"><em>out_step_y</em>, </td>
289         </tr>
290         <tr>
291           <td class="paramkey"></td>
292           <td></td>
293           <td class="paramtype">uint&#160;</td>
294           <td class="paramname"><em>out_offset_first_element_in_bytes</em>, </td>
295         </tr>
296         <tr>
297           <td class="paramkey"></td>
298           <td></td>
299           <td class="paramtype">const int&#160;</td>
300           <td class="paramname"><em>width</em>, </td>
301         </tr>
302         <tr>
303           <td class="paramkey"></td>
304           <td></td>
305           <td class="paramtype">const int&#160;</td>
306           <td class="paramname"><em>height</em>&#160;</td>
307         </tr>
308         <tr>
309           <td></td>
310           <td>)</td>
311           <td></td><td></td>
312         </tr>
313       </table>
314 </div><div class="memdoc">
315
316 <p>Performs an affine transform on an image interpolating with the BILINEAR method. </p>
317 <p>Input and output are single channel U8.</p>
318 <dl class="section attention"><dt>Attention</dt><dd>The matrix coefficients need to be passed at compile time:<br />
319 const char build_options [] = "-DMAT0=1 -DMAT1=2 -DMAT2=1 -DMAT3=2 -DMAT4=4 -DMAT5=2 "<br />
320 clBuildProgram( program, 0, NULL, build_options, NULL, NULL);</dd></dl>
321 <dl class="params"><dt>Parameters</dt><dd>
322   <table class="params">
323     <tr><td class="paramdir">[in]</td><td class="paramname">in_ptr</td><td>Pointer to the source image. Supported data types: U8. </td></tr>
324     <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>
325     <tr><td class="paramdir">[in]</td><td class="paramname">in_step_x</td><td>in_stride_x * number of elements along X processed per work item (in bytes) </td></tr>
326     <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>
327     <tr><td class="paramdir">[in]</td><td class="paramname">in_step_y</td><td>in_stride_y * number of elements along Y processed per work item (in bytes) </td></tr>
328     <tr><td class="paramdir">[in]</td><td class="paramname">in_offset_first_element_in_bytes</td><td>Offset of the first element in the source image </td></tr>
329     <tr><td class="paramdir">[out]</td><td class="paramname">out_ptr</td><td>Pointer to the destination image. Supported data types: U8. </td></tr>
330     <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>
331     <tr><td class="paramdir">[in]</td><td class="paramname">out_step_x</td><td>out_stride_x * number of elements along X processed per work item (in bytes) </td></tr>
332     <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>
333     <tr><td class="paramdir">[in]</td><td class="paramname">out_step_y</td><td>out_stride_y * number of elements along Y processed per work item (in bytes) </td></tr>
334     <tr><td class="paramdir">[in]</td><td class="paramname">out_offset_first_element_in_bytes</td><td>Offset of the first element in the destination image </td></tr>
335     <tr><td class="paramdir">[in]</td><td class="paramname">width</td><td>Width of the destination image </td></tr>
336     <tr><td class="paramdir">[in]</td><td class="paramname">height</td><td>Height of the destination image </td></tr>
337   </table>
338   </dd>
339 </dl>
340
341 <p>Definition at line <a class="el" href="warp__affine_8cl_source.xhtml#l00111">111</a> of file <a class="el" href="warp__affine_8cl_source.xhtml">warp_affine.cl</a>.</p>
342
343 <p>References <a class="el" href="warp__affine_8cl_source.xhtml#l00043">apply_affine_transform()</a>, <a class="el" href="warp__helpers_8h_source.xhtml#l00080">bilinear_interpolate()</a>, <a class="el" href="warp__affine_8cl_source.xhtml#l00028">build_affine_mtx()</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="warp__helpers_8h_source.xhtml#l00054">get_current_coords()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p>
344 <div class="fragment"><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;{</div><div class="line"><a name="l00117"></a><span class="lineno">  117</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="l00118"></a><span class="lineno">  118</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="l00119"></a><span class="lineno">  119</span>&#160;    vstore4(<a class="code" href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a>(&amp;in, <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__affine_8cl.xhtml#a78e971ccef9598f9545f344d3a90a312">apply_affine_transform</a>(<a class="code" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a>(), <a class="code" href="warp__affine_8cl.xhtml#aecca3f284d1acabfa6d1bd8905dc036e">build_affine_mtx</a>()), width, height), width, height), 0, out.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</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>
345 <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>
346 <div class="ttc" id="warp__affine_8cl_xhtml_aecca3f284d1acabfa6d1bd8905dc036e"><div class="ttname"><a href="warp__affine_8cl.xhtml#aecca3f284d1acabfa6d1bd8905dc036e">build_affine_mtx</a></div><div class="ttdeci">const float8 build_affine_mtx()</div><div class="ttdoc">Returns a vector of floats contaning the matrix coefficients. </div><div class="ttdef"><b>Definition:</b> <a href="warp__affine_8cl_source.xhtml#l00028">warp_affine.cl:28</a></div></div>
347 <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>
348 <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>
349 <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>
350 <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>
351 <div class="ttc" id="warp__affine_8cl_xhtml_a78e971ccef9598f9545f344d3a90a312"><div class="ttname"><a href="warp__affine_8cl.xhtml#a78e971ccef9598f9545f344d3a90a312">apply_affine_transform</a></div><div class="ttdeci">const float8 apply_affine_transform(const float2 coord, const float8 mtx)</div><div class="ttdoc">Transforms 4 2D coordinates using the formula: </div><div class="ttdef"><b>Definition:</b> <a href="warp__affine_8cl_source.xhtml#l00043">warp_affine.cl:43</a></div></div>
352 <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>
353 </div><!-- fragment -->
354 </div>
355 </div>
356 <a class="anchor" id="a716ebd98bb81a3addb7f4d769e118dd9"></a>
357 <div class="memitem">
358 <div class="memproto">
359       <table class="memname">
360         <tr>
361           <td class="memname">__kernel void warp_affine_nearest_neighbour </td>
362           <td>(</td>
363           <td class="paramtype">__global uchar *&#160;</td>
364           <td class="paramname"><em>in_ptr</em>, </td>
365         </tr>
366         <tr>
367           <td class="paramkey"></td>
368           <td></td>
369           <td class="paramtype">uint&#160;</td>
370           <td class="paramname"><em>in_stride_x</em>, </td>
371         </tr>
372         <tr>
373           <td class="paramkey"></td>
374           <td></td>
375           <td class="paramtype">uint&#160;</td>
376           <td class="paramname"><em>in_step_x</em>, </td>
377         </tr>
378         <tr>
379           <td class="paramkey"></td>
380           <td></td>
381           <td class="paramtype">uint&#160;</td>
382           <td class="paramname"><em>in_stride_y</em>, </td>
383         </tr>
384         <tr>
385           <td class="paramkey"></td>
386           <td></td>
387           <td class="paramtype">uint&#160;</td>
388           <td class="paramname"><em>in_step_y</em>, </td>
389         </tr>
390         <tr>
391           <td class="paramkey"></td>
392           <td></td>
393           <td class="paramtype">uint&#160;</td>
394           <td class="paramname"><em>in_offset_first_element_in_bytes</em>, </td>
395         </tr>
396         <tr>
397           <td class="paramkey"></td>
398           <td></td>
399           <td class="paramtype">__global uchar *&#160;</td>
400           <td class="paramname"><em>out_ptr</em>, </td>
401         </tr>
402         <tr>
403           <td class="paramkey"></td>
404           <td></td>
405           <td class="paramtype">uint&#160;</td>
406           <td class="paramname"><em>out_stride_x</em>, </td>
407         </tr>
408         <tr>
409           <td class="paramkey"></td>
410           <td></td>
411           <td class="paramtype">uint&#160;</td>
412           <td class="paramname"><em>out_step_x</em>, </td>
413         </tr>
414         <tr>
415           <td class="paramkey"></td>
416           <td></td>
417           <td class="paramtype">uint&#160;</td>
418           <td class="paramname"><em>out_stride_y</em>, </td>
419         </tr>
420         <tr>
421           <td class="paramkey"></td>
422           <td></td>
423           <td class="paramtype">uint&#160;</td>
424           <td class="paramname"><em>out_step_y</em>, </td>
425         </tr>
426         <tr>
427           <td class="paramkey"></td>
428           <td></td>
429           <td class="paramtype">uint&#160;</td>
430           <td class="paramname"><em>out_offset_first_element_in_bytes</em>, </td>
431         </tr>
432         <tr>
433           <td class="paramkey"></td>
434           <td></td>
435           <td class="paramtype">const int&#160;</td>
436           <td class="paramname"><em>width</em>, </td>
437         </tr>
438         <tr>
439           <td class="paramkey"></td>
440           <td></td>
441           <td class="paramtype">const int&#160;</td>
442           <td class="paramname"><em>height</em>&#160;</td>
443         </tr>
444         <tr>
445           <td></td>
446           <td>)</td>
447           <td></td><td></td>
448         </tr>
449       </table>
450 </div><div class="memdoc">
451
452 <p>Performs an affine transform on an image interpolating with the NEAREAST NEIGHBOUR method. </p>
453 <p>Input and output are single channel U8.</p>
454 <p>This kernel performs an affine transform with a 2x3 Matrix M with this method of pixel coordinate translation: x0 = M[1][1] * x + M[1][2] * y + M[1][3] y0 = M[2][1] * x + M[2][2] * y + M[2][3] output(x,y) = input(x0,y0)</p>
455 <dl class="section attention"><dt>Attention</dt><dd>The matrix coefficients need to be passed at compile time:<br />
456 const char build_options [] = "-DMAT0=1 -DMAT1=2 -DMAT2=1 -DMAT3=2 -DMAT4=4 -DMAT5=2 "<br />
457 clBuildProgram( program, 0, NULL, build_options, NULL, NULL);</dd></dl>
458 <dl class="params"><dt>Parameters</dt><dd>
459   <table class="params">
460     <tr><td class="paramdir">[in]</td><td class="paramname">in_ptr</td><td>Pointer to the source image. Supported data types: U8. </td></tr>
461     <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>
462     <tr><td class="paramdir">[in]</td><td class="paramname">in_step_x</td><td>in_stride_x * number of elements along X processed per work item (in bytes) </td></tr>
463     <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>
464     <tr><td class="paramdir">[in]</td><td class="paramname">in_step_y</td><td>in_stride_y * number of elements along Y processed per work item (in bytes) </td></tr>
465     <tr><td class="paramdir">[in]</td><td class="paramname">in_offset_first_element_in_bytes</td><td>Offset of the first element in the source image </td></tr>
466     <tr><td class="paramdir">[out]</td><td class="paramname">out_ptr</td><td>Pointer to the destination image. Supported data types: U8. </td></tr>
467     <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>
468     <tr><td class="paramdir">[in]</td><td class="paramname">out_step_x</td><td>out_stride_x * number of elements along X processed per work item (in bytes) </td></tr>
469     <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>
470     <tr><td class="paramdir">[in]</td><td class="paramname">out_step_y</td><td>out_stride_y * number of elements along Y processed per work item (in bytes) </td></tr>
471     <tr><td class="paramdir">[in]</td><td class="paramname">out_offset_first_element_in_bytes</td><td>Offset of the first element in the destination image </td></tr>
472     <tr><td class="paramdir">[in]</td><td class="paramname">width</td><td>Width of the destination image </td></tr>
473     <tr><td class="paramdir">[in]</td><td class="paramname">height</td><td>Height of the destination image </td></tr>
474   </table>
475   </dd>
476 </dl>
477
478 <p>Definition at line <a class="el" href="warp__affine_8cl_source.xhtml#l00079">79</a> of file <a class="el" href="warp__affine_8cl_source.xhtml">warp_affine.cl</a>.</p>
479
480 <p>References <a class="el" href="warp__affine_8cl_source.xhtml#l00043">apply_affine_transform()</a>, <a class="el" href="warp__affine_8cl_source.xhtml#l00028">build_affine_mtx()</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="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="warp__helpers_8h_source.xhtml#l00045">read_texels4()</a>.</p>
481 <div class="fragment"><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;{</div><div class="line"><a name="l00085"></a><span class="lineno">   85</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="l00086"></a><span class="lineno">   86</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="l00087"></a><span class="lineno">   87</span>&#160;    vstore4(<a class="code" href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a>(&amp;in, convert_int8(<a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__affine_8cl.xhtml#a78e971ccef9598f9545f344d3a90a312">apply_affine_transform</a>(<a class="code" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a>(), <a class="code" href="warp__affine_8cl.xhtml#aecca3f284d1acabfa6d1bd8905dc036e">build_affine_mtx</a>()), width, height))), 0, out.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00088"></a><span class="lineno">   88</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>
482 <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>
483 <div class="ttc" id="warp__affine_8cl_xhtml_aecca3f284d1acabfa6d1bd8905dc036e"><div class="ttname"><a href="warp__affine_8cl.xhtml#aecca3f284d1acabfa6d1bd8905dc036e">build_affine_mtx</a></div><div class="ttdeci">const float8 build_affine_mtx()</div><div class="ttdoc">Returns a vector of floats contaning the matrix coefficients. </div><div class="ttdef"><b>Definition:</b> <a href="warp__affine_8cl_source.xhtml#l00028">warp_affine.cl:28</a></div></div>
484 <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>
485 <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>
486 <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>
487 <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>
488 <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>
489 <div class="ttc" id="warp__affine_8cl_xhtml_a78e971ccef9598f9545f344d3a90a312"><div class="ttname"><a href="warp__affine_8cl.xhtml#a78e971ccef9598f9545f344d3a90a312">apply_affine_transform</a></div><div class="ttdeci">const float8 apply_affine_transform(const float2 coord, const float8 mtx)</div><div class="ttdoc">Transforms 4 2D coordinates using the formula: </div><div class="ttdef"><b>Definition:</b> <a href="warp__affine_8cl_source.xhtml#l00043">warp_affine.cl:43</a></div></div>
490 </div><!-- fragment -->
491 </div>
492 </div>
493 </div><!-- contents -->
494 </div><!-- doc-content -->
495 <!-- start footer part -->
496 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
497   <ul>
498     <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="warp__affine_8cl.xhtml">warp_affine.cl</a></li>
499     <li class="footer">Generated on Wed May 3 2017 17:20:04 for ARM Compute Library by
500     <a href="http://www.doxygen.org/index.html">
501     <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
502   </ul>
503 </div>
504 </body>
505 </html>