You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
968 B

  1. #include "common.hh"
  2. #include "methods.hh"
  3. #include "parseargs.hh"
  4. #include <iostream>
  5. int main(int ac, char **av) {
  6. auto const [input_file, output_file, iterations, method,
  7. verbose] = parse_args(ac, av);
  8. spdlog::set_level(verbose ? spdlog::level::debug : spdlog::level::info);
  9. spdlog::debug("Input file:\t{}", input_file.native());
  10. spdlog::debug("Output file:\t{}", output_file.native());
  11. spdlog::debug("Iterations:\t{}", iterations);
  12. auto [input_image, process_image] = init_image(input_file.native());
  13. std::random_device rd;
  14. std::mt19937 gen(rd());
  15. switch (method) {
  16. case 1: {
  17. method1(input_image, process_image, iterations, gen);
  18. break;
  19. }
  20. case 2: {
  21. method2(input_image, process_image, iterations, gen);
  22. break;
  23. }
  24. default:
  25. spdlog::error("Requested method {} is not implemented.");
  26. std::exit(-1);
  27. }
  28. cv::imwrite(output_file.native(), process_image);
  29. // Launch image generation
  30. return 0;
  31. }