#include #include #include #include #include "cardset.h" #include "imagestore.h" #include "wizard.h" int main(int argc, char** argv) { Magick::InitializeMagick(nullptr); std::random_device randomDevice; std::mt19937 rng(5); // randomDevice()); try { TCLAP::CmdLine cmd("Spelling things with MTG cards", ' ', "1.0"); TCLAP::ValueArg cardsPath("c", "cards", "Path to the card definitions file", true, "", "filename"); cmd.add(cardsPath); TCLAP::ValueArg cachePath( "i", "image-cache", "Path to store cached card image downloads", true, "", "filename"); cmd.add(cachePath); TCLAP::ValueArg outputPath( "o", "output", "Path to write image output to", true, "", "filename"); cmd.add(outputPath); TCLAP::ValueArg textInput("t", "text", "Text to render", true, "", "text"); cmd.add(textInput); cmd.parse(argc, argv); cardset cards(cardsPath.getValue()); imagestore images(cachePath.getValue()); wizard app(cards, images, textInput.getValue(), rng); Magick::Image result = app.run(); result.write(outputPath.getValue()); } catch (const TCLAP::ArgException& e) { std::cerr << "Error: " << e.error() << " for arg " << e.argId() << std::endl; } }