From af103abdcf6bb940a626418e14abe5e331f8d4cf Mon Sep 17 00:00:00 2001 From: tTh Date: Tue, 31 Jan 2023 00:14:56 +0100 Subject: [PATCH] minor tweaks --- floatimg.h | 2 +- funcs/fmorpho.c | 6 +++--- funcs/incrustator.c | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/floatimg.h b/floatimg.h index d79bf0ed..59c0e316 100644 --- a/floatimg.h +++ b/floatimg.h @@ -20,7 +20,7 @@ * https://git.tetalab.org/tTh/FloatImg */ -#define FIMG_VERSION (210) +#define FIMG_VERSION (212) #define RELEASE_NAME ("noname") /* XXX add a test for stdint.h / uint32_t XXX */ diff --git a/funcs/fmorpho.c b/funcs/fmorpho.c index caba3b52..371e4775 100644 --- a/funcs/fmorpho.c +++ b/funcs/fmorpho.c @@ -55,9 +55,9 @@ int xs, ys, loop9; int xp, yp; float rgb[3]; -// #if DEBUG_LEVEL +#if DEBUG_LEVEL fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, sfimg, dfimg, index); -// #endif +#endif if ( (index<0) || (index>8)) { fprintf(stderr, " %s: bad index %d\n", __func__, index); @@ -75,7 +75,7 @@ for (ys=1; ysheight-1; ys++) { xp = xs + deltas[loop9].x; yp = ys + deltas[loop9].y; fimg_get_rgb(sfimg, xp, yp, rgb); - pixels[loop9].fgris = rgb[0]; + pixels[loop9].fgris = rgb[0] + rgb[1] + rgb[2]; pixels[loop9].rang = loop9; } qsort(&pixels, 9, sizeof(fpixel), comparaison_fgris); diff --git a/funcs/incrustator.c b/funcs/incrustator.c index b921836e..321279df 100644 --- a/funcs/incrustator.c +++ b/funcs/incrustator.c @@ -22,8 +22,10 @@ static int check_boundaries(FloatImg *from, FloatImg *to, FimgArea51 *a51) fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, from, to, a51); #endif -fimg_printdims("from", from); -fimg_printdims("to ", to); +if (verbosity > 1) { + fimg_printdims("from", from); + fimg_printdims("to ", to); + } /* just a small molly-guard */ if ( (a51->w < 0) || (a51->h < 0) ) { @@ -81,7 +83,8 @@ if (foo) { if ( (xpos < 0) || (xpos > pdst->width - psrc->width) || (ypos < 0) || (ypos > pdst->height - psrc->height) ) { - fprintf(stderr, "%s: boudary error\n", __func__); + fprintf(stderr, "%s: boudary error, x=%d y=%d\n", __func__, + xpos, ypos); return -2; }