blob: ed9b47faa297e22eecdbe603a95cbdbce3c56d99 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>Compute Library: src/core/CL/cl_kernels/warp_helpers.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Compute Library
&#160;<span id="projectnumber">v17.06</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
<li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
<li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="files.xhtml"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.xhtml"><span>File&#160;List</span></a></li>
<li><a href="globals.xhtml"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('warp__helpers_8h.xhtml','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">warp_helpers.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>&quot;</code><br />
</div>
<p><a href="warp__helpers_8h_source.xhtml">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:adbdf2ca9e8fe0b67f9359929ef743126"><td class="memItemLeft" align="right" valign="top">const float8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a> (float8 coords, const float width, const float height)</td></tr>
<tr class="memdesc:adbdf2ca9e8fe0b67f9359929ef743126"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clamps the given coordinates to the borders. <a href="#adbdf2ca9e8fe0b67f9359929ef743126">More...</a><br /></td></tr>
<tr class="separator:adbdf2ca9e8fe0b67f9359929ef743126"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba42442a4c991cdbb52727fa370676f1"><td class="memItemLeft" align="right" valign="top">const DATA_TYPE4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a> (const <a class="el" href="struct_image.xhtml">Image</a> *in, const int8 coords)</td></tr>
<tr class="memdesc:aba42442a4c991cdbb52727fa370676f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads four texels from the input image. <a href="#aba42442a4c991cdbb52727fa370676f1">More...</a><br /></td></tr>
<tr class="separator:aba42442a4c991cdbb52727fa370676f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4caaeeb51ea58015267a9974675226d1"><td class="memItemLeft" align="right" valign="top">const float2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a> ()</td></tr>
<tr class="memdesc:a4caaeeb51ea58015267a9974675226d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current thread coordinates. <a href="#a4caaeeb51ea58015267a9974675226d1">More...</a><br /></td></tr>
<tr class="separator:a4caaeeb51ea58015267a9974675226d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d8047717d6464cad02c5979d09576db"><td class="memItemLeft" align="right" valign="top">const float8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a> (const float2 coord)</td></tr>
<tr class="memdesc:a2d8047717d6464cad02c5979d09576db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given a texel coordinates this function will return the following array of coordinates: [ P, right neighbour, below neighbour, below right neighbour ]. <a href="#a2d8047717d6464cad02c5979d09576db">More...</a><br /></td></tr>
<tr class="separator:a2d8047717d6464cad02c5979d09576db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abea9f226daf3e0ad741d03cf7417d353"><td class="memItemLeft" align="right" valign="top">const DATA_TYPE4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a> (const <a class="el" href="struct_image.xhtml">Image</a> *in, const float8 coords, const float width, const float height)</td></tr>
<tr class="memdesc:abea9f226daf3e0ad741d03cf7417d353"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the values. <a href="#abea9f226daf3e0ad741d03cf7417d353">More...</a><br /></td></tr>
<tr class="separator:abea9f226daf3e0ad741d03cf7417d353"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="abea9f226daf3e0ad741d03cf7417d353"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const DATA_TYPE4 bilinear_interpolate </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="struct_image.xhtml">Image</a> *&#160;</td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float8&#160;</td>
<td class="paramname"><em>coords</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>height</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the values. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>Pointer to the source image. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">coords</td><td><a class="el" href="struct_vector.xhtml" title="Structure to hold Vector information. ">Vector</a> of four 2D coordinates. Even pos is x and odd y. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">width</td><td>Width of the image </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">height</td><td>Height of the image </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="warp__helpers_8h_source.xhtml#l00080">80</a> of file <a class="el" href="warp__helpers_8h_source.xhtml">warp_helpers.h</a>.</p>
<p>References <a class="el" href="warp__helpers_8h_source.xhtml#l00033">clamp_to_border()</a>, <a class="el" href="helpers_8h_source.xhtml#l00035">CONVERT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="warp__helpers_8h_source.xhtml#l00068">get_neighbour_coords()</a>, <a class="el" href="helpers_8h_source.xhtml#l00201">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00032">VEC_DATA_TYPE</a>.</p>
<p>Referenced by <a class="el" href="remap_8cl_source.xhtml#l00113">remap_bilinear()</a>, <a class="el" href="scale_8cl_source.xhtml#l00110">scale_bilinear()</a>, <a class="el" href="warp__affine_8cl_source.xhtml#l00111">warp_affine_bilinear()</a>, and <a class="el" href="warp__perspective_8cl_source.xhtml#l00119">warp_perspective_bilinear()</a>.</p>
<div class="fragment"><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;{</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="comment">// If any of the 4 texels is out of the image&#39;s boundaries we use the border value (REPLICATE or CONSTANT) for any texel out of the image.</span></div><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; <span class="comment">// Sets the 4x4 coordinates for each of the four input texels</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keyword">const</span> float8 fc = floor(coords);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keyword">const</span> float16 c1 = (float16)(</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s0, fc.s1)), width, height),</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s2, fc.s3)), width, height));</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keyword">const</span> float16 c2 = (float16)(</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s4, fc.s5)), width, height),</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s6, fc.s7)), width, height));</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// Loads the values from the input image</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">const</span> float16 t = (float16)(</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="comment">/* tl, tr, bl, br */</span></div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; * ((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s0, c1.s1)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s2, c1.s3)),</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s4, c1.s5)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s6, c1.s7)),</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s8, c1.s9)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.sa, c1.sb)),</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.sc, c1.sd)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.se, c1.sf)),</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s0, c2.s1)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s2, c2.s3)),</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s4, c2.s5)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s6, c2.s7)),</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s8, c2.s9)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.sa, c2.sb)),</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.sc, c2.sd)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.se, c2.sf)));</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keyword">const</span> float8 a = coords - fc;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keyword">const</span> float8 b = ((float8)(1.f)) - a;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keyword">const</span> float4 fr = (float4)(</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; ((t.s0 * b.s0 * b.s1) + (t.s1 * a.s0 * b.s1) + (t.s2 * b.s0 * a.s1) + (t.s3 * a.s0 * a.s1)),</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; ((t.s4 * b.s2 * b.s3) + (t.s5 * a.s2 * b.s3) + (t.s6 * b.s2 * a.s3) + (t.s7 * a.s2 * a.s3)),</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; ((t.s8 * b.s4 * b.s5) + (t.s9 * a.s4 * b.s5) + (t.sa * b.s4 * a.s5) + (t.sb * a.s4 * a.s5)),</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; ((t.sc * b.s6 * b.s7) + (t.sd * a.s6 * b.s7) + (t.se * b.s6 * a.s7) + (t.sf * a.s6 * a.s7)));</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordflow">return</span> <a class="code" href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a>(fr, <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4));</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</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>
<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>
<div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00201">helpers.h:201</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a></div><div class="ttdeci">#define VEC_DATA_TYPE(type, size)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00032">helpers.h:32</a></div></div>
<div class="ttc" id="warp__helpers_8h_xhtml_a2d8047717d6464cad02c5979d09576db"><div class="ttname"><a href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a></div><div class="ttdeci">const float8 get_neighbour_coords(const float2 coord)</div><div class="ttdoc">Given a texel coordinates this function will return the following array of coordinates: [ P...</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00068">warp_helpers.h:68</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_aa8d95ba04fc73845abc6045952cae5be"><div class="ttname"><a href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a></div><div class="ttdeci">#define CONVERT(x, type)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00035">helpers.h:35</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="adbdf2ca9e8fe0b67f9359929ef743126"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const float8 clamp_to_border </td>
<td>(</td>
<td class="paramtype">float8&#160;</td>
<td class="paramname"><em>coords</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>height</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Clamps the given coordinates to the borders. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">coords</td><td><a class="el" href="struct_vector.xhtml" title="Structure to hold Vector information. ">Vector</a> of 2D coordinates to clamp. Even positions are X coords, odd positions are Y coords. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">width</td><td>Width of the image </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">height</td><td>Height of the image </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="warp__helpers_8h_source.xhtml#l00033">33</a> of file <a class="el" href="warp__helpers_8h_source.xhtml">warp_helpers.h</a>.</p>
<p>References <a class="el" href="arm__compute_2core_2_helpers_8h_source.xhtml#l00193">arm_compute::clamp()</a>.</p>
<p>Referenced by <a class="el" href="warp__helpers_8h_source.xhtml#l00080">bilinear_interpolate()</a>, <a class="el" href="remap_8cl_source.xhtml#l00113">remap_bilinear()</a>, <a class="el" href="remap_8cl_source.xhtml#l00059">remap_nearest_neighbour()</a>, <a class="el" href="scale_8cl_source.xhtml#l00110">scale_bilinear()</a>, <a class="el" href="scale_8cl_source.xhtml#l00076">scale_nearest_neighbour()</a>, <a class="el" href="warp__affine_8cl_source.xhtml#l00111">warp_affine_bilinear()</a>, <a class="el" href="warp__affine_8cl_source.xhtml#l00079">warp_affine_nearest_neighbour()</a>, <a class="el" href="warp__perspective_8cl_source.xhtml#l00119">warp_perspective_bilinear()</a>, and <a class="el" href="warp__perspective_8cl_source.xhtml#l00087">warp_perspective_nearest_neighbour()</a>.</p>
<div class="fragment"><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;{</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keyword">const</span> float4 clamped_x = <a class="code" href="namespacearm__compute.xhtml#a1c0b9414fe3a6ef6a7a23bd324ae9e67">clamp</a>(coords.even, -1.0f, width);</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keyword">const</span> float4 clamped_y = <a class="code" href="namespacearm__compute.xhtml#a1c0b9414fe3a6ef6a7a23bd324ae9e67">clamp</a>(coords.odd, -1.0f, height);</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keywordflow">return</span> (float8)(clamped_x.s0, clamped_y.s0, clamped_x.s1, clamped_y.s1, clamped_x.s2, clamped_y.s2, clamped_x.s3, clamped_y.s3);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;}</div><div class="ttc" id="namespacearm__compute_xhtml_a1c0b9414fe3a6ef6a7a23bd324ae9e67"><div class="ttname"><a href="namespacearm__compute.xhtml#a1c0b9414fe3a6ef6a7a23bd324ae9e67">arm_compute::clamp</a></div><div class="ttdeci">T clamp(const T &amp;n, const T &amp;lower, const T &amp;upper)</div><div class="ttdoc">Performs clamping among a lower and upper value. </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_helpers_8h_source.xhtml#l00193">Helpers.h:193</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a4caaeeb51ea58015267a9974675226d1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const float2 get_current_coords </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the current thread coordinates. </p>
<p>Definition at line <a class="el" href="warp__helpers_8h_source.xhtml#l00054">54</a> of file <a class="el" href="warp__helpers_8h_source.xhtml">warp_helpers.h</a>.</p>
<p>Referenced by <a class="el" href="scale_8cl_source.xhtml#l00110">scale_bilinear()</a>, <a class="el" href="scale_8cl_source.xhtml#l00076">scale_nearest_neighbour()</a>, <a class="el" href="warp__affine_8cl_source.xhtml#l00111">warp_affine_bilinear()</a>, <a class="el" href="warp__affine_8cl_source.xhtml#l00079">warp_affine_nearest_neighbour()</a>, <a class="el" href="warp__perspective_8cl_source.xhtml#l00119">warp_perspective_bilinear()</a>, and <a class="el" href="warp__perspective_8cl_source.xhtml#l00087">warp_perspective_nearest_neighbour()</a>.</p>
<div class="fragment"><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;{</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordflow">return</span> (float2)(get_global_id(0) * 4, get_global_id(1));</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a2d8047717d6464cad02c5979d09576db"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const float8 get_neighbour_coords </td>
<td>(</td>
<td class="paramtype">const float2&#160;</td>
<td class="paramname"><em>coord</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Given a texel coordinates this function will return the following array of coordinates: [ P, right neighbour, below neighbour, below right neighbour ]. </p>
<dl class="section note"><dt>Note</dt><dd>No checks to see if the coordinates are out of the image are done here.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">coord</td><td>Input coordinates</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>vector of 8 floats with the coordinates, even positions are x and odd y. </dd></dl>
<p>Definition at line <a class="el" href="warp__helpers_8h_source.xhtml#l00068">68</a> of file <a class="el" href="warp__helpers_8h_source.xhtml">warp_helpers.h</a>.</p>
<p>Referenced by <a class="el" href="warp__helpers_8h_source.xhtml#l00080">bilinear_interpolate()</a>.</p>
<div class="fragment"><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;{</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">return</span> (float8)(<span class="comment">/*tl*/</span> coord.s0, coord.s1, <span class="comment">/*tr*/</span> coord.s0 + 1, coord.s1, <span class="comment">/*bl*/</span> coord.s0, coord.s1 + 1, <span class="comment">/*br*/</span> coord.s0 + 1, coord.s1 + 1);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="aba42442a4c991cdbb52727fa370676f1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const DATA_TYPE4 read_texels4 </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="struct_image.xhtml">Image</a> *&#160;</td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int8&#160;</td>
<td class="paramname"><em>coords</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads four texels from the input image. </p>
<p>The coords vector is used to determine which texels to be read.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>Pointer to the source image. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">coords</td><td><a class="el" href="struct_vector.xhtml" title="Structure to hold Vector information. ">Vector</a> of coordinates to be read from the image. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="warp__helpers_8h_source.xhtml#l00045">45</a> of file <a class="el" href="warp__helpers_8h_source.xhtml">warp_helpers.h</a>.</p>
<p>References <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="helpers_8h_source.xhtml#l00201">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00032">VEC_DATA_TYPE</a>.</p>
<p>Referenced by <a class="el" href="remap_8cl_source.xhtml#l00059">remap_nearest_neighbour()</a>, <a class="el" href="scale_8cl_source.xhtml#l00076">scale_nearest_neighbour()</a>, <a class="el" href="warp__affine_8cl_source.xhtml#l00079">warp_affine_nearest_neighbour()</a>, and <a class="el" href="warp__perspective_8cl_source.xhtml#l00087">warp_perspective_nearest_neighbour()</a>.</p>
<div class="fragment"><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;{</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4))(*((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s0, coords.s1)),</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s2, coords.s3)),</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s4, coords.s5)),</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s6, coords.s7)));</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;}</div><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>
<div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00201">helpers.h:201</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a></div><div class="ttdeci">#define VEC_DATA_TYPE(type, size)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00032">helpers.h:32</a></div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<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__helpers_8h.xhtml">warp_helpers.h</a></li>
<li class="footer">Generated on Fri Jun 23 2017 15:44:34 for Compute Library by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>