diff --git a/floatimg.h b/floatimg.h index 199ff81..06363a7 100644 --- a/floatimg.h +++ b/floatimg.h @@ -3,7 +3,7 @@ * ugly code from tTh */ -#define FIMG_VERSION 110 +#define FIMG_VERSION 111 /* * in memory descriptor @@ -145,6 +145,8 @@ int fimg_desaturate(FloatImg *src, FloatImg *dst, int k); /* module funcs/geometry.c */ int fimg_halfsize_0(FloatImg *src, FloatImg *dst, int notused); +int fimg_displacement_0(FloatImg *psrc, FloatImg *pdst, int flags); + /* module funcs/rampes.c */ int fimg_hdeg_a(FloatImg *img, double dcoef); int fimg_vdeg_a(FloatImg *img, double dcoef); diff --git a/funcs/displacement.c b/funcs/displacement.c index 9b2ed35..9821d6c 100644 --- a/funcs/displacement.c +++ b/funcs/displacement.c @@ -43,7 +43,6 @@ foo = fimg_get_minmax_rgb(psrc, minmax); if (verbosity) { fimg_print_minmax(minmax, (char *)__func__); } - dltr = minmax[1] - minmax[0]; dltg = minmax[3] - minmax[2]; dltb = minmax[5] - minmax[4]; @@ -56,10 +55,10 @@ for (y=0; yheight; y++) { fimg_get_rgb(psrc, x, y, rgb); - dispx = (float)x + (rgb[1]/dltg * 10.0); + dispx = (float)x + (rgb[1]/dltg * 20.0); dispy = (float)y + (rgb[2]/dltb * 10.0); - dstx = (int)roundf(dispx - 5.0); - dsty = (int)roundf(dispy - 5.0); + dstx = (int)roundf(dispx - 10.0); + dsty = (int)roundf(dispy - 10.0); if ( (dstx < 0) || (dsty < 0) || (dstx >= psrc->width) || @@ -69,7 +68,10 @@ for (y=0; yheight; y++) { out++; } else { - rgb[1] = rgb[2] = rgb[0]; + if (flags & 1) { + /* going monochrome */ + rgb[1] = rgb[2] = rgb[0]; + } fimg_put_rgb(pdst, dstx, dsty, rgb); // fprintf(stderr, "%5d %5d %f\n", dstx, dsty, rgb[1]); in++; @@ -82,7 +84,7 @@ for (y=0; yheight; y++) { } } -fprintf(stderr, "%s -------> in %d out %d\n", __func__, in, out); +if (verbosity) fprintf(stderr, "%s -> in %d out %d\n", __func__, in, out); return 0; } diff --git a/funcs/t.c b/funcs/t.c index edb9079..0782967 100644 --- a/funcs/t.c +++ b/funcs/t.c @@ -17,8 +17,6 @@ float global_fvalue; /* --------------------------------------------------------------------- */ /* nouveau 24 octobre 2020, pendant le masque-flamme coronavidique */ -int fimg_displacement_0(FloatImg *psrc, FloatImg *pdst, int flags); - int essai_displacement(char *infile, char *outfile) { int foo; diff --git a/funcs/vroum.sh b/funcs/vroum.sh index ce0b1a0..c6a6748 100755 --- a/funcs/vroum.sh +++ b/funcs/vroum.sh @@ -6,7 +6,7 @@ out=out.fimg maxi=49 W="640" H="480" -grabopt=" -s 640x480 -vv -p 0 -n 300 -c cos01 " +grabopt=" -s 640x480 -vv -p 0 -n 500 -c cos01 " mkdir /tmp/V