1010// This file contains some usage examples of the util library.
1111// It has only very little unit test functionality to keep the code clean.
1212
13- namespace
14- {
15- std::string create_temp_output_dir ()
16- {
17- static const std::string dir_name = " rawtoaces_usage_example_output" ;
18- std::filesystem::path temp_output_dir =
19- std::filesystem::temp_directory_path () / dir_name;
20- std::cout << " Output dir: " << temp_output_dir << std::endl;
21- std::filesystem::create_directories ( temp_output_dir );
22- return temp_output_dir.string ();
23- }
24- } // namespace
25-
2613// / Test the image converter using command line parameters for intialisation.
2714void test_ImageConverter_arguments ()
2815{
29- std::cout << " Running test_ImageConverter_arguments" << std::endl;
3016 // This test fails on CI runners having an old version of OIIO.
3117 if ( OIIO::openimageio_version () < 30000 )
3218 return ;
@@ -37,12 +23,8 @@ void test_ImageConverter_arguments()
3723 std::filesystem::absolute ( image_path ).string ();
3824
3925 // Input parameters.
40- std::string temp_output_dir = create_temp_output_dir ();
41- const char *argv[] = { " DUMMY PROGRAM PATH" , " --wb-method" ,
42- " metadata" , " --mat-method" ,
43- " metadata" , " --overwrite" ,
44- " --output-dir" , temp_output_dir.c_str (),
45- " --verbose" };
26+ const char *argv[] = { " DUMMY PROGRAM PATH" , " --wb-method" , " metadata" ,
27+ " --mat-method" , " metadata" , " --overwrite" };
4628
4729 const size_t argc = sizeof ( argv ) / sizeof ( argv[0 ] );
4830
@@ -63,7 +45,6 @@ void test_ImageConverter_arguments()
6345// / Test the image converter, initialising the settings struct directly.
6446void test_ImageConverter_settings ()
6547{
66- std::cout << " Running test_ImageConverter_settings" << std::endl;
6748 // This test fails on CI runners having an old version of OIIO.
6849 if ( OIIO::openimageio_version () < 30000 )
6950 return ;
@@ -75,13 +56,11 @@ void test_ImageConverter_settings()
7556
7657 // Configure the converter.
7758 rta::util::ImageConverter converter;
78- converter.settings .output_dir = create_temp_output_dir ();
7959 converter.settings .WB_method =
8060 rta::util::ImageConverter::Settings::WBMethod::Metadata;
8161 converter.settings .matrix_method =
8262 rta::util::ImageConverter::Settings::MatrixMethod::Metadata;
8363 converter.settings .overwrite = true ;
84- converter.settings .verbosity = 1 ;
8564
8665 // Process an image.
8766 bool result = converter.process_image ( absolute_image_path );
0 commit comments