diff options
Diffstat (limited to 'qrcode.cpp')
-rw-r--r-- | qrcode.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -4,12 +4,17 @@ #include <qrcodegen/QrCode.hpp> -#include <ImageMagick-6/Magick++.h> +#include <Magick++.h> using namespace qrcodegen; using namespace Magick; -std::string getQRCode(const std::string& data) +void QRCode::init() +{ + Magick::InitializeMagick(NULL); +} + +std::string QRCode::getQRCode(const std::string& data) { QrCode qrc {QrCode::encodeText(data.c_str(), QrCode::Ecc::MEDIUM)}; @@ -17,7 +22,6 @@ std::string getQRCode(const std::string& data) Image image(fmt::format("{0}x{0}", size).c_str(), "white"); image.type(GrayscaleType); - //image.size(fmt::format("{0}x{0}", size)); for (int x = 0; x < size; x++) { for (int y = 0; y < size; y++) { |