From 97ec8d60ed71b9e090290c7071704fc4f1415b69 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 26 Dec 2018 19:25:03 +0100 Subject: [PATCH] 2018-12-26 --- docs/annotated.html | 2 +- docs/classIdenticonpp-members.html | 2 +- docs/classIdenticonpp.html | 9 ++++-- docs/classes.html | 2 +- docs/debug_8hpp_source.html | 2 +- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 2 +- docs/files.html | 2 +- docs/functions.html | 2 +- docs/functions_enum.html | 2 +- docs/functions_func.html | 2 +- docs/identiconpp_8hpp_source.html | 6 ++-- docs/index.html | 30 +++++++++++++++---- 12 files changed, 43 insertions(+), 20 deletions(-) diff --git a/docs/annotated.html b/docs/annotated.html index cd8729e..18dbea5 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/classIdenticonpp-members.html b/docs/classIdenticonpp-members.html index 504a084..6271a56 100644 --- a/docs/classIdenticonpp-members.html +++ b/docs/classIdenticonpp-members.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/classIdenticonpp.html b/docs/classIdenticonpp.html index c6158f7..72b6483 100644 --- a/docs/classIdenticonpp.html +++ b/docs/classIdenticonpp.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
@@ -165,7 +165,7 @@ Public Member Functions -
29 : _rows(rows)
30 , _columns(columns)
31 , _type(type)
32 , _background(background)
33 , _foreground(foreground)
34 {
35  check_color(background);
36 
37  for (const string &color : foreground)
38  {
39  check_color(color);
40  }
41 }
+
28 : _rows(rows)
29 , _columns(columns)
30 , _type(type)
31 , _background(background)
32 , _foreground(foreground)
33 {
34  check_color(background);
35 
36  for (const string &color : foreground)
37  {
38  check_color(color);
39  }
40 }

Member Function Documentation

@@ -204,12 +204,15 @@ Public Member Functions
Returns
The image
-
44 {
45  check_entropy(digest, _type);
46  const uint16_t height = width / _columns * _rows;
47  ttdebug << "width: " << std::to_string(width)
48  << ", height: " << std::to_string(height) << "\n";
49 
50  switch (_type)
51  {
52  case identicon_type::simple:
53  {
54  return generate_simple(digest, width, height);
55  }
56  case identicon_type::libravatar:
57  case identicon_type::sigil:
58  {
59  return generate_libravatar(digest, width, height);
60  }
61  }
62 }
+
43 {
44  check_entropy(digest, _type);
45  const uint16_t height = width / _columns * _rows;
46  ttdebug << "width: " << std::to_string(width)
47  << ", height: " << std::to_string(height) << "\n";
48 
49  switch (_type)
50  {
51  case identicon_type::simple:
52  {
53  return generate_simple(digest, width, height);
54  }
55  case identicon_type::libravatar:
56  case identicon_type::sigil:
57  {
58  return generate_libravatar(digest, width, height);
59  }
60  }
61 }

The documentation for this class was generated from the following files: diff --git a/docs/classes.html b/docs/classes.html index d3b26ab..5d53edc 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/debug_8hpp_source.html b/docs/debug_8hpp_source.html index c636a83..2ab618f 100644 --- a/docs/debug_8hpp_source.html +++ b/docs/debug_8hpp_source.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html index c8c95ea..1681bdd 100644 --- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/files.html b/docs/files.html index 8056853..8b37fcb 100644 --- a/docs/files.html +++ b/docs/files.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/functions.html b/docs/functions.html index 0f4fb02..8f88632 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/functions_enum.html b/docs/functions_enum.html index ddfc4f6..61a1352 100644 --- a/docs/functions_enum.html +++ b/docs/functions_enum.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/functions_func.html b/docs/functions_func.html index 5d7baf3..12df465 100644 --- a/docs/functions_func.html +++ b/docs/functions_func.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
diff --git a/docs/identiconpp_8hpp_source.html b/docs/identiconpp_8hpp_source.html index f2a2ffd..d525da2 100644 --- a/docs/identiconpp_8hpp_source.html +++ b/docs/identiconpp_8hpp_source.html @@ -19,7 +19,7 @@
identiconpp -  0.1.1 +  0.1.2
@@ -48,9 +48,9 @@ $(function() {
1 /* This file is part of identiconpp.
2  * Copyright © 2018 tastytea <tastytea@tastytea.de>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #include <cstdint>
18 #include <string>
19 #include <vector>
20 #include <Magick++/Image.h>
21 
22 using std::uint8_t;
23 using std::uint16_t;
24 using std::string;
25 using std::vector;
26 
34 {
35 public:
41  enum class identicon_type
42  {
43  simple,
44  libravatar,
45  sigil
46  };
47 
61  explicit Identiconpp(const uint8_t rows, const uint8_t columns,
62  identicon_type type = identicon_type::simple,
63  const string &background = "ffffffff",
64  const vector<string> &foreground = { "000000ff" } );
65 
74  Magick::Image generate(const string &digest, const uint16_t width = 100);
75 
76 private:
77  const uint8_t _rows;
78  const uint8_t _columns;
79  const identicon_type _type;
80  const string _background;
81  const vector<string> _foreground;
82 
92  Magick::Image generate_simple(const string &digest,
93  const uint16_t width,
94  const uint16_t height);
95 
105  Magick::Image generate_libravatar(const string &digest,
106  const uint16_t width,
107  const uint16_t height);
108 
117  void check_entropy(const string &digest, identicon_type type);
118 
127  bool get_bit(const uint16_t bit, const string &digest);
128 
139  Magick::Color get_color(const uint16_t firstbit, const string &digest);
140 
148  static bool not_hex(const char c);
149 
155  void check_color(const string &color);
156 };
identicon_type
List of identicon types.
Definition: identiconpp.hpp:41
-
Magick::Image generate(const string &digest, const uint16_t width=100)
Generates identicon from digest.
Definition: identiconpp.cpp:43
+
Magick::Image generate(const string &digest, const uint16_t width=100)
Generates identicon from digest.
Definition: identiconpp.cpp:42
Base class for identiconpp.
Definition: identiconpp.hpp:33
-
Identiconpp(const uint8_t rows, const uint8_t columns, identicon_type type=identicon_type::simple, const string &background="ffffffff", const vector< string > &foreground={ "000000ff" })
Initialises an instance of Identiconpp.
Definition: identiconpp.cpp:25
+
Identiconpp(const uint8_t rows, const uint8_t columns, identicon_type type=identicon_type::simple, const string &background="ffffffff", const vector< string > &foreground={ "000000ff" })
Initialises an instance of Identiconpp.
Definition: identiconpp.cpp:24