summary refs log tree commit diff stats
path: root/designer.h
diff options
context:
space:
mode:
Diffstat (limited to 'designer.h')
-rw-r--r--designer.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/designer.h b/designer.h new file mode 100644 index 0000000..6a348a0 --- /dev/null +++ b/designer.h
@@ -0,0 +1,40 @@
1#ifndef DESIGNER_H_CCE34BEB
2#define DESIGNER_H_CCE34BEB
3
4#include <random>
5#include <string>
6#include <Magick++.h>
7#include <vector>
8
9class designer {
10public:
11
12 designer(std::string fontsPath);
13
14 Magick::Image generate(
15 size_t width,
16 size_t height,
17 const std::string& text,
18 std::mt19937& rng) const;
19
20private:
21
22 const size_t MIN_FONT_SIZE = 48;
23 const size_t MAX_FONT_SIZE = 96;
24 const size_t V_PADDING = 5;
25 const size_t H_PADDING = 5;
26
27 size_t maxWordsInLine(
28 std::vector<std::string>::const_iterator first,
29 std::vector<std::string>::const_iterator last,
30 Magick::Image& textimage) const;
31
32 size_t minHeightRequired(
33 std::vector<std::string>::const_iterator first,
34 std::vector<std::string>::const_iterator last,
35 Magick::Image& textimage) const;
36
37 std::vector<std::string> fonts;
38};
39
40#endif /* end of include guard: DESIGNER_H_CCE34BEB */