[Digikam-devel] extragear/graphics/digikam/libs/dimg/filters

Marcel Wiesweg marcel.wiesweg at gmx.de
Wed Feb 22 22:58:24 GMT 2006


> > digikam from trunk: rounding error of BCG modifier
> >
> > With the current algorithm, even setting a gamma of 1.0 would create
> > changes, (x / 255.0) * 255.0 might be slightly less than x, so casting
> > this value to int would result in an error of 1.
> > I hope using the round() function is a correct fix for this,
> > at least the 1.0 value now creates a proper x=y mapping.
>
> Fine for me.
>
> If you have any time, HSLModifier don't work properly with 16 bits image (i
> suspect a problem too with 8 bits image).
>
> Can you take a look my comments in source code and give me your viewpoint ?

As to 16 bit, there is an integer overflow in setLightness and setSaturation, 
65535^2 = 2^32, so something like (i * (65535 + value) will wrap around for 
larger values of i.
I think I have a fix for this, but now I have managed to break it even more 
thoroughly, for 8bit as well :-)
I will work on this tomorrow.

Marcel

>
> Thanks in advance
>
> Gilles
>
> Nota : HSL tool is the last one from core plugin to port in 16 bits
> (:=)))...
>
> _______________________________________________
> Digikam-devel mailing list
> Digikam-devel at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-devel



More information about the Digikam-devel mailing list