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>Compute Library: PPMLoader Class 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">Compute Library
43  <span id="projectnumber">v17.06</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="pages.xhtml"><span>Related Pages</span></a></li>
59 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
60 <li class="current"><a href="annotated.xhtml"><span>Data Structures</span></a></li>
61 <li><a href="files.xhtml"><span>Files</span></a></li>
63 <div id="MSearchBox" class="MSearchBoxInactive">
65 <img id="MSearchSelect" src="search/mag_sel.png"
66 onmouseover="return searchBox.OnSearchSelectShow()"
67 onmouseout="return searchBox.OnSearchSelectHide()"
69 <input type="text" id="MSearchField" value="Search" accesskey="S"
70 onfocus="searchBox.OnSearchFieldFocus(true)"
71 onblur="searchBox.OnSearchFieldFocus(false)"
72 onkeyup="searchBox.OnSearchFieldChange(event)"/>
73 </span><span class="right">
74 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
80 <div id="navrow2" class="tabs2">
82 <li><a href="annotated.xhtml"><span>Data Structures</span></a></li>
83 <li><a href="classes.xhtml"><span>Data Structure Index</span></a></li>
84 <li><a href="inherits.xhtml"><span>Class Hierarchy</span></a></li>
85 <li><a href="functions.xhtml"><span>Data Fields</span></a></li>
89 <div id="side-nav" class="ui-resizable side-nav-resizable">
91 <div id="nav-tree-contents">
92 <div id="nav-sync" class="sync"></div>
95 <div id="splitbar" style="-moz-user-select:none;"
96 class="ui-resizable-handle">
99 <script type="text/javascript">
100 $(document).ready(function(){initNavTree('classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml','');});
102 <div id="doc-content">
103 <!-- window showing the filter options -->
104 <div id="MSearchSelectWindow"
105 onmouseover="return searchBox.OnSearchSelectShow()"
106 onmouseout="return searchBox.OnSearchSelectHide()"
107 onkeydown="return searchBox.OnSearchSelectKey(event)">
110 <!-- iframe showing the search results (closed by default) -->
111 <div id="MSearchResultsWindow">
112 <iframe src="javascript:void(0)" frameborder="0"
113 name="MSearchResults" id="MSearchResults">
118 <div class="summary">
119 <a href="#pub-methods">Public Member Functions</a> </div>
120 <div class="headertitle">
121 <div class="title">PPMLoader Class Reference</div> </div>
123 <div class="contents">
125 <p>Class to load the content of a PPM file into an <a class="el" href="struct_image.xhtml" title="Structure to hold Image information. ">Image</a>.
126 <a href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#details">More...</a></p>
128 <p><code>#include <<a class="el" href="utils_2_utils_8h_source.xhtml">Utils.h</a>></code></p>
129 <table class="memberdecls">
130 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
131 Public Member Functions</h2></td></tr>
132 <tr class="memitem:a49afa04c8a5fd9ead48e07440b37294c"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a49afa04c8a5fd9ead48e07440b37294c">PPMLoader</a> ()</td></tr>
133 <tr class="separator:a49afa04c8a5fd9ead48e07440b37294c"><td class="memSeparator" colspan="2"> </td></tr>
134 <tr class="memitem:a36e58f3e64f3851ebac7a9556b4704ed"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a36e58f3e64f3851ebac7a9556b4704ed">open</a> (const std::string &ppm_filename)</td></tr>
135 <tr class="memdesc:a36e58f3e64f3851ebac7a9556b4704ed"><td class="mdescLeft"> </td><td class="mdescRight">Open a PPM file and reads its metadata (Width, height) <a href="#a36e58f3e64f3851ebac7a9556b4704ed">More...</a><br /></td></tr>
136 <tr class="separator:a36e58f3e64f3851ebac7a9556b4704ed"><td class="memSeparator" colspan="2"> </td></tr>
137 <tr class="memitem:a2f57f54d8c03b615bb31eee091d8a88a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">is_open</a> ()</td></tr>
138 <tr class="memdesc:a2f57f54d8c03b615bb31eee091d8a88a"><td class="mdescLeft"> </td><td class="mdescRight">Return true if a PPM file is currently open. <a href="#a2f57f54d8c03b615bb31eee091d8a88a">More...</a><br /></td></tr>
139 <tr class="separator:a2f57f54d8c03b615bb31eee091d8a88a"><td class="memSeparator" colspan="2"> </td></tr>
140 <tr class="memitem:a69f2a0e263d4f77d1e166de9cd2746f7"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
141 <tr class="memitem:a69f2a0e263d4f77d1e166de9cd2746f7"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a69f2a0e263d4f77d1e166de9cd2746f7">init_image</a> (T &image, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">arm_compute::Format</a> format)</td></tr>
142 <tr class="memdesc:a69f2a0e263d4f77d1e166de9cd2746f7"><td class="mdescLeft"> </td><td class="mdescRight">Initialise an image's metadata with the dimensions of the PPM file currently open. <a href="#a69f2a0e263d4f77d1e166de9cd2746f7">More...</a><br /></td></tr>
143 <tr class="separator:a69f2a0e263d4f77d1e166de9cd2746f7"><td class="memSeparator" colspan="2"> </td></tr>
144 <tr class="memitem:a1672610b872bef30d0dc2333a0ffc402"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
145 <tr class="memitem:a1672610b872bef30d0dc2333a0ffc402"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a1672610b872bef30d0dc2333a0ffc402">fill_image</a> (T &image)</td></tr>
146 <tr class="memdesc:a1672610b872bef30d0dc2333a0ffc402"><td class="mdescLeft"> </td><td class="mdescRight">Fill an image with the content of the currently open PPM file. <a href="#a1672610b872bef30d0dc2333a0ffc402">More...</a><br /></td></tr>
147 <tr class="separator:a1672610b872bef30d0dc2333a0ffc402"><td class="memSeparator" colspan="2"> </td></tr>
149 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
150 <div class="textblock"><p>Class to load the content of a PPM file into an <a class="el" href="struct_image.xhtml" title="Structure to hold Image information. ">Image</a>. </p>
152 <p>Definition at line <a class="el" href="utils_2_utils_8h_source.xhtml#l00083">83</a> of file <a class="el" href="utils_2_utils_8h_source.xhtml">Utils.h</a>.</p>
153 </div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
154 <a class="anchor" id="a49afa04c8a5fd9ead48e07440b37294c"></a>
155 <div class="memitem">
156 <div class="memproto">
157 <table class="mlabels">
159 <td class="mlabels-left">
160 <table class="memname">
162 <td class="memname"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml">PPMLoader</a> </td>
164 <td class="paramname"></td><td>)</td>
169 <td class="mlabels-right">
170 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
173 </div><div class="memdoc">
175 <p>Definition at line <a class="el" href="utils_2_utils_8h_source.xhtml#l00086">86</a> of file <a class="el" href="utils_2_utils_8h_source.xhtml">Utils.h</a>.</p>
176 <div class="fragment"><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  : _fs(), _width(0), _height(0)</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  {</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  }</div></div><!-- fragment -->
179 <h2 class="groupheader">Member Function Documentation</h2>
180 <a class="anchor" id="a1672610b872bef30d0dc2333a0ffc402"></a>
181 <div class="memitem">
182 <div class="memproto">
183 <table class="mlabels">
185 <td class="mlabels-left">
186 <table class="memname">
188 <td class="memname">void fill_image </td>
190 <td class="paramtype">T & </td>
191 <td class="paramname"><em>image</em></td><td>)</td>
196 <td class="mlabels-right">
197 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
200 </div><div class="memdoc">
202 <p>Fill an image with the content of the currently open PPM file. </p>
203 <dl class="section note"><dt>Note</dt><dd>If the image is a CLImage, the function maps and unmaps the image</dd></dl>
204 <dl class="params"><dt>Parameters</dt><dd>
205 <table class="params">
206 <tr><td class="paramdir">[in,out]</td><td class="paramname">image</td><td><a class="el" href="struct_image.xhtml" title="Structure to hold Image information. ">Image</a> to fill (Must be allocated, and of matching dimensions with the opened PPM). </td></tr>
211 <p>Definition at line <a class="el" href="utils_2_utils_8h_source.xhtml#l00142">142</a> of file <a class="el" href="utils_2_utils_8h_source.xhtml">Utils.h</a>.</p>
213 <p>References <a class="el" href="_error_8h_source.xhtml#l00031">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00124">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="_validate_8h_source.xhtml#l00359">ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN</a>, <a class="el" href="_error_8h_source.xhtml#l00115">ARM_COMPUTE_ERROR_ON_MSG</a>, <a class="el" href="_error_8h_source.xhtml#l00049">ARM_COMPUTE_UNUSED</a>, <a class="el" href="_window_8h_source.xhtml#l00043">Window::DimX</a>, <a class="el" href="_window_8h_source.xhtml#l00045">Window::DimY</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00176">arm_compute::execute_window_loop()</a>, <a class="el" href="utils_2_utils_8h_source.xhtml#l00114">PPMLoader::is_open()</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00232">Iterator::ptr()</a>, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0">arm_compute::RGB888</a>, <a class="el" href="_window_8inl_source.xhtml#l00040">Window::set()</a>, and <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5">arm_compute::U8</a>.</p>
215 <p>Referenced by <a class="el" href="cl__convolution_8cpp_source.xhtml#l00053">main_cl_convolution()</a>, <a class="el" href="cl__events_8cpp_source.xhtml#l00033">main_cl_events()</a>, <a class="el" href="neon__convolution_8cpp_source.xhtml#l00052">main_neon_convolution()</a>, <a class="el" href="neon__scale_8cpp_source.xhtml#l00032">main_neon_scale()</a>, and <a class="el" href="neoncl__scale__median__gaussian_8cpp_source.xhtml#l00039">main_neoncl_scale_median_gaussian()</a>.</p>
216 <div class="fragment"><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  {</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(!<a class="code" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">is_open</a>());</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(image.info()->dimension(0) != _width || image.info()->dimension(1) != _height);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <a class="code" href="_validate_8h.xhtml#a0d34a8aa07600727e4e5034c7cdad47d">ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN</a>(&image, <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5">arm_compute::Format::U8</a>, <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0">arm_compute::Format::RGB888</a>);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  {</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="preprocessor">#ifdef ARM_COMPUTE_CL</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="comment">// Map buffer if creating a CLTensor</span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordflow">if</span>(std::is_same<<span class="keyword">typename</span> std::decay<T>::type, <a class="code" href="classarm__compute_1_1_c_l_tensor.xhtml">arm_compute::CLImage</a>>::value)</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  {</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  image.map();</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  }</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="comment">// Check if the file is large enough to fill the image</span></div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> current_position = _fs.tellg();</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  _fs.seekg(0, std::ios_base::end);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> end_position = _fs.tellg();</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  _fs.seekg(current_position, std::ios_base::beg);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>((end_position - current_position) < image.info()->tensor_shape().total_size() * image.info()->element_size(),</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="stringliteral">"Not enough data in file"</span>);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <a class="code" href="_error_8h.xhtml#a4103adbb45806b2f2002d44b91d0d206">ARM_COMPUTE_UNUSED</a>(end_position);</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span> </div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="keywordflow">switch</span>(image.info()->format())</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  {</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5">arm_compute::Format::U8</a>:</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  {</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="comment">// We need to convert the data from RGB to grayscale:</span></div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="comment">// Iterate through every pixel of the image</span></div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <a class="code" href="classarm__compute_1_1_window.xhtml">arm_compute::Window</a> window;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  window.<a class="code" href="classarm__compute_1_1_window.xhtml#acd3d2bba51cb84d34dd7656ad2375a6e">set</a>(<a class="code" href="classarm__compute_1_1_window.xhtml#aa96e81276ee4f87ab386cd05a5539a7d">arm_compute::Window::DimX</a>, <a class="code" href="classarm__compute_1_1_window_1_1_dimension.xhtml">arm_compute::Window::Dimension</a>(0, _width, 1));</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  window.<a class="code" href="classarm__compute_1_1_window.xhtml#acd3d2bba51cb84d34dd7656ad2375a6e">set</a>(<a class="code" href="classarm__compute_1_1_window.xhtml#ad2d402364fa822b0b7775081291eeca9">arm_compute::Window::DimY</a>, <a class="code" href="classarm__compute_1_1_window_1_1_dimension.xhtml">arm_compute::Window::Dimension</a>(0, _height, 1));</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> </div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="code" href="classarm__compute_1_1_iterator.xhtml">arm_compute::Iterator</a> out(&image, window);</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> </div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> red = 0;</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> green = 0;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> blue = 0;</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <a class="code" href="namespacearm__compute.xhtml#a6c0dcc38187027dcb89cd9724bc5a823">arm_compute::execute_window_loop</a>(window, [&](<span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_coordinates.xhtml">arm_compute::Coordinates</a> & <span class="keywordtype">id</span>)</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  {</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  red = _fs.get();</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  green = _fs.get();</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  blue = _fs.get();</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  *out.ptr() = 0.2126f * red + 0.7152f * green + 0.0722f * blue;</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  },</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  out);</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span> </div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  }</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0">arm_compute::Format::RGB888</a>:</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  {</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="comment">// There is no format conversion needed: we can simply copy the content of the input file to the image one row at the time.</span></div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="comment">// Create a vertical window to iterate through the image's rows:</span></div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <a class="code" href="classarm__compute_1_1_window.xhtml">arm_compute::Window</a> window;</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  window.<a class="code" href="classarm__compute_1_1_window.xhtml#acd3d2bba51cb84d34dd7656ad2375a6e">set</a>(<a class="code" href="classarm__compute_1_1_window.xhtml#ad2d402364fa822b0b7775081291eeca9">arm_compute::Window::DimY</a>, <a class="code" href="classarm__compute_1_1_window_1_1_dimension.xhtml">arm_compute::Window::Dimension</a>(0, _height, 1));</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span> </div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <a class="code" href="classarm__compute_1_1_iterator.xhtml">arm_compute::Iterator</a> out(&image, window);</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> </div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <a class="code" href="namespacearm__compute.xhtml#a6c0dcc38187027dcb89cd9724bc5a823">arm_compute::execute_window_loop</a>(window, [&](<span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_coordinates.xhtml">arm_compute::Coordinates</a> & <span class="keywordtype">id</span>)</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  {</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="comment">// Copy one row from the input file to the current row of the image:</span></div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  _fs.read(reinterpret_cast<std::fstream::char_type *>(out.ptr()), _width * image.info()->element_size());</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  },</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  out);</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span> </div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  }</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <a class="code" href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">"Unsupported format"</span>);</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  }</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span> </div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span> <span class="preprocessor">#ifdef ARM_COMPUTE_CL</span></div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="comment">// Unmap buffer if creating a CLTensor</span></div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordflow">if</span>(std::is_same<<span class="keyword">typename</span> std::decay<T>::type, <a class="code" href="classarm__compute_1_1_c_l_tensor.xhtml">arm_compute::CLTensor</a>>::value)</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  {</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  image.unmap();</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  }</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  }</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">catch</span>(<span class="keyword">const</span> std::ifstream::failure &e)</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  {</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <a class="code" href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">"Loading PPM file: %s"</span>, e.what());</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  }</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  }</div><div class="ttc" id="_error_8h_xhtml_a05b19c75afe9c24200a62b9724734bbd"><div class="ttname"><a href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR(...)</div><div class="ttdoc">Print the given message then throw an std::runtime_error. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00031">Error.h:31</a></div></div>
217 <div class="ttc" id="namespacearm__compute_xhtml_ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5"><div class="ttname"><a href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5">arm_compute::Format::U8</a></div><div class="ttdoc">Unknown image format. </div></div>
218 <div class="ttc" id="_validate_8h_xhtml_a0d34a8aa07600727e4e5034c7cdad47d"><div class="ttname"><a href="_validate_8h.xhtml#a0d34a8aa07600727e4e5034c7cdad47d">ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN(t,...)</div><div class="ttdef"><b>Definition:</b> <a href="_validate_8h_source.xhtml#l00359">Validate.h:359</a></div></div>
219 <div class="ttc" id="_error_8h_xhtml_a4103adbb45806b2f2002d44b91d0d206"><div class="ttname"><a href="_error_8h.xhtml#a4103adbb45806b2f2002d44b91d0d206">ARM_COMPUTE_UNUSED</a></div><div class="ttdeci">#define ARM_COMPUTE_UNUSED(var)</div><div class="ttdoc">To avoid unused variables warnings. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00049">Error.h:49</a></div></div>
220 <div class="ttc" id="_error_8h_xhtml_a54a6080c9f4df1f908e57a9bbb46f5da"><div class="ttname"><a href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true then an error message is printed and an exception thrown. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00124">Error.h:124</a></div></div>
221 <div class="ttc" id="classarm__compute_1_1_window_1_1_dimension_xhtml"><div class="ttname"><a href="classarm__compute_1_1_window_1_1_dimension.xhtml">arm_compute::Window::Dimension</a></div><div class="ttdoc">Describe one of the image&#39;s dimensions with a start, end and step. </div><div class="ttdef"><b>Definition:</b> <a href="_window_8h_source.xhtml#l00068">Window.h:68</a></div></div>
222 <div class="ttc" id="namespacearm__compute_xhtml_ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0"><div class="ttname"><a href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0">arm_compute::Format::RGB888</a></div><div class="ttdoc">2 channel, 1 U8 per channel </div></div>
223 <div class="ttc" id="classarm__compute_1_1_window_xhtml_aa96e81276ee4f87ab386cd05a5539a7d"><div class="ttname"><a href="classarm__compute_1_1_window.xhtml#aa96e81276ee4f87ab386cd05a5539a7d">arm_compute::Window::DimX</a></div><div class="ttdeci">static constexpr size_t DimX</div><div class="ttdoc">Alias for dimension 0 also known as X dimension. </div><div class="ttdef"><b>Definition:</b> <a href="_window_8h_source.xhtml#l00043">Window.h:43</a></div></div>
224 <div class="ttc" id="namespacearm__compute_xhtml_a6c0dcc38187027dcb89cd9724bc5a823"><div class="ttname"><a href="namespacearm__compute.xhtml#a6c0dcc38187027dcb89cd9724bc5a823">arm_compute::execute_window_loop</a></div><div class="ttdeci">void execute_window_loop(const Window &w, L &&lambda_function, Ts &&...iterators)</div><div class="ttdoc">Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...</div><div class="ttdef"><b>Definition:</b> <a href="_helpers_8inl_source.xhtml#l00176">Helpers.inl:176</a></div></div>
225 <div class="ttc" id="classarm__compute_1_1_coordinates_xhtml"><div class="ttname"><a href="classarm__compute_1_1_coordinates.xhtml">arm_compute::Coordinates</a></div><div class="ttdoc">Coordinates of an item. </div><div class="ttdef"><b>Definition:</b> <a href="_coordinates_8h_source.xhtml#l00037">Coordinates.h:37</a></div></div>
226 <div class="ttc" id="classarm__compute_1_1utils_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">arm_compute::utils::PPMLoader::is_open</a></div><div class="ttdeci">bool is_open()</div><div class="ttdoc">Return true if a PPM file is currently open. </div><div class="ttdef"><b>Definition:</b> <a href="utils_2_utils_8h_source.xhtml#l00114">Utils.h:114</a></div></div>
227 <div class="ttc" id="classarm__compute_1_1_window_xhtml_acd3d2bba51cb84d34dd7656ad2375a6e"><div class="ttname"><a href="classarm__compute_1_1_window.xhtml#acd3d2bba51cb84d34dd7656ad2375a6e">arm_compute::Window::set</a></div><div class="ttdeci">void set(size_t dimension, const Dimension &dim)</div><div class="ttdoc">Set the values of a given dimension. </div><div class="ttdef"><b>Definition:</b> <a href="_window_8inl_source.xhtml#l00040">Window.inl:40</a></div></div>
228 <div class="ttc" id="classarm__compute_1_1_window_xhtml_ad2d402364fa822b0b7775081291eeca9"><div class="ttname"><a href="classarm__compute_1_1_window.xhtml#ad2d402364fa822b0b7775081291eeca9">arm_compute::Window::DimY</a></div><div class="ttdeci">static constexpr size_t DimY</div><div class="ttdoc">Alias for dimension 1 also known as Y dimension. </div><div class="ttdef"><b>Definition:</b> <a href="_window_8h_source.xhtml#l00045">Window.h:45</a></div></div>
229 <div class="ttc" id="classarm__compute_1_1_iterator_xhtml"><div class="ttname"><a href="classarm__compute_1_1_iterator.xhtml">arm_compute::Iterator</a></div><div class="ttdoc">Iterator updated by execute_window_loop for each window element. </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_helpers_8h_source.xhtml#l00251">Helpers.h:251</a></div></div>
230 <div class="ttc" id="classarm__compute_1_1_window_xhtml"><div class="ttname"><a href="classarm__compute_1_1_window.xhtml">arm_compute::Window</a></div><div class="ttdoc">Describe a multidimensional execution window. </div><div class="ttdef"><b>Definition:</b> <a href="_window_8h_source.xhtml#l00039">Window.h:39</a></div></div>
231 <div class="ttc" id="_error_8h_xhtml_a5bbdcf574d3f5e412fa6a1117911e67b"><div class="ttname"><a href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00115">Error.h:115</a></div></div>
232 <div class="ttc" id="classarm__compute_1_1_c_l_tensor_xhtml"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor.xhtml">arm_compute::CLTensor</a></div><div class="ttdoc">Basic implementation of the OpenCL tensor interface. </div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_8h_source.xhtml#l00039">CLTensor.h:39</a></div></div>
233 </div><!-- fragment -->
236 <a class="anchor" id="a69f2a0e263d4f77d1e166de9cd2746f7"></a>
237 <div class="memitem">
238 <div class="memproto">
239 <table class="mlabels">
241 <td class="mlabels-left">
242 <table class="memname">
244 <td class="memname">void init_image </td>
246 <td class="paramtype">T & </td>
247 <td class="paramname"><em>image</em>, </td>
250 <td class="paramkey"></td>
252 <td class="paramtype"><a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">arm_compute::Format</a> </td>
253 <td class="paramname"><em>format</em> </td>
262 <td class="mlabels-right">
263 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
266 </div><div class="memdoc">
268 <p>Initialise an image's metadata with the dimensions of the PPM file currently open. </p>
269 <dl class="params"><dt>Parameters</dt><dd>
270 <table class="params">
271 <tr><td class="paramdir">[out]</td><td class="paramname">image</td><td><a class="el" href="struct_image.xhtml" title="Structure to hold Image information. ">Image</a> to initialise </td></tr>
272 <tr><td class="paramdir">[in]</td><td class="paramname">format</td><td>Format to use for the image (Must be RGB888 or U8) </td></tr>
277 <p>Definition at line <a class="el" href="utils_2_utils_8h_source.xhtml#l00125">125</a> of file <a class="el" href="utils_2_utils_8h_source.xhtml">Utils.h</a>.</p>
279 <p>References <a class="el" href="_error_8h_source.xhtml#l00124">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="utils_2_utils_8h_source.xhtml#l00114">PPMLoader::is_open()</a>, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0">arm_compute::RGB888</a>, and <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5">arm_compute::U8</a>.</p>
281 <p>Referenced by <a class="el" href="cl__convolution_8cpp_source.xhtml#l00053">main_cl_convolution()</a>, <a class="el" href="cl__events_8cpp_source.xhtml#l00033">main_cl_events()</a>, <a class="el" href="neon__convolution_8cpp_source.xhtml#l00052">main_neon_convolution()</a>, <a class="el" href="neon__scale_8cpp_source.xhtml#l00032">main_neon_scale()</a>, and <a class="el" href="neoncl__scale__median__gaussian_8cpp_source.xhtml#l00039">main_neoncl_scale_median_gaussian()</a>.</p>
282 <div class="fragment"><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  {</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(!<a class="code" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">is_open</a>());</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(format != <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0">arm_compute::Format::RGB888</a> && format != <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5">arm_compute::Format::U8</a>);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> </div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="comment">// Use the size of the input PPM image</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <a class="code" href="classarm__compute_1_1_tensor_info.xhtml">arm_compute::TensorInfo</a> image_info(_width, _height, format);</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  image.allocator()->init(image_info);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  }</div><div class="ttc" id="namespacearm__compute_xhtml_ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5"><div class="ttname"><a href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5">arm_compute::Format::U8</a></div><div class="ttdoc">Unknown image format. </div></div>
283 <div class="ttc" id="_error_8h_xhtml_a54a6080c9f4df1f908e57a9bbb46f5da"><div class="ttname"><a href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true then an error message is printed and an exception thrown. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00124">Error.h:124</a></div></div>
284 <div class="ttc" id="namespacearm__compute_xhtml_ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0"><div class="ttname"><a href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0">arm_compute::Format::RGB888</a></div><div class="ttdoc">2 channel, 1 U8 per channel </div></div>
285 <div class="ttc" id="classarm__compute_1_1utils_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">arm_compute::utils::PPMLoader::is_open</a></div><div class="ttdeci">bool is_open()</div><div class="ttdoc">Return true if a PPM file is currently open. </div><div class="ttdef"><b>Definition:</b> <a href="utils_2_utils_8h_source.xhtml#l00114">Utils.h:114</a></div></div>
286 <div class="ttc" id="classarm__compute_1_1_tensor_info_xhtml"><div class="ttname"><a href="classarm__compute_1_1_tensor_info.xhtml">arm_compute::TensorInfo</a></div><div class="ttdoc">Store the tensor&#39;s metadata. </div><div class="ttdef"><b>Definition:</b> <a href="_tensor_info_8h_source.xhtml#l00042">TensorInfo.h:42</a></div></div>
287 </div><!-- fragment -->
290 <a class="anchor" id="a2f57f54d8c03b615bb31eee091d8a88a"></a>
291 <div class="memitem">
292 <div class="memproto">
293 <table class="mlabels">
295 <td class="mlabels-left">
296 <table class="memname">
298 <td class="memname">bool is_open </td>
300 <td class="paramname"></td><td>)</td>
305 <td class="mlabels-right">
306 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
309 </div><div class="memdoc">
311 <p>Return true if a PPM file is currently open. </p>
313 <p>Definition at line <a class="el" href="utils_2_utils_8h_source.xhtml#l00114">114</a> of file <a class="el" href="utils_2_utils_8h_source.xhtml">Utils.h</a>.</p>
315 <p>Referenced by <a class="el" href="utils_2_utils_8h_source.xhtml#l00142">PPMLoader::fill_image()</a>, <a class="el" href="utils_2_utils_8h_source.xhtml#l00125">PPMLoader::init_image()</a>, <a class="el" href="cl__convolution_8cpp_source.xhtml#l00053">main_cl_convolution()</a>, <a class="el" href="cl__events_8cpp_source.xhtml#l00033">main_cl_events()</a>, <a class="el" href="neon__convolution_8cpp_source.xhtml#l00052">main_neon_convolution()</a>, <a class="el" href="neon__scale_8cpp_source.xhtml#l00032">main_neon_scale()</a>, <a class="el" href="neoncl__scale__median__gaussian_8cpp_source.xhtml#l00039">main_neoncl_scale_median_gaussian()</a>, and <a class="el" href="utils_2_utils_8h_source.xhtml#l00094">PPMLoader::open()</a>.</p>
316 <div class="fragment"><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  {</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordflow">return</span> _fs.is_open();</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  }</div></div><!-- fragment -->
319 <a class="anchor" id="a36e58f3e64f3851ebac7a9556b4704ed"></a>
320 <div class="memitem">
321 <div class="memproto">
322 <table class="mlabels">
324 <td class="mlabels-left">
325 <table class="memname">
327 <td class="memname">void open </td>
329 <td class="paramtype">const std::string & </td>
330 <td class="paramname"><em>ppm_filename</em></td><td>)</td>
335 <td class="mlabels-right">
336 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
339 </div><div class="memdoc">
341 <p>Open a PPM file and reads its metadata (Width, height) </p>
342 <dl class="params"><dt>Parameters</dt><dd>
343 <table class="params">
344 <tr><td class="paramdir">[in]</td><td class="paramname">ppm_filename</td><td>File to open </td></tr>
349 <p>Definition at line <a class="el" href="utils_2_utils_8h_source.xhtml#l00094">94</a> of file <a class="el" href="utils_2_utils_8h_source.xhtml">Utils.h</a>.</p>
351 <p>References <a class="el" href="_error_8h_source.xhtml#l00031">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00124">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="_error_8h_source.xhtml#l00115">ARM_COMPUTE_ERROR_ON_MSG</a>, <a class="el" href="utils_2_utils_8h_source.xhtml#l00114">PPMLoader::is_open()</a>, and <a class="el" href="utils_2_utils_8cpp_source.xhtml#l00140">arm_compute::utils::parse_ppm_header()</a>.</p>
353 <p>Referenced by <a class="el" href="cl__convolution_8cpp_source.xhtml#l00053">main_cl_convolution()</a>, <a class="el" href="cl__events_8cpp_source.xhtml#l00033">main_cl_events()</a>, <a class="el" href="neon__convolution_8cpp_source.xhtml#l00052">main_neon_convolution()</a>, <a class="el" href="neon__scale_8cpp_source.xhtml#l00032">main_neon_scale()</a>, and <a class="el" href="neoncl__scale__median__gaussian_8cpp_source.xhtml#l00039">main_neoncl_scale_median_gaussian()</a>.</p>
354 <div class="fragment"><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  {</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(<a class="code" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">is_open</a>());</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  {</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  _fs.exceptions(std::ifstream::failbit | std::ifstream::badbit);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  _fs.open(ppm_filename, std::ios::in | std::ios::binary);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> max_val = 0;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  std::tie(_width, _height, max_val) = <a class="code" href="namespacearm__compute_1_1utils.xhtml#a3aa8f5f1b94f88fdf5b43a53e29379cf">parse_ppm_header</a>(_fs);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(max_val >= 256, <span class="stringliteral">"2 bytes per colour channel not supported in file %s"</span>, ppm_filename.c_str());</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  }</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordflow">catch</span>(<span class="keyword">const</span> std::ifstream::failure &e)</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  {</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <a class="code" href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">"Accessing %s: %s"</span>, ppm_filename.c_str(), e.what());</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  }</div><div class="ttc" id="_error_8h_xhtml_a05b19c75afe9c24200a62b9724734bbd"><div class="ttname"><a href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR(...)</div><div class="ttdoc">Print the given message then throw an std::runtime_error. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00031">Error.h:31</a></div></div>
355 <div class="ttc" id="_error_8h_xhtml_a54a6080c9f4df1f908e57a9bbb46f5da"><div class="ttname"><a href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true then an error message is printed and an exception thrown. </div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00124">Error.h:124</a></div></div>
356 <div class="ttc" id="classarm__compute_1_1utils_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">arm_compute::utils::PPMLoader::is_open</a></div><div class="ttdeci">bool is_open()</div><div class="ttdoc">Return true if a PPM file is currently open. </div><div class="ttdef"><b>Definition:</b> <a href="utils_2_utils_8h_source.xhtml#l00114">Utils.h:114</a></div></div>
357 <div class="ttc" id="namespacearm__compute_1_1utils_xhtml_a3aa8f5f1b94f88fdf5b43a53e29379cf"><div class="ttname"><a href="namespacearm__compute_1_1utils.xhtml#a3aa8f5f1b94f88fdf5b43a53e29379cf">arm_compute::utils::parse_ppm_header</a></div><div class="ttdeci">std::tuple< unsigned int, unsigned int, int > parse_ppm_header(std::ifstream &fs)</div><div class="ttdoc">Parse the ppm header from an input file stream. </div><div class="ttdef"><b>Definition:</b> <a href="utils_2_utils_8cpp_source.xhtml#l00140">Utils.cpp:140</a></div></div>
358 <div class="ttc" id="_error_8h_xhtml_a5bbdcf574d3f5e412fa6a1117911e67b"><div class="ttname"><a href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00115">Error.h:115</a></div></div>
359 </div><!-- fragment -->
362 <hr/>The documentation for this class was generated from the following file:<ul>
363 <li>utils/<a class="el" href="utils_2_utils_8h_source.xhtml">Utils.h</a></li>
365 </div><!-- contents -->
366 </div><!-- doc-content -->
367 <!-- start footer part -->
368 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
370 <li class="navelem"><a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1utils.xhtml">utils</a></li><li class="navelem"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml">PPMLoader</a></li>
371 <li class="footer">Generated on Fri Jun 23 2017 15:44:36 for Compute Library by
372 <a href="http://www.doxygen.org/index.html">
373 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>