-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrawdevelop.cpp
More file actions
55 lines (39 loc) · 1.05 KB
/
rawdevelop.cpp
File metadata and controls
55 lines (39 loc) · 1.05 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
#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;
}
//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 is AMaZE
iProcessor.imgdata.params.user_qual = 10;
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 = newFilename.substr(0, newFilename.find_last_of("."));
newFilename += ".tif";
iProcessor.dcraw_ppm_tiff_writer(newFilename.c_str());
}