#pragma once #include #include #include #include #include "core/canvas.hpp" #include "core/chain.hpp" #include "core/params.hpp" namespace effector { struct Options { std::vector images; std::vector effects; // one per cascade stage, in order // The effects named by --disable: their stages stay in the chain, in // place, but are skipped. Named rather than numbered, exactly as the // params are, so two stages of one effect are disabled together. std::vector disabled; std::string output; // empty -> launch the interface int width = 1920; int height = 1080; std::string format; // a named canvas format, empty for plain pixels int dpi = kDefaultDpi; // only a print format is rendered at a resolution std::optional seed; ParamValues params; // only the keys the user actually passed bool listEffects = false; bool showHelp = false; }; // Throws EffectError on bad input. Effect flags are generated from the // registry, so a new effect gets its flags without touching this file. Options parseOptions(int argc, char** argv); std::string usage(const char* programName); // Turns the parsed names and flags into cascade stages: every flag goes to the // stage whose effect declares it, so --strip-height and --radius can be given // together for `-e scanlines -e blur`. A stage named by --disable is built // with all its settings and marked to be skipped. std::vector buildChain(const Options& options); } // namespace effector