38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
#include "common.hh"
|
|
#include "methods.hh"
|
|
#include "parseargs.hh"
|
|
#include <iostream>
|
|
|
|
int main(int ac, char **av) {
|
|
auto const [input_file, output_file, video_output, iterations, method,
|
|
verbose] = parse_args(ac, av);
|
|
spdlog::set_level(verbose ? spdlog::level::debug : spdlog::level::info);
|
|
spdlog::debug("Input file:\t{}", input_file.native());
|
|
spdlog::debug("Output file:\t{}", output_file.native());
|
|
spdlog::debug("Video output:\t{}", video_output);
|
|
spdlog::debug("Iterations:\t{}", iterations);
|
|
auto [input_image, process_image] = init_image(input_file.native());
|
|
std::random_device rd;
|
|
std::mt19937 gen(rd());
|
|
|
|
switch (method) {
|
|
case 1: {
|
|
method1(input_image, process_image, iterations, gen);
|
|
break;
|
|
}
|
|
case 2: {
|
|
method2(input_image, process_image, iterations, gen);
|
|
break;
|
|
}
|
|
default:
|
|
spdlog::error("Requested method {} is not implemented.");
|
|
std::exit(-1);
|
|
}
|
|
|
|
cv::imwrite(output_file.native(), process_image);
|
|
|
|
// Launch image generation
|
|
|
|
return 0;
|
|
}
|