diff --git a/lib/fimg-2gray.c b/lib/fimg-2gray.c index cf7ab5f2..70723bbf 100644 --- a/lib/fimg-2gray.c +++ b/lib/fimg-2gray.c @@ -15,7 +15,7 @@ extern int verbosity; /* must be declared around main() */ /* * floating imgs MUST be allocated before calling this func. */ -int fimg_mk_gray_from(FloatImg *src, FloatImg*dst, int k) +int fimg_mk_gray_from(FloatImg *src, FloatImg *dst, int k) { float kr, kg, kb, kdiv; int nbb, foo; diff --git a/tools/fimgfx.c b/tools/fimgfx.c index 03eef012..9a8f3786 100644 --- a/tools/fimgfx.c +++ b/tools/fimgfx.c @@ -19,13 +19,14 @@ typedef struct { int nbarg; } Fx; -enum fxid { Fx_cos01, Fx_cos010, Fx_pow2, Fx_sqrt }; +enum fxid { Fx_cos01, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0 }; Fx fx_list[] = { { "cos01", Fx_cos01, 0 }, { "cos010", Fx_cos010, 0 }, { "pow2", Fx_pow2, 0 }, { "sqrt", Fx_sqrt, 0 }, + { "gray0", Fx_gray0, 0 }, { NULL, 0, 0 } }; @@ -59,6 +60,10 @@ puts("------ fimg special effects ------"); puts("usage:"); puts("\tfimgfix [options] source.fimg resultat.fimg"); +puts("options:"); +puts("\t-k N.N\tset the floating value"); +puts("\t-v\tincrease verbosity"); + puts("effects:"); printf("\t"); for (fx=fx_list; fx->name; fx++) { @@ -103,6 +108,10 @@ switch (act) { case Fx_sqrt: fimg_square_root(&src, &dest, maxval); break; + case Fx_gray0: /* new 2020 01 10 */ + fimg_to_gray(&src); fimg_copy_data(&src, &dest); + break; + default: fprintf(stderr, "*** %s : %d is bad action\n", __func__, act); break;