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">
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);
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(); });
27 <script type="text/x-mathjax-config">
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
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" />
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
38 <table cellspacing="0" cellpadding="0">
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
42 <div id="projectname">ARM Compute Library
43  <span id="projectnumber">17.04</span>
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');
55 <div id="navrow1" class="tabs">
57 <li><a href="index.xhtml"><span>Main Page</span></a></li>
58 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
59 <li><a href="annotated.xhtml"><span>Data Structures</span></a></li>
60 <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
62 <div id="MSearchBox" class="MSearchBoxInactive">
64 <img id="MSearchSelect" src="search/mag_sel.png"
65 onmouseover="return searchBox.OnSearchSelectShow()"
66 onmouseout="return searchBox.OnSearchSelectHide()"
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>
79 <div id="navrow2" class="tabs2">
81 <li><a href="files.xhtml"><span>File List</span></a></li>
82 <li><a href="globals.xhtml"><span>Globals</span></a></li>
86 <div id="side-nav" class="ui-resizable side-nav-resizable">
88 <div id="nav-tree-contents">
89 <div id="nav-sync" class="sync"></div>
92 <div id="splitbar" style="-moz-user-select:none;"
93 class="ui-resizable-handle">
96 <script type="text/javascript">
97 $(document).ready(function(){initNavTree('scale_8cl.xhtml','');});
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)">
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">
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>
120 <div class="contents">
121 <div class="textblock"><code>#include "<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>"</code><br />
122 <code>#include "<a class="el" href="warp__helpers_8h_source.xhtml">warp_helpers.h</a>"</code><br />
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 </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"> </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"> </td></tr>
131 <tr class="memitem:a1990e87858b15b8fce3f63965fb9b86c"><td class="memItemLeft" align="right" valign="top">const float8 </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"> </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"> </td></tr>
134 <tr class="memitem:aec1496e8c3bdb3630f92433b1820e713"><td class="memItemLeft" align="right" valign="top">__kernel void </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"> </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"> </td></tr>
137 <tr class="memitem:a8d3a406833cc2a6e4eb51a43d5dcdc84"><td class="memItemLeft" align="right" valign="top">__kernel void </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"> </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"> </td></tr>
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">
147 <td class="memname">__kernel void scale_bilinear </td>
149 <td class="paramtype">__global uchar * </td>
150 <td class="paramname"><em>in_ptr</em>, </td>
153 <td class="paramkey"></td>
155 <td class="paramtype">uint </td>
156 <td class="paramname"><em>in_stride_x</em>, </td>
159 <td class="paramkey"></td>
161 <td class="paramtype">uint </td>
162 <td class="paramname"><em>in_step_x</em>, </td>
165 <td class="paramkey"></td>
167 <td class="paramtype">uint </td>
168 <td class="paramname"><em>in_stride_y</em>, </td>
171 <td class="paramkey"></td>
173 <td class="paramtype">uint </td>
174 <td class="paramname"><em>in_step_y</em>, </td>
177 <td class="paramkey"></td>
179 <td class="paramtype">uint </td>
180 <td class="paramname"><em>in_offset_first_element_in_bytes</em>, </td>
183 <td class="paramkey"></td>
185 <td class="paramtype">__global uchar * </td>
186 <td class="paramname"><em>out_ptr</em>, </td>
189 <td class="paramkey"></td>
191 <td class="paramtype">uint </td>
192 <td class="paramname"><em>out_stride_x</em>, </td>
195 <td class="paramkey"></td>
197 <td class="paramtype">uint </td>
198 <td class="paramname"><em>out_step_x</em>, </td>
201 <td class="paramkey"></td>
203 <td class="paramtype">uint </td>
204 <td class="paramname"><em>out_stride_y</em>, </td>
207 <td class="paramkey"></td>
209 <td class="paramtype">uint </td>
210 <td class="paramname"><em>out_step_y</em>, </td>
213 <td class="paramkey"></td>
215 <td class="paramtype">uint </td>
216 <td class="paramname"><em>out_offset_first_element_in_bytes</em>, </td>
219 <td class="paramkey"></td>
221 <td class="paramtype">const float </td>
222 <td class="paramname"><em>input_width</em>, </td>
225 <td class="paramkey"></td>
227 <td class="paramtype">const float </td>
228 <td class="paramname"><em>input_height</em>, </td>
231 <td class="paramkey"></td>
233 <td class="paramtype">const float </td>
234 <td class="paramname"><em>output_width</em>, </td>
237 <td class="paramkey"></td>
239 <td class="paramtype">const float </td>
240 <td class="paramname"><em>output_height</em> </td>
248 </div><div class="memdoc">
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>
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>
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> {</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <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>  <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>  <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>  <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>  vstore4(<a class="code" href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a>(&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> }</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 -->
288 <a class="anchor" id="aec1496e8c3bdb3630f92433b1820e713"></a>
289 <div class="memitem">
290 <div class="memproto">
291 <table class="memname">
293 <td class="memname">__kernel void scale_nearest_neighbour </td>
295 <td class="paramtype">__global uchar * </td>
296 <td class="paramname"><em>in_ptr</em>, </td>
299 <td class="paramkey"></td>
301 <td class="paramtype">uint </td>
302 <td class="paramname"><em>in_stride_x</em>, </td>
305 <td class="paramkey"></td>
307 <td class="paramtype">uint </td>
308 <td class="paramname"><em>in_step_x</em>, </td>
311 <td class="paramkey"></td>
313 <td class="paramtype">uint </td>
314 <td class="paramname"><em>in_stride_y</em>, </td>
317 <td class="paramkey"></td>
319 <td class="paramtype">uint </td>
320 <td class="paramname"><em>in_step_y</em>, </td>
323 <td class="paramkey"></td>
325 <td class="paramtype">uint </td>
326 <td class="paramname"><em>in_offset_first_element_in_bytes</em>, </td>
329 <td class="paramkey"></td>
331 <td class="paramtype">__global uchar * </td>
332 <td class="paramname"><em>out_ptr</em>, </td>
335 <td class="paramkey"></td>
337 <td class="paramtype">uint </td>
338 <td class="paramname"><em>out_stride_x</em>, </td>
341 <td class="paramkey"></td>
343 <td class="paramtype">uint </td>
344 <td class="paramname"><em>out_step_x</em>, </td>
347 <td class="paramkey"></td>
349 <td class="paramtype">uint </td>
350 <td class="paramname"><em>out_stride_y</em>, </td>
353 <td class="paramkey"></td>
355 <td class="paramtype">uint </td>
356 <td class="paramname"><em>out_step_y</em>, </td>
359 <td class="paramkey"></td>
361 <td class="paramtype">uint </td>
362 <td class="paramname"><em>out_offset_first_element_in_bytes</em>, </td>
365 <td class="paramkey"></td>
367 <td class="paramtype">const float </td>
368 <td class="paramname"><em>input_width</em>, </td>
371 <td class="paramkey"></td>
373 <td class="paramtype">const float </td>
374 <td class="paramname"><em>input_height</em>, </td>
377 <td class="paramkey"></td>
379 <td class="paramtype">const float </td>
380 <td class="paramname"><em>output_width</em>, </td>
383 <td class="paramkey"></td>
385 <td class="paramtype">const float </td>
386 <td class="paramname"><em>output_height</em> </td>
394 </div><div class="memdoc">
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>
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>
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> {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <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>  <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>  <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>  <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>  vstore4(<a class="code" href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a>(&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> }</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 -->
435 <a class="anchor" id="a1990e87858b15b8fce3f63965fb9b86c"></a>
436 <div class="memitem">
437 <div class="memproto">
438 <table class="mlabels">
440 <td class="mlabels-left">
441 <table class="memname">
443 <td class="memname">const float8 transform_bilinear </td>
445 <td class="paramtype">const float2 </td>
446 <td class="paramname"><em>coord</em>, </td>
449 <td class="paramkey"></td>
451 <td class="paramtype">const float2 </td>
452 <td class="paramname"><em>scale</em> </td>
461 <td class="mlabels-right">
462 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
465 </div><div class="memdoc">
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>
476 <dl class="section return"><dt>Returns</dt><dd>a float8 containing 4 2D transformed values in the input image. </dd></dl>
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>
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> {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <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>  <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>  <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>  <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> }</div></div><!-- fragment -->
484 <a class="anchor" id="a55c710b814464d9b8982c4eb6ca04dee"></a>
485 <div class="memitem">
486 <div class="memproto">
487 <table class="mlabels">
489 <td class="mlabels-left">
490 <table class="memname">
492 <td class="memname">const float8 transform_nearest </td>
494 <td class="paramtype">const float2 </td>
495 <td class="paramname"><em>coord</em>, </td>
498 <td class="paramkey"></td>
500 <td class="paramtype">const float2 </td>
501 <td class="paramname"><em>scale</em> </td>
510 <td class="mlabels-right">
511 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
514 </div><div class="memdoc">
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>
525 <dl class="section return"><dt>Returns</dt><dd>a float8 containing 4 2D transformed values in the input image. </dd></dl>
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>
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> {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <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>  <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>  <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>  <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> }</div></div><!-- fragment -->
533 </div><!-- contents -->
534 </div><!-- doc-content -->
535 <!-- start footer part -->
536 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
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 Wed Apr 12 2017 14:26:05 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>