diff --git a/Fonderie/essai.sh b/Fonderie/essai.sh index 9b38da8d..9351e57d 100755 --- a/Fonderie/essai.sh +++ b/Fonderie/essai.sh @@ -9,8 +9,8 @@ FILTRES=$(./t -L | awk 'NR>1 { print $1 }' | sort) rm /tmp/fstack*.png -# SRC=$(ls -rt1 $HOME/Essais/FondageDePlomb/capture/* | tail -1) -SRC=mire.fimg +SRC=$(ls -rt1 $HOME/Essais/FondageDePlomb/capture/* | tail -1) +# SRC=mire.fimg for F in $FILTRES do diff --git a/funcs/saturation.c b/funcs/saturation.c index 5254463b..a3357858 100644 --- a/funcs/saturation.c +++ b/funcs/saturation.c @@ -71,10 +71,14 @@ return 0; } /* -------------------------------------------------------------- */ +/* + * I think that this function is fully buggy + */ int fimg_auto_shift_to_zero(FloatImg *src, FloatImg *dst) { float coefs[6]; int foo; +float minima = 1e7; /* magic value ? */ if (FIMG_TYPE_RGB != src->type) { fprintf(stderr, "%s: bad image type %d\n", __func__, src->type); @@ -87,6 +91,13 @@ if (foo) { return foo; } +/* crude hack for now */ +if (coefs[0] < minima) minima = coefs[0]; +if (coefs[2] < minima) minima = coefs[2]; +if (coefs[4] < minima) minima = coefs[4]; + +coefs[0] = coefs[2] = coefs[4] = minima; + foo = fimg_shift_to_zero(src, dst, coefs); if (foo) { fprintf(stderr, "%s WTF?\n", __func__);