blob: f9a1fe705b3931d2a6ecb826f65e50a1bec97560 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.15-->
<!-- Remember to use version doxygen 1.8.15 +-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>Compute Library: PPMLoader Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<img alt="Compute Library" src="https://raw.githubusercontent.com/ARM-software/ComputeLibrary/gh-pages/ACL_logo.png" style="max-width: 100%;margin-top: 15px;margin-left: 10px"/>
<td style="padding-left: 0.5em;">
<div id="projectname">
&#160;<span id="projectnumber">19.08</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">PPMLoader Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>PPM <a class="el" href="struct_image.xhtml" title="Structure to hold Image information.">Image</a> loader concrete implementation.
<a href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_image_loader_8h_source.xhtml">ImageLoader.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for PPMLoader:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classarm__compute_1_1utils_1_1_p_p_m_loader__coll__graph.svg" width="120" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.xhtml">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a49afa04c8a5fd9ead48e07440b37294c"><td class="memItemLeft" align="right" valign="top">&#160;</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>
<tr class="memdesc:a49afa04c8a5fd9ead48e07440b37294c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Constructor. <a href="#a49afa04c8a5fd9ead48e07440b37294c">More...</a><br /></td></tr>
<tr class="separator:a49afa04c8a5fd9ead48e07440b37294c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1d89f579133c9b6779d43f4a1489874"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#ab1d89f579133c9b6779d43f4a1489874">is_open</a> () override</td></tr>
<tr class="memdesc:ab1d89f579133c9b6779d43f4a1489874"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if the image file is currently open. <a href="#ab1d89f579133c9b6779d43f4a1489874">More...</a><br /></td></tr>
<tr class="separator:ab1d89f579133c9b6779d43f4a1489874"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab23b23a466d459ecbad7d046bb085324"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#ab23b23a466d459ecbad7d046bb085324">open</a> (const std::string &amp;filename) override</td></tr>
<tr class="memdesc:ab23b23a466d459ecbad7d046bb085324"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open an image file and reads its metadata (Width, height) <a href="#ab23b23a466d459ecbad7d046bb085324">More...</a><br /></td></tr>
<tr class="separator:ab23b23a466d459ecbad7d046bb085324"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7008bca493d69ea65f12e0940f3a6886"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#a7008bca493d69ea65f12e0940f3a6886">close</a> () override</td></tr>
<tr class="memdesc:a7008bca493d69ea65f12e0940f3a6886"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes an image file. <a href="#a7008bca493d69ea65f12e0940f3a6886">More...</a><br /></td></tr>
<tr class="separator:a7008bca493d69ea65f12e0940f3a6886"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarm__compute_1_1utils_1_1_i_image_loader')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml">IImageLoader</a></td></tr>
<tr class="memitem:a76b531ca14f333b04c1d97042dd73c16 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a76b531ca14f333b04c1d97042dd73c16">IImageLoader</a> ()</td></tr>
<tr class="memdesc:a76b531ca14f333b04c1d97042dd73c16 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Constructor. <a href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a76b531ca14f333b04c1d97042dd73c16">More...</a><br /></td></tr>
<tr class="separator:a76b531ca14f333b04c1d97042dd73c16 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9caf88dbc64be1a6ef22716c0eaf46cf inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a9caf88dbc64be1a6ef22716c0eaf46cf">~IImageLoader</a> ()=default</td></tr>
<tr class="memdesc:a9caf88dbc64be1a6ef22716c0eaf46cf inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual base destructor. <a href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a9caf88dbc64be1a6ef22716c0eaf46cf">More...</a><br /></td></tr>
<tr class="separator:a9caf88dbc64be1a6ef22716c0eaf46cf inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f0f3e5dd09a150b2cc221c01804d1a7 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a7f0f3e5dd09a150b2cc221c01804d1a7">width</a> () const</td></tr>
<tr class="memdesc:a7f0f3e5dd09a150b2cc221c01804d1a7 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the width of the currently open image file. <a href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a7f0f3e5dd09a150b2cc221c01804d1a7">More...</a><br /></td></tr>
<tr class="separator:a7f0f3e5dd09a150b2cc221c01804d1a7 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc7679009b582b99d859c0edfc35aa4a inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#adc7679009b582b99d859c0edfc35aa4a">height</a> () const</td></tr>
<tr class="memdesc:adc7679009b582b99d859c0edfc35aa4a inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the height of the currently open image file. <a href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#adc7679009b582b99d859c0edfc35aa4a">More...</a><br /></td></tr>
<tr class="separator:adc7679009b582b99d859c0edfc35aa4a inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a283b961e6ca7b117b106c8710c7cfe81 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a283b961e6ca7b117b106c8710c7cfe81 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a283b961e6ca7b117b106c8710c7cfe81">init_image</a> (T &amp;image, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a> format)</td></tr>
<tr class="memdesc:a283b961e6ca7b117b106c8710c7cfe81 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialise an image's metadata with the dimensions of the image file currently open. <a href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a283b961e6ca7b117b106c8710c7cfe81">More...</a><br /></td></tr>
<tr class="separator:a283b961e6ca7b117b106c8710c7cfe81 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1672610b872bef30d0dc2333a0ffc402 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a1672610b872bef30d0dc2333a0ffc402 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a1672610b872bef30d0dc2333a0ffc402">fill_image</a> (T &amp;image)</td></tr>
<tr class="memdesc:a1672610b872bef30d0dc2333a0ffc402 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fill an image with the content of the currently open image file. <a href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a1672610b872bef30d0dc2333a0ffc402">More...</a><br /></td></tr>
<tr class="separator:a1672610b872bef30d0dc2333a0ffc402 inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c3f70e1caee95bb95c62346e130e5ab inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a7c3f70e1caee95bb95c62346e130e5ab inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a7c3f70e1caee95bb95c62346e130e5ab">fill_planar_tensor</a> (T &amp;tensor, bool bgr=false)</td></tr>
<tr class="memdesc:a7c3f70e1caee95bb95c62346e130e5ab inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fill a tensor with 3 planes (one for each channel) with the content of the currently open image file. <a href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a7c3f70e1caee95bb95c62346e130e5ab">More...</a><br /></td></tr>
<tr class="separator:a7c3f70e1caee95bb95c62346e130e5ab inherit pub_methods_classarm__compute_1_1utils_1_1_i_image_loader"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>PPM <a class="el" href="struct_image.xhtml" title="Structure to hold Image information.">Image</a> loader concrete implementation. </p>
<p class="definition">Definition at line <a class="el" href="_image_loader_8h_source.xhtml#l00357">357</a> of file <a class="el" href="_image_loader_8h_source.xhtml">ImageLoader.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a49afa04c8a5fd9ead48e07440b37294c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a49afa04c8a5fd9ead48e07440b37294c">&#9670;&nbsp;</a></span>PPMLoader()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml">PPMLoader</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Default Constructor. </p>
<p class="definition">Definition at line <a class="el" href="_image_loader_8h_source.xhtml#l00361">361</a> of file <a class="el" href="_image_loader_8h_source.xhtml">ImageLoader.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; : <a class="code" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a76b531ca14f333b04c1d97042dd73c16">IImageLoader</a>(), _fs()</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; {</div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; }</div><div class="ttc" id="classarm__compute_1_1utils_1_1_i_image_loader_xhtml_a76b531ca14f333b04c1d97042dd73c16"><div class="ttname"><a href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a76b531ca14f333b04c1d97042dd73c16">arm_compute::utils::IImageLoader::IImageLoader</a></div><div class="ttdeci">IImageLoader()</div><div class="ttdoc">Default Constructor.</div><div class="ttdef"><b>Definition:</b> <a href="_image_loader_8h_source.xhtml#l00129">ImageLoader.h:129</a></div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a7008bca493d69ea65f12e0940f3a6886"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7008bca493d69ea65f12e0940f3a6886">&#9670;&nbsp;</a></span>close()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Closes an image file. </p>
<p>Implements <a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#af6ee7eacbde6b379b68d954e44f6e549">IImageLoader</a>.</p>
<p class="definition">Definition at line <a class="el" href="_image_loader_8h_source.xhtml#l00392">392</a> of file <a class="el" href="_image_loader_8h_source.xhtml">ImageLoader.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; {</div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#ab1d89f579133c9b6779d43f4a1489874">is_open</a>())</div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; {</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; _fs.close();</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; _feeder = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; }</div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <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#ab1d89f579133c9b6779d43f4a1489874">is_open</a>());</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; }</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#l00337">Error.h:337</a></div></div>
<div class="ttc" id="classarm__compute_1_1utils_1_1_p_p_m_loader_xhtml_ab1d89f579133c9b6779d43f4a1489874"><div class="ttname"><a href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#ab1d89f579133c9b6779d43f4a1489874">arm_compute::utils::PPMLoader::is_open</a></div><div class="ttdeci">bool is_open() override</div><div class="ttdoc">Return true if the image file is currently open.</div><div class="ttdef"><b>Definition:</b> <a href="_image_loader_8h_source.xhtml#l00367">ImageLoader.h:367</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00337">ARM_COMPUTE_ERROR_ON</a>, and <a class="el" href="_image_loader_8h_source.xhtml#l00367">PPMLoader::is_open()</a>.</p>
</div>
</div>
<a id="ab1d89f579133c9b6779d43f4a1489874"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab1d89f579133c9b6779d43f4a1489874">&#9670;&nbsp;</a></span>is_open()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool is_open </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return true if the image file is currently open. </p>
<p>Implements <a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#a25c255918a7306769a9e3886166af935">IImageLoader</a>.</p>
<p class="definition">Definition at line <a class="el" href="_image_loader_8h_source.xhtml#l00367">367</a> of file <a class="el" href="_image_loader_8h_source.xhtml">ImageLoader.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160; {</div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160; <span class="keywordflow">return</span> _fs.is_open();</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; }</div></div><!-- fragment -->
<p class="reference">Referenced by <a class="el" href="_image_loader_8h_source.xhtml#l00392">PPMLoader::close()</a>, and <a class="el" href="_image_loader_8h_source.xhtml#l00371">PPMLoader::open()</a>.</p>
</div>
</div>
<a id="ab23b23a466d459ecbad7d046bb085324"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab23b23a466d459ecbad7d046bb085324">&#9670;&nbsp;</a></span>open()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void open </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Open an image file and reads its metadata (Width, height) </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">filename</td><td>File to open </td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classarm__compute_1_1utils_1_1_i_image_loader.xhtml#ab646a9b1297198d7c9e2e809c29b7391">IImageLoader</a>.</p>
<p class="definition">Definition at line <a class="el" href="_image_loader_8h_source.xhtml#l00371">371</a> of file <a class="el" href="_image_loader_8h_source.xhtml">ImageLoader.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; {</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; <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#ab1d89f579133c9b6779d43f4a1489874">is_open</a>());</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <span class="keywordflow">try</span></div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; {</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160; _fs.exceptions(std::ifstream::failbit | std::ifstream::badbit);</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; _fs.open(filename, std::ios::in | std::ios::binary);</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160;</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> max_val = 0;</div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; 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="l00381"></a><span class="lineno"> 381</span>&#160;</div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(max_val &gt;= 256, <span class="stringliteral">&quot;2 bytes per colour channel not supported in file %s&quot;</span>,</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; filename.c_str());</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160;</div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; _feeder = support::cpp14::make_unique&lt;FileImageFeeder&gt;(_fs);</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; }</div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; <span class="keywordflow">catch</span>(std::runtime_error &amp;e)</div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; {</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; <a class="code" href="_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">&quot;Accessing %s: %s&quot;</span>, filename.c_str(), e.what());</div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; }</div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; }</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#l00261">Error.h:261</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#l00337">Error.h:337</a></div></div>
<div class="ttc" id="classarm__compute_1_1utils_1_1_p_p_m_loader_xhtml_ab1d89f579133c9b6779d43f4a1489874"><div class="ttname"><a href="classarm__compute_1_1utils_1_1_p_p_m_loader.xhtml#ab1d89f579133c9b6779d43f4a1489874">arm_compute::utils::PPMLoader::is_open</a></div><div class="ttdeci">bool is_open() override</div><div class="ttdoc">Return true if the image file is currently open.</div><div class="ttdef"><b>Definition:</b> <a href="_image_loader_8h_source.xhtml#l00367">ImageLoader.h:367</a></div></div>
<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&lt; unsigned int, unsigned int, int &gt; parse_ppm_header(std::ifstream &amp;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#l00193">Utils.cpp:193</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#l00328">Error.h:328</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00261">ARM_COMPUTE_ERROR</a>, <a class="el" href="_error_8h_source.xhtml#l00337">ARM_COMPUTE_ERROR_ON</a>, <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON_MSG</a>, <a class="el" href="_image_loader_8h_source.xhtml#l00367">PPMLoader::is_open()</a>, and <a class="el" href="utils_2_utils_8cpp_source.xhtml#l00193">arm_compute::utils::parse_ppm_header()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>utils/<a class="el" href="_image_loader_8h_source.xhtml">ImageLoader.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="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>
<li class="footer">Generated on Mon Sep 2 2019 11:47:42 for Compute Library by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
</ul>
</div>
</body>
</html>