Image update strategy
Cyrille Berger
cberger at cberger.net
Fri Apr 4 23:57:39 CEST 2008
On Friday 04 April 2008, C. Boemann wrote:
> to me at least it is not at all simple. I actually think that such a
> algorithm doesn't even exist (yet). Qt uses scanlines for their regions and
> on top of that we have to do some image analysis to regeerate.
Not really, Qt's algorithm (which comes from X11) rapidelly degrades to
scanlines, because it try to find an exact solution (meanings, all dirtied
pixels and only dirtied pixels appear in the region), but if it's acceptable
to have a non exact solution (meanings, the list of rectangles coming from
the region contains all dirtied pixels plus some non-dirtied pixels), I wrote
an algorithm that does that [1], I don't remember how the algorithm works
(and I don't think I will win the nobel prize with it), but it gave me half
the number of rectangle of QRegion, for a quarter of the time. I don't know
if it's usefull, but if anyone wants to play with it, be my guess.
[1] http://cyrille.diwi.org/tmp/krita/Rectangles.tar.bz2
--
Cyrille Berger
More information about the kimageshop
mailing list