+ auto shift to zero
This commit is contained in:
@@ -70,5 +70,30 @@ for (idx=0; idx<sz; idx++) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
int fimg_auto_shift_to_zero(FloatImg *src, FloatImg *dst)
|
||||
{
|
||||
float coefs[6];
|
||||
int foo;
|
||||
|
||||
if (FIMG_TYPE_RGB != src->type) {
|
||||
fprintf(stderr, "%s: bad image type %d\n", __func__, src->type);
|
||||
return -6;
|
||||
}
|
||||
|
||||
foo = fimg_get_minmax_rgb(src, coefs);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: err %d get minmax\n", __func__, foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = fimg_shift_to_zero(src, dst, coefs);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s WTF?\n", __func__);
|
||||
return foo;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user