diff --git a/Fonderie/interpolator.c b/Fonderie/interpolator.c index f9aaba9..9c245dc 100644 --- a/Fonderie/interpolator.c +++ b/Fonderie/interpolator.c @@ -66,7 +66,7 @@ fprintf(stderr, "IdxValues array at %p\n", idxvalues); /* compute all the needed values */ for (idx=0; idxgl_pathv[idx]; - foo = get_float_metric_a_from_file(filename, &metrique); + foo = get_float_metric_from_file(filename, &metrique, method); if (foo) { fprintf(stderr, "%s: err %d get metric of '%s'\n", __func__, foo, filename); @@ -80,7 +80,7 @@ for (idx=0; idx 1) { fflush(stdout); } } - +fprintf(stderr, "\n.\n"); return 0; } @@ -140,6 +140,8 @@ w = iarray[0], h = iarray[1]; fprintf(stderr, "first image size : %dx%d\n", w, h); fimg_create(&A, w, h, 3); pFirst = &A; +fimg_vdeg_a(&A, idx_values[0].value); + fimg_create(&B, w, h, 3); pSecond = &B; fimg_create(&Out, w, h, 3); diff --git a/Fonderie/metriques.c b/Fonderie/metriques.c index 05e400a..c7e1cac 100644 --- a/Fonderie/metriques.c +++ b/Fonderie/metriques.c @@ -31,7 +31,21 @@ if (foo) { return 0; } /* -------------------------------------------------------------- */ -int get_float_metric_a_from_file(char *fname, float *where) +int get_float_metric_b(FloatImg *pimg, float *where) +{ +int idx, size; +double adder; + +adder = 0.0; +size = pimg->width * pimg->height; +for (idx=20; idx < size; idx+=42) { + adder += (double)pimg->R[idx]; + } +*where = (float)adder; +return 0; +} +/* -------------------------------------------------------------- */ +int get_float_metric_from_file(char *fname, float *where, int mode) { FloatImg image; int foo; @@ -43,10 +57,9 @@ if (foo) { return foo; } fval = -1.0; /* sensible default value */ -foo = get_float_metric_a(&image, &fval); +foo = get_float_metric_b(&image, &fval); *where = fval; -// fprintf(stderr, "metric of '%s' = %f\n", fname, fval); fimg_destroy(&image); return 0; diff --git a/Fonderie/metriques.h b/Fonderie/metriques.h index 5c76664..ce7aa81 100644 --- a/Fonderie/metriques.h +++ b/Fonderie/metriques.h @@ -7,6 +7,6 @@ /* first experiments */ int get_float_metric_a(FloatImg *pimg, float *where); -int get_float_metric_a_from_file(char *imgname, float *where); +int get_float_metric_from_file(char *imgname, float *where, int mode); /* -------------------------------------------------------------- */