tuning...

This commit is contained in:
tth 2020-10-26 18:49:37 +01:00
parent 3e820c8298
commit ce02cf96bc
4 changed files with 12 additions and 10 deletions

View File

@ -3,7 +3,7 @@
* ugly code from tTh * ugly code from tTh
*/ */
#define FIMG_VERSION 110 #define FIMG_VERSION 111
/* /*
* in memory descriptor * in memory descriptor
@ -145,6 +145,8 @@ int fimg_desaturate(FloatImg *src, FloatImg *dst, int k);
/* module funcs/geometry.c */ /* module funcs/geometry.c */
int fimg_halfsize_0(FloatImg *src, FloatImg *dst, int notused); int fimg_halfsize_0(FloatImg *src, FloatImg *dst, int notused);
int fimg_displacement_0(FloatImg *psrc, FloatImg *pdst, int flags);
/* module funcs/rampes.c */ /* module funcs/rampes.c */
int fimg_hdeg_a(FloatImg *img, double dcoef); int fimg_hdeg_a(FloatImg *img, double dcoef);
int fimg_vdeg_a(FloatImg *img, double dcoef); int fimg_vdeg_a(FloatImg *img, double dcoef);

View File

@ -43,7 +43,6 @@ foo = fimg_get_minmax_rgb(psrc, minmax);
if (verbosity) { if (verbosity) {
fimg_print_minmax(minmax, (char *)__func__); fimg_print_minmax(minmax, (char *)__func__);
} }
dltr = minmax[1] - minmax[0]; dltr = minmax[1] - minmax[0];
dltg = minmax[3] - minmax[2]; dltg = minmax[3] - minmax[2];
dltb = minmax[5] - minmax[4]; dltb = minmax[5] - minmax[4];
@ -56,10 +55,10 @@ for (y=0; y<psrc->height; y++) {
fimg_get_rgb(psrc, x, y, rgb); 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); dispy = (float)y + (rgb[2]/dltb * 10.0);
dstx = (int)roundf(dispx - 5.0); dstx = (int)roundf(dispx - 10.0);
dsty = (int)roundf(dispy - 5.0); dsty = (int)roundf(dispy - 10.0);
if ( (dstx < 0) || (dsty < 0) || if ( (dstx < 0) || (dsty < 0) ||
(dstx >= psrc->width) || (dstx >= psrc->width) ||
@ -69,7 +68,10 @@ for (y=0; y<psrc->height; y++) {
out++; out++;
} }
else { 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); fimg_put_rgb(pdst, dstx, dsty, rgb);
// fprintf(stderr, "%5d %5d %f\n", dstx, dsty, rgb[1]); // fprintf(stderr, "%5d %5d %f\n", dstx, dsty, rgb[1]);
in++; in++;
@ -82,7 +84,7 @@ for (y=0; y<psrc->height; 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; return 0;
} }

View File

@ -17,8 +17,6 @@ float global_fvalue;
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* nouveau 24 octobre 2020, pendant le masque-flamme coronavidique */ /* 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 essai_displacement(char *infile, char *outfile)
{ {
int foo; int foo;

View File

@ -6,7 +6,7 @@ out=out.fimg
maxi=49 maxi=49
W="640" W="640"
H="480" 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 mkdir /tmp/V