-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelopMethodTesting.cpp
More file actions
59 lines (42 loc) · 1.08 KB
/
developMethodTesting.cpp
File metadata and controls
59 lines (42 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "libraw/libraw.h"
#include <iostream>
std::string demosaicMethods[13] = {
"linear",
"VNG",
"PPG",
"AHD",
"DCB",
"mAHD",
"AFD",
"VCD",
"VCDAHD",
"LMMSE",
"AMaZE",
"DHT",
"mAHD.AP"
};
int main( int argc, char *argv[] ){
if(argc != 2) {
std::cout << "Proper usage is as follows\r\n\t" << argv[0] << " <filename>\r\n";
return -1;
}
//Test demosaicing methods to see which looks best
for(int i = 0; i < 13; i++) {
//Create image processor
LibRaw iProcessor;
iProcessor.open_file(argv[1]);
iProcessor.imgdata.params.output_tiff = 1;
iProcessor.imgdata.params.use_camera_wb = 1;
iProcessor.imgdata.params.no_auto_bright = 1;
//Demosaic Method
iProcessor.imgdata.params.user_qual = i;
std::cout << "Image Size: " << iProcessor.imgdata.sizes.width << " x " << iProcessor.imgdata.sizes.height << "\r\n";
iProcessor.unpack();
iProcessor.raw2image();
iProcessor.dcraw_process();
std::string newFilename(argv[1]);
newFilename += demosaicMethods[i];
newFilename += ".tif";
iProcessor.dcraw_ppm_tiff_writer(newFilename.c_str());
}
}