genetic-images/src/main.cc

32 lines
833 B
C++
Raw Normal View History

#include "common.hh"
2019-03-20 19:14:55 +00:00
#include "method1.hh"
2019-03-20 11:34:46 +00:00
#include "parseargs.hh"
2019-03-19 10:15:42 +00:00
2019-03-19 12:49:37 +00:00
int main(int ac, char **av) {
2019-03-20 19:14:55 +00:00
auto const [input_file, output_file, video_output, iterations, method] =
2019-03-19 13:22:59 +00:00
parse_args(ac, av);
2019-03-20 11:34:46 +00:00
spdlog::info("Input file:\t{}", input_file.native());
spdlog::info("Output file:\t{}", output_file.native());
2019-03-19 13:22:59 +00:00
spdlog::info("Video output:\t{}", video_output);
spdlog::info("Iterations:\t{}", iterations);
2019-03-20 11:34:46 +00:00
auto [input_image, process_image] = init_image(input_file.native());
2019-03-20 19:14:55 +00:00
std::random_device rd;
std::mt19937 gen(rd());
2019-03-19 10:15:42 +00:00
2019-03-20 19:14:55 +00:00
switch (method) {
case 1: {
method1(input_image, process_image, iterations, gen);
break;
}
default:
spdlog::error("Requested method {} is not implemented.");
std::exit(-1);
}
2019-03-20 11:34:46 +00:00
cv::imwrite(output_file.native(), process_image);
// Launch image generation
2019-03-19 09:14:19 +00:00
return 0;
}