removed video option, began benchmarking
This commit is contained in:
@@ -4,12 +4,11 @@
|
||||
#include <iostream>
|
||||
|
||||
int main(int ac, char **av) {
|
||||
auto const [input_file, output_file, video_output, iterations, method,
|
||||
auto const [input_file, output_file, 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;
|
||||
|
||||
@@ -16,21 +16,17 @@ void processFilenames(po::variables_map const &vm, path const &t_input,
|
||||
} else if (!t_output.has_extension()) {
|
||||
t_output.replace_extension(".png");
|
||||
}
|
||||
if (vm.count("video")) {
|
||||
t_output.replace_extension(".mp4");
|
||||
}
|
||||
}
|
||||
|
||||
std::tuple<path, path, bool, int, int, bool> parse_args(int t_ac, char **t_av) {
|
||||
std::tuple<path, path, int, int, bool> parse_args(int t_ac, char **t_av) {
|
||||
po::options_description desc("Allowed options");
|
||||
desc.add_options()
|
||||
("help,h", "Display this help message")
|
||||
("input,i", po::value<path>(), "Input image")
|
||||
("output,o", po::value<path>(),
|
||||
"Image or video output path (default: input path + \"_output\")")
|
||||
"Image output path (default: input path + \"_output\")")
|
||||
("method,m", po::value<int>(), "Method number to be used (default: 1)")
|
||||
("iterations,n", po::value<int>(), "Number of iterations (default: 5000)")
|
||||
("video,V", "Enable video output")
|
||||
("verbose,v", "Enables verbosity");
|
||||
po::variables_map vm;
|
||||
po::store(po::parse_command_line(t_ac, t_av, desc), vm);
|
||||
@@ -45,11 +41,9 @@ std::tuple<path, path, bool, int, int, bool> parse_args(int t_ac, char **t_av) {
|
||||
vm.count("output") ? vm["output"].as<path>() : input_path.filename();
|
||||
processFilenames(vm, input_path, output_path);
|
||||
|
||||
return std::make_tuple(
|
||||
input_path,
|
||||
output_path,
|
||||
vm.count("video") ? true : false,
|
||||
vm.count("iterations") ? vm["iterations"].as<int>() : DEFAULT_ITERATIONS,
|
||||
vm.count("method") ? vm["method"].as<int>() : 1,
|
||||
vm.count("verbose") ? true : false);
|
||||
return std::make_tuple(input_path, output_path,
|
||||
vm.count("iterations") ? vm["iterations"].as<int>()
|
||||
: DEFAULT_ITERATIONS,
|
||||
vm.count("method") ? vm["method"].as<int>() : 1,
|
||||
vm.count("verbose") ? true : false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user