Compare commits

..

No commits in common. "2187c1e0624a3bdd854124f921897d3a5e827993" and "9d874bf87b681baabc32f3fe1d89cc32e811ebba" have entirely different histories.

4 changed files with 14 additions and 37 deletions

View File

@ -178,7 +178,7 @@ switch (idFx) {
image->height/20); image->height/20);
break; break;
case 16: case 16:
retval = bouger_les_pixels(image, 8); retval = bouger_les_pixels(image, 6);
break; break;
case 17: case 17:
retval = mirror_split(image, 0); retval = mirror_split(image, 0);

View File

@ -20,10 +20,10 @@ extern int verbosity;
static FilterStack f_stacks[NUMBER_OF_STACK]; static FilterStack f_stacks[NUMBER_OF_STACK];
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */
int filterstack_init(int numid, int notused) int filterstack_init(int numid, int nbre)
{ {
#if DEBUG_LEVEL #if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %d %d )\n", __func__, numid, notused); fprintf(stderr, ">>> %s ( %d %d )\n", __func__, numid, nbre);
#endif #endif
if (numid < 0 || numid > NUMBER_OF_STACK) { if (numid < 0 || numid > NUMBER_OF_STACK) {
@ -105,11 +105,6 @@ if (numid < 0 || numid > NUMBER_OF_STACK) {
exit(1); exit(1);
} }
if (0==f_stacks[numid].count) {
fprintf(stderr, "%s: stack %d empty ?\n", __func__, numid);
return -11;
}
for (idx=0; idx<f_stacks[numid].count; idx++) { for (idx=0; idx<f_stacks[numid].count; idx++) {
eff = f_stacks[numid].slots[idx].numero; eff = f_stacks[numid].slots[idx].numero;

View File

@ -16,7 +16,7 @@ typedef struct {
FilterSlot slots[FILTER_BY_STACK]; FilterSlot slots[FILTER_BY_STACK];
} FilterStack; } FilterStack;
int filterstack_init(int numid, int notused); int filterstack_init(int numid, int nbre);
int filterstack_add(int numid, int code, int ival, float fval); int filterstack_add(int numid, int code, int ival, float fval);

View File

@ -163,13 +163,7 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
value = idx_values[idx].value; value = idx_values[idx].value;
/* here, insert the input filter */ /* here, insert the input filter */
if (infx) {
foo = crapulator(&B, infx, value); foo = crapulator(&B, infx, value);
}
else {
foo = filterstack_run(0, &B, 0);
}
if (foo) { if (foo) {
fprintf(stderr, "%s: input fx fail %d\n", __func__, foo); fprintf(stderr, "%s: input fx fail %d\n", __func__, foo);
exit(1); exit(1);
@ -187,9 +181,9 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
// exit(1); // exit(1);
// } // }
foo = filterstack_run(1, &Out, 0); foo = filterstack_run(0, &Out, 0);
if (foo) { if (foo) {
fprintf(stderr, "run filt stack--> %d\n", foo); fprintf(stderr, "run filt stk--> %d\n", foo);
return foo; return foo;
} }
@ -249,17 +243,15 @@ int opt;
int inFx = 0; int inFx = 0;
int outFx = 0; int outFx = 0;
int sort = 0; int sort = 0;
char *InFchain = "0"; char *filterchain = "0";
char *OutFchain = "0";
fprintf(stderr, "*** %s : compiled by tTh, %s %s\n", __FILE__, fprintf(stderr, "*** %s : compiled by tTh, %s %s\n", __FILE__,
__DATE__, __TIME__); __DATE__, __TIME__);
fimg_print_version(2); fimg_print_version(2);
while ((opt = getopt(argc, argv, "E:F:hS:vw:x:")) != -1) { while ((opt = getopt(argc, argv, "F:hS:vw:x:")) != -1) {
switch(opt) { switch(opt) {
case 'E': InFchain = optarg; break; case 'F': filterchain = optarg; break;
case 'F': OutFchain = optarg; break;
case 'h': help(); break; case 'h': help(); break;
case 'S': sort = atoi(optarg); break; case 'S': sort = atoi(optarg); break;
case 'v': verbosity++; break; case 'v': verbosity++; break;
@ -277,29 +269,19 @@ if (3 != (argc-optind)) {
exit(1); exit(1);
} }
foo = parse_filter_chain(0, InFchain); foo = parse_filter_chain(0, filterchain);
if (foo) { if (foo) {
fprintf(stderr, "err %d parsing '%s'\n", foo, InFchain); fprintf(stderr, "err %d parsing '%s'\n", foo, filterchain);
exit(1);
}
foo = parse_filter_chain(1, OutFchain);
if (foo) {
fprintf(stderr, "err %d parsing '%s'\n", foo, OutFchain);
exit(1); exit(1);
} }
if (verbosity) { // filterstack_list(__FILE__);
puts("==============");
filterstack_list(0, __FILE__);
filterstack_list(1, __FILE__);
puts("==============");
}
nbrsteps = atoi(argv[optind+2]); nbrsteps = atoi(argv[optind+2]);
foo = interpolator(argv[optind], argv[optind+1], nbrsteps, foo = interpolator(argv[optind], argv[optind+1], nbrsteps,
inFx, outFx, sort); inFx, outFx, sort);
fprintf(stderr, "interpolator give us a %d score\n", foo); fprintf(stderr, "interpolator give a %d score\n", foo);
return 0; return 0;
} }