a QR code generator for the command line
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
627 B

#pragma once
#include <vector>
#include <string>
#include <memory>
#include <unordered_map>
#include "qrcodegen.hpp"
#include "Renderer.hpp"
namespace massivedynamic {
typedef uint32_t Color;
enum class Format {
CONSOLE,
SVG,
PNG,
JPG,
BMP,
END
};
constexpr size_t FormatLength = static_cast<size_t>(Format::END);
class QR {
private:
std::string outputFile;
std::vector<bool> pixels;
std::unordered_map<Format, std::unique_ptr<Renderer>> renderers;
public:
QR(const std::string& data, std::string outputFile, size_t size, qrcodegen::QrCode::Ecc type);
void render(Format format);
};
}