From 219bd36cc26395d9b2f2e418267be851309cdceb Mon Sep 17 00:00:00 2001 From: tonton Th Date: Sun, 16 Feb 2020 23:16:38 +0100 Subject: [PATCH] better testing of interpolate func --- lib/t.c | 41 +++++++++++++++++++++++++++-------------- tools/fimgops.c | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/lib/t.c b/lib/t.c index 8197a872..72bf73a2 100644 --- a/lib/t.c +++ b/lib/t.c @@ -53,7 +53,9 @@ return 0; int essai_interpolate(int k) { FloatImg A, B, C; -int foo; +int foo, idx; +char ligne[200]; +float fval; foo = fimg_create(&A, WI, HI, FIMG_TYPE_RGB); if (foo) { @@ -75,14 +77,21 @@ if (foo) { return foo; } -foo = fimg_interpolate(&A, &B, &C, 0.5); -if (foo) { - fprintf(stderr, "%s err interpolate %d\n", __func__, foo); - return foo; +#define NB 16 +for (idx=0; idx %d\n", foo); +// foo = essai_normalize(); +// fprintf(stderr, "retour essai normalize -> %d\n", foo); -foo = essai_contraste("quux.fimg"); -fprintf(stderr, "retour essai contraste -> %d\n", foo); +// foo = essai_contraste("quux.fimg"); +// fprintf(stderr, "retour essai contraste -> %d\n", foo); -foo = essai_clone_et_copy(0); -fprintf(stderr, "retour essai clone'n'copy -> %d\n", foo); +// foo = essai_clone_et_copy(0); +// fprintf(stderr, "retour essai clone'n'copy -> %d\n", foo); foo = essai_interpolate(0); fprintf(stderr, "retour essai interpolate -> %d\n", foo); diff --git a/tools/fimgops.c b/tools/fimgops.c index d79542a1..e5363427 100644 --- a/tools/fimgops.c +++ b/tools/fimgops.c @@ -84,7 +84,7 @@ switch (action) { case OP_SUB: foo = fimg_sub_3(A, B, D); break; case OP_MIX: - if (verbosity) fprintf(stderr, "%s: fvalue is %f\n", + if (verbosity) fprintf(stderr, "%s:mix: fvalue is %f\n", __func__, global_fvalue); foo = fimg_interpolate(A, B, D, global_fvalue); break;