When the values used are in the billions, the tolerance that originally
was mostly intended for values in the range 0.0-1.0 and its neighborhood
break apart - use 1% of component values as symmetry threshold for such
values.
{
int j;
for (j = 0; j < 4; j++)
- if (fabs (clipped[i *4 + j] - transformed[i * 4 + j]) > TOLERANCE)
+ {
+ float tolerance = TOLERANCE;
+ if (fabs(clipped[i*4+j]) > 1.0)
+ tolerance = fabs(clipped[i*4+j]) * 0.01;
+ if (fabs (clipped[i *4 + j] - transformed[i * 4 + j]) > tolerance)
{
if (!log)
log = 1;
symmetric = 0;
}
+ }
if (log && log < 5)
{
babl_log ("%s", babl->instance.name);