|
@@ -1,23 +1,48 @@
|
|
|
-#include "MandelVideoGenerator.h"
|
|
|
-#include "ImageExport.h"
|
|
|
-#include "Gradient.h"
|
|
|
-#include "Mandel.h"
|
|
|
-#include "Fixed.h"
|
|
|
+#include "run.h"
|
|
|
+#include <iostream>
|
|
|
|
|
|
+#include <boost/program_options.hpp>
|
|
|
|
|
|
-int main() {
|
|
|
+namespace progOpts = boost::program_options;
|
|
|
+
|
|
|
+int main(int argc, char** argv)
|
|
|
+{
|
|
|
+ progOpts::options_description desc("Available options");
|
|
|
+ desc.add_options()
|
|
|
+ ("help", "display this help message")
|
|
|
+ ("render-image,i", "render a mandelbrot view")
|
|
|
+ ("file,f", progOpts::value<std::string>(), "specifies a file to load")
|
|
|
+ ("output,o", progOpts::value<std::string>(), "file to output")
|
|
|
+ ;
|
|
|
+ progOpts::positional_options_description p;
|
|
|
+ p.add("file", 1);
|
|
|
+ progOpts::variables_map vm;
|
|
|
+ progOpts::store(progOpts::command_line_parser(argc, argv)
|
|
|
+ .options(desc).positional(p).run(), vm);
|
|
|
+ progOpts::notify(vm);
|
|
|
+
|
|
|
+ if (vm.count("help")) {
|
|
|
+ std::cout << desc << "\n";
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::string out = vm["output"].as<std::string>();
|
|
|
+
|
|
|
+ if (vm.count("render-image")) {
|
|
|
+ std::string inPath = vm["file"].as<std::string>();
|
|
|
+ std::cout << "rendering image " << inPath << std::endl;
|
|
|
+ renderImage(inPath, out);
|
|
|
+ } else {
|
|
|
+ std::cout << "No files specified" << std::endl;
|
|
|
+ }
|
|
|
+
|
|
|
+/*
|
|
|
mnd::MandelContext mndCtxt = mnd::initializeContext();
|
|
|
|
|
|
|
|
|
ExportVideoInfo evi;
|
|
|
|
|
|
evi.start = mnd::MandelViewport::standardView();
|
|
|
- /*evi.end = mnd::MandelViewport {
|
|
|
- mnd::Real("-1.5016327722130767973008541252724123393337183519056236025189105693015282429244791506194548898968185999262221668435271537932672968559900159142085320685031"),
|
|
|
- mnd::Real("9.1949171527697821768939276268368163504538591789778359909730511642378316080598664365235178721745031546786105261407973733873085119833457073054327967448264e-06"),
|
|
|
- mnd::Real("1.6236294899543021550377844129369984149698872979955210084321757728274664401182171658849308001321609757279087031477100527629814577654596624031152718524352e-10"),
|
|
|
- mnd::Real("1.2246019034401093377903721086780361028058704962292211685926779200766324399350798858672587301860274703389823933260119617558370004128301410779021141722617e-10")
|
|
|
- };*/
|
|
|
evi.end = mnd::MandelViewport {
|
|
|
mnd::Real("-1.0"),
|
|
|
mnd::Real("-1.0"),
|
|
@@ -27,20 +52,6 @@ int main() {
|
|
|
//evi.end.zoomCenter(1.0e+27);
|
|
|
evi.gradient = Gradient::defaultGradient();
|
|
|
|
|
|
- /*evi.mi.bWidth = 1280;
|
|
|
- evi.mi.bHeight = 720;
|
|
|
- evi.mi.maxIter = 1000;
|
|
|
- evi.fps = 60;
|
|
|
- evi.zoomSpeed = 1.0;
|
|
|
- evi.path = "video.avi";
|
|
|
- evi.bitrate = 1500;
|
|
|
- evi.preset = "veryfast";
|
|
|
-
|
|
|
- evi.start.adjustAspectRatio(evi.mi.bWidth, evi.mi.bHeight);
|
|
|
-
|
|
|
- MandelVideoGenerator mvg(evi);
|
|
|
-
|
|
|
- mvg.generate(mndCtxt.getDefaultGenerator());*/
|
|
|
|
|
|
|
|
|
mnd::MandelContext mc = mnd::initializeContext();
|
|
@@ -64,6 +75,7 @@ int main() {
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
|