Rework of iterators

Cyrille Berger cyb at lepi.org
Sun Jul 11 21:17:56 CEST 2004


> Cyrille, I'm confused. Have we not decided to implement pixel iterators,
> and eventually let the current iterators become obsolete.(except perhabs
> the line iterator). It seems to me that your rework is slightly wasted.
no we have decided to have two type of iterrator, one using line and then 
column (current system) and an other going throuh tiles.


> The methods should also be virtual, if we are to give them as arguments to
> functions. Personally I think that we shouldn't give iterators to the
> colorstrategy (the loop code albeit small would have to be repeated for
> every colorstrategy). If we fix the iterator to the colorstrategy to a rect
> iterator (as a sepcial optimization for compositing), then it needn't have
> virtual functions.

There is no need for them to be virtual for the first released, we have 
decided that QUANTUM/Q_INT8 were the standard for that release, and that we 
will decide how we get ride of it after.

Look at the changes, I made you should not return a pointer to the data but 
rather a KisQuantum, because in a KisQuantum we can take the selection into 
account.


> The final argument for keeping them non-virtual is the comparators. How do
> you compare a rect iterator with a path iterator. I can't see how. This is
> why I have implemted a simple hack in the <= comparator.
Anyway you cannont compare two differents iterrators.

> Per recomendation of Cyrille I walk through the rect one whole tile at a
> time. Performancevice it seems a smart trick, but this gives a non
> traditional traversal, which raises question when comparing two iterators.
> You could either compare in traversal order, or in "line then x" order, but
> neither would be like you expect. I am afraid that a rect iterator would
> have to have "whole line after whole line" traversal
for the comparison, you just have to compare the tilenumber, and if two 
iterrators are on the same tile, you just have to compare the position in the 
tile.

-- 
--- Cyrille Berger ---


More information about the kimageshop mailing list