1616
1717BOOST_AUTO_TEST_CASE ( Test_AcesRender )
1818{
19- char const * const argv[] = {
19+ char const *const argv[] = {
2020 " dummy_binary_path" ,
21-
21+
2222 // getting "Subprocess aborted" in unit tests
2323 // when this is enabled on Mac, the tests fail on linux if
2424 // skipped completely.
@@ -31,50 +31,39 @@ BOOST_AUTO_TEST_CASE( Test_AcesRender )
3131 " dummy_image_path"
3232 };
3333
34+ const int argc = sizeof ( argv ) / sizeof ( argv[0 ] );
35+
36+ std::filesystem::path pathToRaw = std::filesystem::absolute (
37+ " ../../unittest/materials/blackmagic_cinema_camera_cinemadng.dng" );
38+ BOOST_CHECK ( std::filesystem::exists ( pathToRaw ) );
39+
40+ rta::util::ImageConverter converter;
41+
42+ int arg = converter.configure_settings ( argc, argv );
43+ BOOST_CHECK_EQUAL ( arg, argc - 1 );
44+ BOOST_CHECK (
45+ converter.settings .wbMethod ==
46+ rta::util::ImageConverter::Settings::WBMethod::Metadata );
47+ BOOST_CHECK (
48+ converter.settings .matrixMethod ==
49+ rta::util::ImageConverter::Settings::MatrixMethod::Metadata );
50+
51+ // Disable for now. Needs better checks if the installed OIIO version
52+ // is compatible.
53+ if ( false ) // (OIIO::openimageio_version() > 20500 )
3454 {
35- const int argc = sizeof ( argv ) / sizeof ( argv[ 0 ] ) ;
36-
37- std::filesystem::path pathToRaw = std::filesystem::absolute (
38- " ../../unittest/materials/blackmagic_cinema_camera_cinemadng.dng " );
39- BOOST_CHECK ( std::filesystem::exists ( pathToRaw ) );
40-
41- std::cerr << " IMAGE PATH " << pathToRaw. string () << std::endl;
42-
43- rta::util::ImageConverter converter ;
44- std::cerr << " 1 " << std::endl;
45-
46- int arg = converter. configure_settings ( argc, argv );
47- std::cerr << " 2 " << std::endl ;
55+ OIIO::ParamValueList hints ;
56+ bool result = converter. configure ( pathToRaw. string (), hints );
57+ BOOST_CHECK_EQUAL ( result, true );
58+
59+ auto idt = converter. get_IDT_matrix ( );
60+
61+ double matrix[ 3 ][ 3 ] = { { 1.0536466144 , 0.0039044182 , 0.0049084502 },
62+ { - 0.4899562165 , 1.3614787986 , 0.1020844728 },
63+ { - 0.0024498461 , 0.0060497128 , 1.0139159537 } } ;
64+
65+ for ( size_t i = 0 ; i < 3 ; i++ )
66+ for ( size_t j = 0 ; j < 3 ; j++ )
67+ BOOST_CHECK_CLOSE ( idt[i][j], matrix[i][j], 1e-5 ) ;
4868 }
49- // BOOST_CHECK_EQUAL( arg, argc - 1 );
50- // std::cerr << "3" << std::endl;
51- // BOOST_CHECK(
52- // converter.settings.wbMethod ==
53- // rta::util::ImageConverter::Settings::WBMethod::Metadata );
54- // std::cerr << "4" << std::endl;
55- // BOOST_CHECK(
56- // converter.settings.matrixMethod ==
57- // rta::util::ImageConverter::Settings::MatrixMethod::Metadata );
58- // std::cerr << "5" << std::endl;
59- //
60- // // Disable for now. Needs better checks if the installed OIIO version
61- // // is compatible.
62- // if ( false ) //(OIIO::openimageio_version() > 20500 )
63- // {
64- // OIIO::ParamValueList hints;
65- // bool result = converter.configure( pathToRaw.string(), hints );
66- // BOOST_CHECK_EQUAL( result, true );
67- //
68- // auto idt = converter.get_IDT_matrix();
69- //
70- // double matrix[3][3] = { { 1.0536466144, 0.0039044182, 0.0049084502 },
71- // { -0.4899562165, 1.3614787986, 0.1020844728 },
72- // { -0.0024498461, 0.0060497128, 1.0139159537 } };
73- //
74- // for ( size_t i = 0; i < 3; i++ )
75- // for ( size_t j = 0; j < 3; j++ )
76- // BOOST_CHECK_CLOSE( idt[i][j], matrix[i][j], 1e-5 );
77- // }
78-
79- std::cerr << " 5" << std::endl;
8069};
0 commit comments