[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: Re: finalizing the Iterator API
From: Roger Larsson <roger.larsson () norran ! net>
Date: 2004-07-09 0:03:20
Message-ID: 200407090203.20468.roger.larsson () norran ! net
[Download RAW message or body]
On Wednesday 07 July 2004 11.23, Casper Boemann wrote:
> > > And as Boudewijn said up,down.left,right might be nice functions,
>
> however
>
> > > they don't make sense for a PathIterator. I have had this idea myself,
>
> but
>
> > > on reflection: when would they really be used.
> >
> > Edge detection, for instance.
>
> good point, question is if we should make a special WalkerIterator for this
> or just provide those functions in general.
(Better to call "mkbitmap" and "potrace" on a temporary image...)
You might end up moving around _a lot_... (how to follow a edge? - you need
to check neighbors to know that you still are on a edge).
And for each movement you need to check that the iterator is still in
selection or in image...
It might be better to move around a AreaIterator instead...
And wouldn't that be the same as a selector?
What about providing direct pixel access within the selector?
* Iterate over all within the selector to get average.
Note:
When the selection size increases it is better to use two selectors
one to add new pixel values, the other to subtract old
for fit in front_selector:
acc += *fit;
for eit in end_selector:
acc = *eit;
average = acc / size(total_selector);
front_selector.dx(1);
end_selector.dx(1);
/RogerL
--
Roger Larsson
SkellefteƄ
Sweden
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic