diff --git a/docs/annotated.html b/docs/annotated.html index 253417d..138e38c 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/classIdenticonpp-members.html b/docs/classIdenticonpp-members.html index fc077fe..0f6f322 100644 --- a/docs/classIdenticonpp-members.html +++ b/docs/classIdenticonpp-members.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/classIdenticonpp.html b/docs/classIdenticonpp.html index bd83c27..f45a429 100644 --- a/docs/classIdenticonpp.html +++ b/docs/classIdenticonpp.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
@@ -220,7 +220,7 @@ Public Member Functions
Returns
The image as Magick::Image
Examples:
example.cpp.
-
45 {
46  ttdebug << "Using digest: " << digest << '\n';
47  check_entropy(digest, _type);
48  const std::int16_t imgwidth = width - _padding[0] * 2;
49  const std::int16_t imgheight =
50  std::round(static_cast<float>(imgwidth) / _columns * _rows);
51  ttdebug << "width: " << std::to_string(imgwidth)
52  << "+" << std::to_string(_padding[0] * 2)
53  << ", height: " << std::to_string(imgheight)
54  << "+" << std::to_string(_padding[1] * 2)
55  << "\n";
56  if (imgwidth <= 0 || imgheight <= 0)
57  {
58  throw std::invalid_argument("Width or height is zero or less.");
59  }
60  Magick::Image img;
61 
62  switch (_type)
63  {
64  case algorithm::ltr_symmetric:
65  {
66  img = generate_ltr_symmetric(digest);
67  break;
68  }
69  case algorithm::ltr_asymmetric:
70  {
71  img = generate_ltr_asymmetric(digest);
72  break;
73  }
74  case algorithm::sigil:
75  {
76  img = generate_sigil(digest);
77  break;
78  }
79  }
80 
81  img.backgroundColor(Magick::Color('#' + _background));
82  img.scale(Magick::Geometry(imgwidth, imgheight));
83  img.borderColor(Magick::Color('#' + _background));
84  img.border(Magick::Geometry(_padding[0], _padding[1]));
85  return img;
86 }
Generates symmetric (vertically mirrored) identicons.
+
45 {
46  ttdebug << "Using digest: " << digest << '\n';
47  check_entropy(digest, _type);
48  const std::int16_t imgwidth = width - _padding[0] * 2;
49  const std::int16_t imgheight =
50  std::round(static_cast<float>(imgwidth) / _columns * _rows);
51  ttdebug << "width: " << std::to_string(imgwidth)
52  << "+" << std::to_string(_padding[0] * 2)
53  << ", height: " << std::to_string(imgheight)
54  << "+" << std::to_string(_padding[1] * 2)
55  << "\n";
56  if (imgwidth <= 0 || imgheight <= 0)
57  {
58  throw std::invalid_argument("Width or height is zero or less.");
59  }
60  Magick::Image img;
61 
62  switch (_type)
63  {
65  {
66  img = generate_ltr_symmetric(digest);
67  break;
68  }
70  {
71  img = generate_ltr_asymmetric(digest);
72  break;
73  }
74  case algorithm::sigil:
75  {
76  img = generate_sigil(digest);
77  break;
78  }
79  }
80 
81  img.scale(Magick::Geometry(imgwidth, imgheight));
82  // The CompositeOperator prevents the background color to be affected by the
83  // frame color. See https://github.com/ImageMagick/ImageMagick/issues/647
84  img.compose(Magick::CompositeOperator::CopyCompositeOp);
85  img.matteColor(Magick::Color('#' + _background));
86  img.frame(Magick::Geometry(_padding[0], _padding[1]));
87  return img;
88 }
Generates symmetric (vertically mirrored) identicons.
Generates asymmetric identicons.
diff --git a/docs/classes.html b/docs/classes.html index 2ab0030..5f569ea 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/debug_8hpp_source.html b/docs/debug_8hpp_source.html index b871ded..19f3619 100644 --- a/docs/debug_8hpp_source.html +++ b/docs/debug_8hpp_source.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 1a6c676..e7f3cae 100644 --- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/example_8cpp-example.html b/docs/example_8cpp-example.html index e6d413c..b86b299 100644 --- a/docs/example_8cpp-example.html +++ b/docs/example_8cpp-example.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/examples.html b/docs/examples.html index 2338186..f9a4e4e 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/files.html b/docs/files.html index be0639e..a399056 100644 --- a/docs/files.html +++ b/docs/files.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/functions.html b/docs/functions.html index 52ae25c..b831385 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/functions_enum.html b/docs/functions_enum.html index 1af8aae..e226e3d 100644 --- a/docs/functions_enum.html +++ b/docs/functions_enum.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/functions_func.html b/docs/functions_func.html index 281dee1..aa0dc36 100644 --- a/docs/functions_func.html +++ b/docs/functions_func.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/identiconpp_8hpp_source.html b/docs/identiconpp_8hpp_source.html index 4be6594..8428e06 100644 --- a/docs/identiconpp_8hpp_source.html +++ b/docs/identiconpp_8hpp_source.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
diff --git a/docs/index.html b/docs/index.html index dcce63f..bd9ffe1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -19,7 +19,7 @@
identiconpp -  0.3.4 +  0.3.6
@@ -86,12 +86,17 @@ $(function() {
  • C++ compiler (tested: gcc 5/6/7/8, clang 5/6)
  • cmake (at least 3.2)
  • imagemagick (tested: 7.0 / 6.7)
  • +
  • Optional: +
  • On a Debian system, install the packages: build-essential cmake libmagick++-dev.

    Compile

    mkdir build
    cd build
    cmake ..
    make
    make install
    cmake options