Browse Source

Changed padding to not have const uint8_t.

tags/0.6.0
tastytea 5 months ago
parent
commit
6b1b16304f
Signed by: tastytea <tastytea@tastytea.de> GPG Key ID: CFC39497F1B26E07
4 changed files with 32 additions and 4 deletions
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      src/identiconpp.cpp
  3. 24
    2
      src/identiconpp.hpp
  4. 6
    0
      src/identiconpp_c.h

+ 1
- 1
CMakeLists.txt View File

@@ -1,6 +1,6 @@
1 1
 cmake_minimum_required (VERSION 3.2)
2 2
 project(identiconpp
3
-        VERSION 0.5.0
3
+        VERSION 0.6.0
4 4
         LANGUAGES CXX
5 5
 )
6 6
 

+ 1
- 1
src/identiconpp.cpp View File

@@ -26,7 +26,7 @@ Identiconpp::Identiconpp(const uint8_t columns, const uint8_t rows,
26 26
                          algorithm type,
27 27
                          const string &background,
28 28
                          const vector<string> &foreground,
29
-                         const array<const uint8_t, 2> &padding)
29
+                         const array<uint8_t, 2> &padding)
30 30
 : _rows(rows)
31 31
 , _columns(columns)
32 32
 , _type(type)

+ 24
- 2
src/identiconpp.hpp View File

@@ -73,12 +73,14 @@ public:
73 73
      *  @param  background  Background color, hexadecimal, rrggbbaa
74 74
      *  @param  foreground  vector of foreground colors
75 75
      *  @param  padding     Padding in pixels { left & right, top & down }
76
+     *  
77
+     *  @since  before 0.5.0
76 78
      */
77 79
     explicit Identiconpp(const uint8_t columns, const uint8_t rows,
78 80
                          algorithm type = algorithm::ltr_symmetric,
79 81
                          const string &background = "ffffffff",
80 82
                          const vector<string> &foreground = { "000000ff" },
81
-                         const array<const uint8_t, 2> &padding = { 0, 0 });
83
+                         const array<uint8_t, 2> &padding = { 0, 0 });
82 84
 
83 85
     /*!
84 86
      *  @brief  Generates identicon from digest.
@@ -87,6 +89,8 @@ public:
87 89
      *  @param  width   The width of the image in pixels
88 90
      *
89 91
      *  @return The image as Magick::Image
92
+     *
93
+     *  @since  before 0.5.0
90 94
      */
91 95
     Magick::Image generate(const string &digest, const uint16_t width = 100);
92 96
 
@@ -98,6 +102,8 @@ public:
98 102
      *  @param  width   The width of the image in pixels
99 103
      *
100 104
      *  @return The image as base64-string
105
+     *
106
+     *  @since  0.5.0
101 107
      */
102 108
     const string generate_base64(const string &magick, const string &digest,
103 109
                                  const uint16_t width = 100);
@@ -108,7 +114,7 @@ private:
108 114
     const algorithm _type;
109 115
     const string _background;
110 116
     const vector<string> _foreground;
111
-    const array<const uint8_t, 2> _padding;
117
+    const array<uint8_t, 2> _padding;
112 118
 
113 119
     /*!
114 120
      *  @brief  Generate ltr_symmetric identicon.
@@ -120,6 +126,8 @@ private:
120 126
      *  @param  digest  The pre-computed digest
121 127
      *
122 128
      *  @return The image
129
+     *  
130
+     *  @since  before 0.5.0
123 131
      */
124 132
     Magick::Image generate_ltr_symmetric(const string &digest);
125 133
 
@@ -133,6 +141,8 @@ private:
133 141
      *  @param  digest  The pre-computed digest
134 142
      *
135 143
      *  @return The image
144
+     *  
145
+     *  @since  before 0.5.0
136 146
      */
137 147
     Magick::Image generate_ltr_asymmetric(const string &digest);
138 148
 
@@ -146,6 +156,8 @@ private:
146 156
      *  @param  digest  The pre-computed digest
147 157
      *
148 158
      *  @return The image
159
+     *  
160
+     *  @since  before 0.5.0
149 161
      */
150 162
     Magick::Image generate_sigil(const string &digest);
151 163
 
@@ -156,6 +168,8 @@ private:
156 168
      *
157 169
      *  @param  digest  The pre-computed digest
158 170
      *  @param  type    The type of identicon
171
+     *  
172
+     *  @since  before 0.5.0
159 173
      */
160 174
     void check_entropy(const string &digest, algorithm type);
161 175
 
@@ -166,6 +180,8 @@ private:
166 180
      *  @param  digest  The digest
167 181
      *
168 182
      *  @return The bit.
183
+     *  
184
+     *  @since  before 0.5.0
169 185
      */
170 186
     bool get_bit(const uint16_t bit, const string &digest);
171 187
 
@@ -178,6 +194,8 @@ private:
178 194
      *  @param  digest    The digest
179 195
      *
180 196
      *  @return A foreground color.
197
+     *  
198
+     *  @since  before 0.5.0
181 199
      */
182 200
     Magick::Color get_color(const uint16_t firstbit, const string &digest);
183 201
 
@@ -187,6 +205,8 @@ private:
187 205
      *  @param  c       Character to check
188 206
      *
189 207
      *  @return true if not hex.
208
+     *  
209
+     *  @since  before 0.5.0
190 210
      */
191 211
     static bool not_hex(const char c);
192 212
 
@@ -194,6 +214,8 @@ private:
194 214
      *  @brief  Performs checks on a color definition in a string.
195 215
      *
196 216
      *  @param  color   The color as string
217
+     *  
218
+     *  @since  before 0.5.0
197 219
      */
198 220
     void check_color(const string &color);
199 221
 };

+ 6
- 0
src/identiconpp_c.h View File

@@ -61,6 +61,8 @@ extern "C"
61 61
      *  @param  padding         Padding in pixels { left & right, top & down }
62 62
      *
63 63
      *  @return false on error, true otherwise.
64
+     *  
65
+     *  @since  before 0.5.0
64 66
      */
65 67
     bool identiconpp_setup(const uint8_t columns, const uint8_t rows,
66 68
                            identiconpp_algorithm type,
@@ -77,6 +79,8 @@ extern "C"
77 79
      *  @param  width   The width of the identicon
78 80
      *
79 81
      *  @return Length of the generated base64-string, or 0 on error.
82
+     *  
83
+     *  @since  before 0.5.0
80 84
      */
81 85
     uint64_t identiconpp_generate(const char magick[],
82 86
                                   const char digest[], const uint16_t width);
@@ -84,6 +88,8 @@ extern "C"
84 88
     /*!
85 89
      *  @brief  Return base64-encoded string of the image generated with
86 90
      *          identiconpp_generate().
91
+     *
92
+     *  @since  before 0.5.0
87 93
      */
88 94
     const char *identiconpp_base64();
89 95
 

Loading…
Cancel
Save