blob: 6a03f84c83fd447c2ce8a4596414a111f5efbd68 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#ifndef DIFFERENCE_H_081276A3
#define DIFFERENCE_H_081276A3
#include <random>
#include <string>
#include <Magick++.h>
#include <utility>
#include <verbly.h>
#include <stdexcept>
#include <mastodonpp/mastodonpp.hpp>
#include <memory>
#include "imagenet.h"
class difference {
public:
difference(
std::string configFile,
std::mt19937& rng);
void run() const;
private:
verbly::word getPicturedNoun() const;
std::pair<Magick::Image, Magick::Image>
getImagesForNoun(verbly::word pictured) const;
std::pair<verbly::word, verbly::word> getOppositeIdentifiers() const;
Magick::Image composeImage(
Magick::Image image1,
verbly::word word1,
Magick::Image image2,
verbly::word word2) const;
std::string generatePostText(verbly::word word1, verbly::word word2) const;
void sendPost(std::string text, Magick::Image image) const;
class could_not_get_images : public std::runtime_error {
public:
could_not_get_images() : std::runtime_error("Could not get images for noun")
{
}
};
std::mt19937& rng_;
std::unique_ptr<verbly::database> database_;
std::unique_ptr<mastodonpp::Instance> instance_;
std::unique_ptr<mastodonpp::Connection> connection_;
std::unique_ptr<imagenet> imagenet_;
std::string fontfile_;
std::string tempfile_;
};
#endif /* end of include guard: DIFFERENCE_H_081276A3 */
|