|
|
|
@ -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__);
|
|
|
|
|