Skip to content

Commit a58c610

Browse files
committed
cleanup
Signed-off-by: Anton Dukhovnikov <[email protected]>
1 parent fe7650d commit a58c610

File tree

3 files changed

+38
-50
lines changed

3 files changed

+38
-50
lines changed

include/rawtoaces/acesrender.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class ImageConverter
124124
/// Configure the converter using the command line parameters and
125125
/// environment variables. This is optional, the `settings` struct can also
126126
/// be modified manually.
127-
int configure_settings( int argc, char const * const argv[] );
127+
int configure_settings( int argc, char const *const argv[] );
128128

129129
/// Collects all illuminants supported by this version.
130130
std::vector<std::string> supported_illuminants();

src/rawtoaces_util/acesrender.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,14 +641,13 @@ bool prepare_transform_nonDNG(
641641
return true;
642642
}
643643

644-
int ImageConverter::configure_settings( int argc, char const * const argv[] )
644+
int ImageConverter::configure_settings( int argc, char const *const argv[] )
645645
{
646646
settings.database_directories = database_paths();
647647

648648
char *cp, *sp;
649649
int arg;
650-
// argv[argc] = (char *)"";
651-
650+
652651
static unordered_map<string, char> keys;
653652
create_key( keys );
654653

unittest/config_tests/util/util_test.cpp

Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
BOOST_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

Comments
 (0)