2018-12-28

This commit is contained in:
tastytea 2018-12-28 02:03:27 +01:00
parent 61a0986bfd
commit 5a5d4311b1
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
12 changed files with 85 additions and 27 deletions

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">identiconpp
&#160;<span id="projectnumber">0.3.1</span>
&#160;<span id="projectnumber">0.3.4</span>
</div>
</td>
</tr>
@ -43,8 +43,20 @@ $(function() {
<div class="title">identiconpp Documentation</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><b>identiconpp</b> is a library to generate identicons. Written in C++.</p>
<div class="textblock"><p><b>identiconpp</b> is a library to generate identicons for C++.</p>
<p>You get the images as <code>Magick::Image</code>. This allows you to make all kinds of modifications.</p>
<div class="image">
<img src="https://doc.schlomp.space/identiconpp/identicon1.png" title="4x4 identicon, ltr_symmetric, 20px padding"/>
</div>
<div class="image">
<img src="https://doc.schlomp.space/identiconpp/identicon2.png" title="5x5 identicon, sigil"/>
</div>
<div class="image">
<img src="https://doc.schlomp.space/identiconpp/identicon3.png" title="5x5 identicon, ltr_asymmetric"/>
</div>
<div class="image">
<img src="https://doc.schlomp.space/identiconpp/identicon4.png" title="6x4 identicon, ltr_symmetric, 10px padding"/>
</div>
<h2>Features</h2>
<ul>
<li>[x] Symmetric identicons</li>
@ -55,6 +67,7 @@ $(function() {
<h2>Usage</h2>
<p>The HTML reference can be generated with build_doc.sh, if doxygen is installed. It is also available at <a href="https://doc.schlomp.space/identiconpp/classIdenticonpp.html">doc.schlomp.space/identiconpp/</a>.</p>
<p>You need to generate hashes yourself, any hexadecimal string will do. Make sure to use a safe hashing algorithm for sensitive data (<b>not MD5</b>). You can select as many columns and rows as you like, but make sure you have enough entropy. If something seems to be wrong, exceptions will be thrown.</p>
<p>The "sigil" algorithm generates the same results as <a href="https://github.com/cupcake/sigil/">sigil</a> and <a href="https://github.com/azaghal/pydenticon/">pydenticon</a>.</p>
<h3>Example</h3>
<div class="fragment"><div class="line">{C++}</div><div class="line">// Compile with g++ $(Magick++-config --cppflags --ldflags) -lidenticonpp</div><div class="line">#include &lt;identiconpp.hpp&gt;</div><div class="line">#include &lt;Magick++/Image.h&gt;</div><div class="line"></div><div class="line">int main()</div><div class="line">{</div><div class="line"> Identiconpp identicon(5, 5, Identiconpp::algorithm::ltr_symmetric,</div><div class="line"> &quot;ffffff80&quot;, { &quot;800000ff&quot; }, { 10, 10 });</div><div class="line"> Magick::Image img;</div><div class="line"> img = identicon.generate(&quot;55502f40dc8b7c769880b10874abc9d0&quot;, 200);</div><div class="line"> img.write(&quot;identicon.png&quot;);</div><div class="line">}</div></div><!-- fragment --><h2>Install</h2>
<h3>Gentoo</h3>
@ -103,7 +116,10 @@ $(function() {
<li>Pixels are drawn from left to right, top to bottom.</li>
<li>Use bits from digest to determine if a pixel is painted(1) or not(0).</li>
<li>Mirror the pixels vertically.</li>
<li>Use the following bits to pick the foreground color.</li>
<li>Use the following bits to pick the foreground color.<ul>
<li>You need <code>floor(log2(n_colors)) + 1</code> bits.</li>
</ul>
</li>
<li>Scale image proportionally to requested width.</li>
</ul>
<div class="fragment"><div class="line"> 0111 0011 1101 1100 […] 1111 0111 0101 0111</div><div class="line">^ ^</div><div class="line">+----------------------------+--------------&gt;</div><div class="line"> | |</div><div class="line"> pixel matrix foreground color</div></div><!-- fragment --><p>Implemented in <a href="https://schlomp.space/tastytea/identiconpp/src/branch/master/src/ltr_symmetric.cpp">ltr_symmetric.cpp</a></p>
@ -113,7 +129,10 @@ $(function() {
<li>Set background color.</li>
<li>Pixels are drawn from left to right, top to bottom.</li>
<li>Use bits from digest to determine if a pixel is painted(1) or not(0).</li>
<li>Use the following bits to pick the foreground color.</li>
<li>Use the following bits to pick the foreground color.<ul>
<li>* You need <code>floor(log2(n_colors)) + 1</code> bits.</li>
</ul>
</li>
<li>Scale image proportionally to requested width.</li>
</ul>
<div class="fragment"><div class="line"> 0111 0011 1101 1100 […] 1111 0111 0101 0111</div><div class="line">^ ^</div><div class="line">+----------------------------+--------------&gt;</div><div class="line"> | |</div><div class="line"> pixel matrix foreground color</div></div><!-- fragment --><p>Implemented in <a href="https://schlomp.space/tastytea/identiconpp/src/branch/master/src/ltr_asymmetric.cpp">ltr_asymmetric.cpp</a></p>