MCPcopy Create free account
hub / github.com/LibRaw/LibRaw / main

Function main

samples/postprocessing_benchmark.cpp:38–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36float timerend(void);
37
38int main(int argc, char *argv[])
39{
40 int i, ret, rep = 1;
41 LibRaw RawProcessor;
42#ifdef OUT
43#undef OUT
44#endif
45#define OUT RawProcessor.imgdata.params
46#define OUTR RawProcessor.imgdata.rawparams
47#define S RawProcessor.imgdata.sizes
48
49 if (argc < 2)
50 {
51 printf(
52 "postprocessing benchmark: LibRaw %s sample, %d cameras supported\n"
53 "Measures postprocessing speed with different options\n"
54 "Usage: %s [-a] [-H N] [-q N] [-h] [-m N] [-n N] [-s N] [-B x y w h] "
55 "[-R N]\n"
56 "-a average image for white balance\n"
57 "-H <num> Highlight mode (0=clip, 1=unclip, 2=blend, "
58 "3+=rebuild)\n"
59 "-q <num> Set the interpolation quality\n"
60 "-h Half-size color image\n"
61 "-m <num> Apply a num-passes 3x3 median filter to R-G and B-G\n"
62 "-n <num> Set threshold for wavelet denoising\n"
63 "-s <num> Select one raw image from input file\n"
64 "-B <x y w h> Crop output image\n"
65 "-R <num> Number of repetitions\n"
66 "-c Do not use rawspeed\n",
67 LibRaw::version(), LibRaw::cameraCount(), argv[0]);
68 return 0;
69 }
70 char opm, opt, *cp, *sp;
71 int arg, c;
72 int shrink = 0;
73
74 argv[argc] = (char *)"";
75 for (arg = 1; (((opm = argv[arg][0]) - 2) | 2) == '+';)
76 {
77 char *optstr = argv[arg];
78 opt = argv[arg++][1];
79 if ((cp = strchr(sp = (char *)"HqmnsBR", opt)) != 0)
80 for (i = 0; i < "1111141"[cp - sp] - '0'; i++)
81 if (!isdigit(argv[arg + i][0]) && !optstr[2])
82 {
83 fprintf(stderr, "Non-numeric argument to \"-%c\"\n", opt);
84 return 1;
85 }
86 switch (opt)
87 {
88 case 'a':
89 OUT.use_auto_wb = 1;
90 break;
91 case 'H':
92 OUT.highlight = atoi(argv[arg++]);
93 break;
94 case 'q':
95 OUT.user_qual = atoi(argv[arg++]);

Callers

nothing calls this directly

Calls 10

libraw_strerrorFunction · 0.85
timerendFunction · 0.85
open_fileMethod · 0.80
unpackMethod · 0.80
dcraw_clear_memMethod · 0.80
free_imageMethod · 0.80
timerstartFunction · 0.70
dcraw_processMethod · 0.45
dcraw_make_mem_imageMethod · 0.45

Tested by

no test coverage detected