Skip to content

Commit 91a46a0

Browse files
committed
Rebase and internal changes
- Removed verbosity check from main; now consistently using cout and cerr - Moved rawtoaces_core_priv.h and rawtoaces_util_priv.h into tests - Fixed argv handling in arg_parser - Reordered non–class member functions in rawtoaces_core.cpp so that dependencies are defined before use - Added comments for calculate_daylight_SPD and calculate_blackbody_SPD (for review) Signed-off-by: Mikael Sundell <[email protected]>
1 parent b8795cf commit 91a46a0

File tree

11 files changed

+294
-276
lines changed

11 files changed

+294
-276
lines changed

src/rawtoaces/main.cpp

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,16 @@ int main( int argc, const char *argv[] )
5555
for ( auto const &input_filename: batch )
5656
{
5757
++file_index;
58-
if ( converter.settings.verbosity > 0 )
59-
{
60-
std::cerr << "[" << file_index << "/" << total_files
61-
<< "] Processing file: " << input_filename
62-
<< std::endl;
63-
}
58+
std::cout << "[" << file_index << "/" << total_files
59+
<< "] Processing file: " << input_filename << std::endl;
6460

6561
empty = false;
6662
result = converter.process_image( input_filename );
6763
if ( !result )
6864
{
69-
70-
if ( converter.settings.verbosity > 0 )
71-
{
72-
std::cerr << "Failed on file [" << file_index << "/"
73-
<< total_files << "]: " << input_filename
74-
<< std::endl;
75-
}
76-
65+
std::cerr << "Failed on file [" << file_index << "/"
66+
<< total_files << "]: " << input_filename
67+
<< std::endl;
7768
break;
7869
}
7970
}

src/rawtoaces_core/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ add_library( ${RAWTOACES_CORE_LIB} ${DO_SHARED}
1717

1818
# Make the headers visible in IDEs. This should not affect the builds.
1919
${CORE_PUBLIC_HEADER}
20-
rawtoaces_core_priv.h
2120
define.h
2221
mathOps.h
2322
)

src/rawtoaces_core/rawtoaces_core.cpp

Lines changed: 273 additions & 253 deletions
Large diffs are not rendered by default.

src/rawtoaces_util/image_converter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,9 @@ void ImageConverter::init_parser( OIIO::ArgParse &arg_parser )
886886
.help(
887887
"(-v) Print progress messages. "
888888
"Repeat -v to increase verbosity (e.g. -v -v, -v -v -v)." )
889-
.action(
890-
[&]( OIIO::cspan<const char *> argv ) { settings.verbosity++; } );
889+
.action( [&]( OIIO::cspan<const char *> /* argv */ ) {
890+
settings.verbosity++;
891+
} );
891892

892893
arg_parser.arg( "-v" ).hidden().action(
893894
[&]( OIIO::cspan<const char *> /* argv */ ) { settings.verbosity++; } );

tests/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ add_test ( NAME Test_SpectralData COMMAND Test_SpectralData )
6969
add_executable (
7070
Test_IDT
7171
testIDT.cpp
72+
# Make the headers visible in IDEs. This should not affect the builds.
73+
rawtoaces_core_priv.h
7274
)
7375

7476
target_link_libraries(
@@ -86,6 +88,8 @@ add_test ( NAME Test_IDT COMMAND Test_IDT )
8688
add_executable (
8789
Test_Illum
8890
testIllum.cpp
91+
# Make the headers visible in IDEs. This should not affect the builds.
92+
rawtoaces_core_priv.h
8993
)
9094

9195
target_link_libraries(
@@ -103,6 +107,8 @@ add_test ( NAME Test_Illum COMMAND Test_Illum )
103107
add_executable (
104108
Test_DNGIdt
105109
testDNGIdt.cpp
110+
# Make the headers visible in IDEs. This should not affect the builds.
111+
rawtoaces_core_priv.h
106112
)
107113

108114
target_link_libraries(
@@ -188,6 +194,8 @@ add_test ( NAME Test_UsageTimer COMMAND Test_UsageTimer )
188194
add_executable (
189195
Test_ImageConverter
190196
test_image_converter.cpp
197+
# Make the headers visible in IDEs. This should not affect the builds.
198+
rawtoaces_util_priv.h
191199
)
192200

193201
target_link_libraries(
File renamed without changes.

src/rawtoaces_util/rawtoaces_util_priv.h renamed to tests/rawtoaces_util_priv.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ namespace util
1717
{
1818

1919
std::vector<std::string>
20-
database_paths( const std::string &override_path = "" );
21-
20+
database_paths( const std::string &override_path = "" );
2221
void fix_metadata( OIIO::ImageSpec &spec );
2322

2423
} // namespace util

tests/testDNGIdt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <rawtoaces/rawtoaces_core.h>
88
#include "../src/rawtoaces_core/define.h"
9-
#include "../src/rawtoaces_core/rawtoaces_core_priv.h"
9+
#include "rawtoaces_core_priv.h"
1010

1111
void testIDT_CcttoMired()
1212
{

tests/testIDT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "../src/rawtoaces_core/mathOps.h"
1313
#include <rawtoaces/rawtoaces_core.h>
14-
#include "../src/rawtoaces_core/rawtoaces_core_priv.h"
14+
#include "rawtoaces_core_priv.h"
1515

1616
#define DATA_PATH "../_deps/rawtoaces_data-src/data/"
1717

tests/testIllum.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "../src/rawtoaces_core/mathOps.h"
1313
#include <rawtoaces/rawtoaces_core.h>
14-
#include "../src/rawtoaces_core/rawtoaces_core_priv.h"
14+
#include "rawtoaces_core_priv.h"
1515

1616
#define DATA_PATH "../_deps/rawtoaces_data-src/data/"
1717

0 commit comments

Comments
 (0)