|
|
|
@ -31,13 +31,13 @@ Fx fx_list[] = { |
|
|
|
|
{ "pow2", Fx_pow2, 0, 1 }, |
|
|
|
|
{ "sqrt", Fx_sqrt, 0, 1 }, |
|
|
|
|
{ "gray0", Fx_gray0, 0, 1 }, |
|
|
|
|
{ "halfsz0", Fx_halfsz0, 0, 1 }, |
|
|
|
|
{ "rot90", Fx_rot90, 0, 0 }, |
|
|
|
|
// { "halfsz0", Fx_halfsz0, 0, 1 },
|
|
|
|
|
// { "rot90", Fx_rot90, 0, 0 },
|
|
|
|
|
{ "cmixa", Fx_cmixa, 0, 1 }, |
|
|
|
|
{ "xper", Fx_xper, 0, 1 }, |
|
|
|
|
{ "desat", Fx_desat, 0, 1 }, |
|
|
|
|
{ "ctr2x2", Fx_ctr2x2, 0, 1 }, |
|
|
|
|
{ "norm", Fx_norm, 0, 1 }, |
|
|
|
|
// { "norm", Fx_norm, 0, 1 },
|
|
|
|
|
{ "classtrial", Fx_classtrial, 0, 1 }, |
|
|
|
|
{ "binarize", Fx_binarize, 0, 1 }, |
|
|
|
|
{ "trinarize", Fx_trinarize, 0, 1 }, |
|
|
|
@ -45,6 +45,14 @@ Fx fx_list[] = { |
|
|
|
|
{ NULL, 0, 0, 0 } |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */ |
|
|
|
|
static void list_of_effects(void) |
|
|
|
|
{ |
|
|
|
|
Fx *fx; |
|
|
|
|
for (fx=fx_list; fx->name; fx++) { |
|
|
|
|
printf("%s\n", fx->name); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/* --------------------------------------------------------------------- */ |
|
|
|
|
int lookup_fxidx(char *txt) |
|
|
|
|
{ |
|
|
|
@ -105,6 +113,7 @@ puts("\tfimgfx [options] <effect> source.fimg resultat.fimg"); |
|
|
|
|
|
|
|
|
|
puts("options:"); |
|
|
|
|
puts("\t-k N.N\tset the floating value"); |
|
|
|
|
puts("\t-l\tlist effects"); |
|
|
|
|
puts("\t-v\tincrease verbosity"); |
|
|
|
|
|
|
|
|
|
puts("effects:");
|
|
|
|
@ -217,9 +226,11 @@ switch (action) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// foo = fimg_export_picture(&dest, dstfname, 0);
|
|
|
|
|
foo = fimg_dump_to_file(&dest, dstfname, 0); |
|
|
|
|
if (foo) { |
|
|
|
|
fprintf(stderr, "dumping datas to file give us a %d\n", foo); |
|
|
|
|
fprintf(stderr, "dumping datas to file '%s' give us a %d\n", |
|
|
|
|
dstfname, foo); |
|
|
|
|
return foo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -240,10 +251,11 @@ char *operator; |
|
|
|
|
char *srcname = ""; |
|
|
|
|
char *dstname = "out.fimg"; |
|
|
|
|
|
|
|
|
|
while ((opt = getopt(argc, argv, "hk:v")) != -1) { |
|
|
|
|
while ((opt = getopt(argc, argv, "hk:lv")) != -1) { |
|
|
|
|
switch(opt) { |
|
|
|
|
case 'h': help(0); break; |
|
|
|
|
case 'k': global_fvalue = atof(optarg); break; |
|
|
|
|
case 'l': list_of_effects(); exit(0); |
|
|
|
|
case 'v': verbosity++; break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|