<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">ARM Compute Library
-  <span id="projectnumber">17.04</span>
+  <span id="projectnumber">17.05</span>
</div>
</td>
</tr>
<tr class="memitem:a2f57f54d8c03b615bb31eee091d8a88a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">is_open</a> ()</td></tr>
<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>
<tr class="separator:a2f57f54d8c03b615bb31eee091d8a88a"><td class="memSeparator" colspan="2"> </td></tr>
-<tr class="memitem:a283b961e6ca7b117b106c8710c7cfe81"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
-<tr class="memitem:a283b961e6ca7b117b106c8710c7cfe81"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtest__helpers_1_1_p_p_m_loader.xhtml#a283b961e6ca7b117b106c8710c7cfe81">init_image</a> (T &image, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a> format)</td></tr>
-<tr class="memdesc:a283b961e6ca7b117b106c8710c7cfe81"><td class="mdescLeft"> </td><td class="mdescRight">Initialise an image's metadata with the dimensions of the PPM file currently open. <a href="#a283b961e6ca7b117b106c8710c7cfe81">More...</a><br /></td></tr>
-<tr class="separator:a283b961e6ca7b117b106c8710c7cfe81"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a69f2a0e263d4f77d1e166de9cd2746f7"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
+<tr class="memitem:a69f2a0e263d4f77d1e166de9cd2746f7"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtest__helpers_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>
+<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>
+<tr class="separator:a69f2a0e263d4f77d1e166de9cd2746f7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1672610b872bef30d0dc2333a0ffc402"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
<tr class="memitem:a1672610b872bef30d0dc2333a0ffc402"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classtest__helpers_1_1_p_p_m_loader.xhtml#a1672610b872bef30d0dc2333a0ffc402">fill_image</a> (T &image)</td></tr>
<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>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<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>
-<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00083">83</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
+<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00081">81</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a49afa04c8a5fd9ead48e07440b37294c"></a>
<div class="memitem">
</table>
</div><div class="memdoc">
-<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00086">86</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
-<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 -->
+<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00084">84</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
+<div class="fragment"><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  : _fs(), _width(0), _height(0)</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  {</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  }</div></div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
</dd>
</dl>
-<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00142">142</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
+<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00140">140</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
-<p>References <a class="el" href="_error_8h_source.xhtml#l00031">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00100">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="_validate_8h_source.xhtml#l00215">ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN</a>, <a class="el" href="_error_8h_source.xhtml#l00091">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="namespacearm__compute.xhtml#a78fd1c0056e9add7ab01b8e118c0038d">arm_compute::execute_window_loop()</a>, <a class="el" href="classarm__compute_1_1_iterator.xhtml#a2f0d6383162e1af2df323c456a9335d3">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>
+<p>References <a class="el" href="_error_8h_source.xhtml#l00031">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00100">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="_validate_8h_source.xhtml#l00215">ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN</a>, <a class="el" href="_error_8h_source.xhtml#l00091">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="namespacearm__compute.xhtml#a78fd1c0056e9add7ab01b8e118c0038d">arm_compute::execute_window_loop()</a>, <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00112">PPMLoader::is_open()</a>, <a class="el" href="classarm__compute_1_1_iterator.xhtml#a2f0d6383162e1af2df323c456a9335d3">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>
<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>
-<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="classtest__helpers_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, Format::U8, Format::RGB888);</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">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> Format::U8:</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">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>(Window::DimX, <a class="code" href="classarm__compute_1_1_window_1_1_dimension.xhtml">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>(Window::DimY, <a class="code" href="classarm__compute_1_1_window_1_1_dimension.xhtml">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">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#a78fd1c0056e9add7ab01b8e118c0038d">execute_window_loop</a>(window, [&](<span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_coordinates.xhtml">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> Format::RGB888:</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">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>(Window::DimY, <a class="code" href="classarm__compute_1_1_window_1_1_dimension.xhtml">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">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#a78fd1c0056e9add7ab01b8e118c0038d">execute_window_loop</a>(window, [&](<span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_coordinates.xhtml">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">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>
-<div class="ttc" id="classtest__helpers_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">test_helpers::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="test__helpers_2_utils_8h_source.xhtml#l00114">Utils.h:114</a></div></div>
+<div class="fragment"><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  {</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(!<a class="code" href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">is_open</a>());</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</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="l00144"></a><span class="lineno"> 144</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="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  {</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="preprocessor">#ifdef ARM_COMPUTE_CL</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment">// Map buffer if creating a CLTensor</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</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="l00150"></a><span class="lineno"> 150</span>  {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  image.map();</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> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="comment">// Check if the file is large enough to fill the image</span></div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> current_position = _fs.tellg();</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  _fs.seekg(0, std::ios_base::end);</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> end_position = _fs.tellg();</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  _fs.seekg(current_position, std::ios_base::beg);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> </div><div class="line"><a name="l00160"></a><span class="lineno"> 160</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="l00161"></a><span class="lineno"> 161</span>  <span class="stringliteral">"Not enough data in file"</span>);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <a class="code" href="_error_8h.xhtml#a4103adbb45806b2f2002d44b91d0d206">ARM_COMPUTE_UNUSED</a>(end_position);</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span> </div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">switch</span>(image.info()->format())</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">case</span> <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6669348b484e3008dca2bfa8e85e40b5">arm_compute::Format::U8</a>:</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="comment">// We need to convert the data from RGB to grayscale:</span></div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="comment">// Iterate through every pixel of the image</span></div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <a class="code" href="classarm__compute_1_1_window.xhtml">arm_compute::Window</a> window;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</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="l00172"></a><span class="lineno"> 172</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="l00173"></a><span class="lineno"> 173</span> </div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <a class="code" href="classarm__compute_1_1_iterator.xhtml">arm_compute::Iterator</a> out(&image, window);</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>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> red = 0;</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> green = 0;</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> blue = 0;</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> </div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <a class="code" href="namespacearm__compute.xhtml#a78fd1c0056e9add7ab01b8e118c0038d">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="l00181"></a><span class="lineno"> 181</span>  {</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  red = _fs.get();</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  green = _fs.get();</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  blue = _fs.get();</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  *out.ptr() = 0.2126f * red + 0.7152f * green + 0.0722f * blue;</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);</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>  <span class="keywordflow">break</span>;</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">case</span> <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a30ff380a3be74628024063a99fba10f0">arm_compute::Format::RGB888</a>:</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="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="l00195"></a><span class="lineno"> 195</span>  <span class="comment">// Create a vertical window to iterate through the image's rows:</span></div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="classarm__compute_1_1_window.xhtml">arm_compute::Window</a> window;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</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="l00198"></a><span class="lineno"> 198</span> </div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <a class="code" href="classarm__compute_1_1_iterator.xhtml">arm_compute::Iterator</a> out(&image, window);</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="namespacearm__compute.xhtml#a78fd1c0056e9add7ab01b8e118c0038d">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="l00202"></a><span class="lineno"> 202</span>  {</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</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="l00204"></a><span class="lineno"> 204</span>  _fs.read(reinterpret_cast<std::fstream::char_type *>(out.ptr()), _width * image.info()->element_size());</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  },</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  out);</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>  <span class="keywordflow">break</span>;</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">default</span>:</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</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="l00212"></a><span class="lineno"> 212</span>  }</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> </div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span> <span class="preprocessor">#ifdef ARM_COMPUTE_CL</span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="comment">// Unmap buffer if creating a CLTensor</span></div><div class="line"><a name="l00216"></a><span class="lineno"> 216</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="l00217"></a><span class="lineno"> 217</span>  {</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  image.unmap();</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> <span class="preprocessor">#endif</span></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="keywordflow">catch</span>(<span class="keyword">const</span> std::ifstream::failure &e)</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>  <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="l00225"></a><span class="lineno"> 225</span>  }</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</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>
+<div class="ttc" id="classtest__helpers_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">test_helpers::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="test__helpers_2_utils_8h_source.xhtml#l00112">Utils.h:112</a></div></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>
<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#l00215">Validate.h:215</a></div></div>
<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>
<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#l00100">Error.h:100</a></div></div>
<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>
+<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>
+<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>
<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>
<div class="ttc" id="namespacearm__compute_xhtml_a78fd1c0056e9add7ab01b8e118c0038d"><div class="ttname"><a href="namespacearm__compute.xhtml#a78fd1c0056e9add7ab01b8e118c0038d">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>
<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>
-<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="_helpers_8h_source.xhtml#l00210">Helpers.h:210</a></div></div>
+<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>
+<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="_helpers_8h_source.xhtml#l00223">Helpers.h:223</a></div></div>
<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>
<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#l00091">Error.h:91</a></div></div>
<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>
</div><!-- fragment -->
</div>
</div>
-<a class="anchor" id="a283b961e6ca7b117b106c8710c7cfe81"></a>
+<a class="anchor" id="a69f2a0e263d4f77d1e166de9cd2746f7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a> </td>
+ <td class="paramtype"><a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">arm_compute::Format</a> </td>
<td class="paramname"><em>format</em> </td>
</tr>
<tr>
</dd>
</dl>
-<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00125">125</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
+<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00123">123</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
-<p>References <a class="el" href="_error_8h_source.xhtml#l00100">ARM_COMPUTE_ERROR_ON</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>
+<p>References <a class="el" href="_error_8h_source.xhtml#l00100">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00112">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>
<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>
-<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="classtest__helpers_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 != Format::RGB888 && format != Format::U8);</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">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="classtest__helpers_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">test_helpers::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="test__helpers_2_utils_8h_source.xhtml#l00114">Utils.h:114</a></div></div>
+<div class="fragment"><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  {</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(!<a class="code" href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">is_open</a>());</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</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="l00127"></a><span class="lineno"> 127</span> </div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="comment">// Use the size of the input PPM image</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</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="l00130"></a><span class="lineno"> 130</span>  image.allocator()->init(image_info);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  }</div><div class="ttc" id="classtest__helpers_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">test_helpers::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="test__helpers_2_utils_8h_source.xhtml#l00112">Utils.h:112</a></div></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>
<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#l00100">Error.h:100</a></div></div>
+<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>
<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#l00040">TensorInfo.h:40</a></div></div>
</div><!-- fragment -->
</div>
<p>Return true if a PPM file is currently open. </p>
-<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00114">114</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
+<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00112">112</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
-<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>
-<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 -->
+<p>Referenced by <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00140">PPMLoader::fill_image()</a>, <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00123">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="test__helpers_2_utils_8h_source.xhtml#l00092">PPMLoader::open()</a>.</p>
+<div class="fragment"><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  {</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keywordflow">return</span> _fs.is_open();</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  }</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a36e58f3e64f3851ebac7a9556b4704ed"></a>
</dd>
</dl>
-<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00094">94</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
+<p>Definition at line <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00092">92</a> of file <a class="el" href="test__helpers_2_utils_8h_source.xhtml">Utils.h</a>.</p>
-<p>References <a class="el" href="_error_8h_source.xhtml#l00031">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00100">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="_error_8h_source.xhtml#l00091">ARM_COMPUTE_ERROR_ON_MSG</a>, and <a class="el" href="_utils_8cpp_source.xhtml#l00136">test_helpers::parse_ppm_header()</a>.</p>
+<p>References <a class="el" href="_error_8h_source.xhtml#l00031">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00100">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="_error_8h_source.xhtml#l00091">ARM_COMPUTE_ERROR_ON_MSG</a>, <a class="el" href="test__helpers_2_utils_8h_source.xhtml#l00112">PPMLoader::is_open()</a>, and <a class="el" href="_utils_8cpp_source.xhtml#l00138">test_helpers::parse_ppm_header()</a>.</p>
<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>
-<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="classtest__helpers_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="namespacetest__helpers.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>
-<div class="ttc" id="classtest__helpers_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">test_helpers::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="test__helpers_2_utils_8h_source.xhtml#l00114">Utils.h:114</a></div></div>
+<div class="fragment"><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(<a class="code" href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">is_open</a>());</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  {</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  _fs.exceptions(std::ifstream::failbit | std::ifstream::badbit);</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  _fs.open(ppm_filename, std::ios::in | std::ios::binary);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> max_val = 0;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  std::tie(_width, _height, max_val) = <a class="code" href="namespacetest__helpers.xhtml#a3aa8f5f1b94f88fdf5b43a53e29379cf">parse_ppm_header</a>(_fs);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"> 103</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="l00104"></a><span class="lineno"> 104</span>  }</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">catch</span>(<span class="keyword">const</span> std::ifstream::failure &e)</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>  <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="l00108"></a><span class="lineno"> 108</span>  }</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</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>
+<div class="ttc" id="classtest__helpers_1_1_p_p_m_loader_xhtml_a2f57f54d8c03b615bb31eee091d8a88a"><div class="ttname"><a href="classtest__helpers_1_1_p_p_m_loader.xhtml#a2f57f54d8c03b615bb31eee091d8a88a">test_helpers::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="test__helpers_2_utils_8h_source.xhtml#l00112">Utils.h:112</a></div></div>
<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#l00100">Error.h:100</a></div></div>
-<div class="ttc" id="namespacetest__helpers_xhtml_a3aa8f5f1b94f88fdf5b43a53e29379cf"><div class="ttname"><a href="namespacetest__helpers.xhtml#a3aa8f5f1b94f88fdf5b43a53e29379cf">test_helpers::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_8cpp_source.xhtml#l00136">Utils.cpp:136</a></div></div>
+<div class="ttc" id="namespacetest__helpers_xhtml_a3aa8f5f1b94f88fdf5b43a53e29379cf"><div class="ttname"><a href="namespacetest__helpers.xhtml#a3aa8f5f1b94f88fdf5b43a53e29379cf">test_helpers::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_8cpp_source.xhtml#l00138">Utils.cpp:138</a></div></div>
<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#l00091">Error.h:91</a></div></div>
</div><!-- fragment -->
</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacetest__helpers.xhtml">test_helpers</a></li><li class="navelem"><a class="el" href="classtest__helpers_1_1_p_p_m_loader.xhtml">PPMLoader</a></li>
- <li class="footer">Generated on Wed Apr 12 2017 14:26:06 for ARM Compute Library by
+ <li class="footer">Generated on Wed May 3 2017 17:20:05 for ARM 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>