identiconpp/docs/classIdenticonpp.html

138 lines
8.4 KiB
HTML

<!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.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>identiconpp: Identiconpp 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="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.0.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<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('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classIdenticonpp-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Identiconpp Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Base class for identiconpp.
<a href="classIdenticonpp.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="identiconpp_8hpp_source.html">identiconpp.hpp</a>&gt;</code></p>
<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:a8a3d515d391ffbfdd4880bf215feb592"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIdenticonpp.html#a8a3d515d391ffbfdd4880bf215feb592">Identiconpp</a> (const uint8_t rows, const uint8_t columns, const string &amp;background=&quot;ffffffff&quot;, const vector&lt; string &gt; &amp;foreground={ &quot;000000ff&quot; })</td></tr>
<tr class="memdesc:a8a3d515d391ffbfdd4880bf215feb592"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialises an instance of <a class="el" href="classIdenticonpp.html" title="Base class for identiconpp. ">Identiconpp</a>. <a href="#a8a3d515d391ffbfdd4880bf215feb592">More...</a><br /></td></tr>
<tr class="separator:a8a3d515d391ffbfdd4880bf215feb592"><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>Base class for identiconpp. </p>
<p>Use this class for all your identicons. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a8a3d515d391ffbfdd4880bf215feb592"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a3d515d391ffbfdd4880bf215feb592">&#9670;&nbsp;</a></span>Identiconpp()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Identiconpp::Identiconpp </td>
<td>(</td>
<td class="paramtype">const uint8_t&#160;</td>
<td class="paramname"><em>rows</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const uint8_t&#160;</td>
<td class="paramname"><em>columns</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const string &amp;&#160;</td>
<td class="paramname"><em>background</em> = <code>&quot;ffffffff&quot;</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const vector&lt; string &gt; &amp;&#160;</td>
<td class="paramname"><em>foreground</em> = <code>{&#160;&quot;000000ff&quot;&#160;}</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialises an instance of <a class="el" href="classIdenticonpp.html" title="Base class for identiconpp. ">Identiconpp</a>. </p>
<p>The instance can be used for creating identicons with differing image formats and sizes. Will throw <code>std::invalid_argument</code> if an argument is invalid.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rows</td><td>Number of rows </td></tr>
<tr><td class="paramname">columns</td><td>Number of columns </td></tr>
<tr><td class="paramname">background</td><td>Background color, hexadecimal, rrggbbaa </td></tr>
<tr><td class="paramname">foreground</td><td>vector of foreground colors </td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;: _rows(rows)</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;, _columns(columns)</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;, _background(background)</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;, _foreground(foreground)</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;{</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <span class="comment">// TODO: Check rows and columns</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <span class="keywordflow">if</span> (_background.size() != 8)</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Background color has the wrong format: &quot;</span> +</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; _background);</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; }</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;color : _foreground)</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keywordflow">if</span> (color.size() != 8)</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; {</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Foreground color has the wrong format: &quot;</span> +</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; color);</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; }</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; }</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="identiconpp_8hpp_source.html">identiconpp.hpp</a></li>
<li>src/identiconpp.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>