static int in_itr_num = 5, out_itr_num = 1, quick = 0, optical_flow = 1, bright_contrast = 1, alpha_change = 1;
int scale = 1, scalexyz = 999;
+static char output_prefix[256] = "";
static enum test test = NO_TEST;
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"depth", 1, 0, 'd'},
+ {"output-prefix", 1, 0, 'O'},
{"in-itr-num", 1, 0, 'i'},
{"out-itr-num", 1, 0, 'o'},
{"quick", 0, 0, 'q'},
{0, 0, 0, 0},
};
- c = getopt_long(argc, argv, "hd:i:o:qz:b:f:s:t:", long_options, &option_index);
+ c = getopt_long(argc, argv, "hd:O:i:o:qz:b:f:s:t:", long_options, &option_index);
if (c == -1)
break;
save_depth = atoi(optarg);
skip_args += 2;
break;
+ case 'O':
+ strcpy(output_prefix, optarg);
+ skip_args += 2;
+ break;
case 'i':
in_itr_num = atoi(optarg);
skip_args += 2;
printf("\nOptions:\n");
printf(" -h --help This help\n");
printf(" -d --depth <bits> Save images with given color bit depth (default=%d)\n", save_depth);
+ printf(" -O --output-prefix <path>/<prefix> Store result image of a sequence using this prefix\n");
printf(" -i --in-itr-num <num> Alter inner iterations (weightening count) of colorization algorithm (default=%d)\n", in_itr_num);
printf(" -o --out-itr-num <num> Alter outer iterations (complete turns) of colorization algorithm (default=%d)\n", out_itr_num);
printf(" -q --quick Use quick render, but sufaces may be colorized incomplete\n");
p = sequence[z].filename;
while((q = strchr(p, DIR_SEPERATOR)))
p = q + 1;
- strcpy(name, sequence[z].filename);
- name[p - sequence[z].filename] = '\0';
- strcat(name, "colorized_");
+ if (output_prefix[0] == '\0') {
+ strcpy(name, sequence[z].filename);
+ name[p - sequence[z].filename] = '\0';
+ strcat(name, "colorized_");
+ } else {
+ strcpy(name, output_prefix);
+ }
strcat(name, p);
filename = name;
} else