New iterator proposal (was: Re: Krita 1.6: my proposal)

Cyrille Berger cberger at cberger.net
Mon Feb 6 21:15:30 CET 2006


> > > * Krita 2.0 -- porting to Qt4 starts as soon as it's possible to run
> > > an> application, say, konqueror, on kdelibs4 without crashing.
> >
> > erf konqueror 1.5 still crash, so it would never happen ;)
>
> Well, you know what I mean here, right?
yeah you are suppose to know that I like to joke way too much ;p (that's what 
smiley are for btw)

> > Why no new class ? (I was hoping for a new iterator... snif :() (or I can
> > add it to 1.5 and then say : oh it's totally broken I need to fix for
> > 1.6 ;p )
>
> What kind of an iterator? We're arriving at a stage that things like new
> iterators need to be discussed a bit before implementing anyway.
> Personally, I think we goofed in not adding a bitfield to the bitBlt/merge
> functionality to turn on and off individual channels. And no doubt there
> are more things like these.

(In my mind a line is a function like this : y = a, x =a, and a curve is y = 
a*sin(x), or y = a*exp(x))

I need this iterator for distortion correction (it's an important features for 
photo, and an important step for panorama). Basicaly, the distortion is when 
line are curve, and the correction consist in transforming curve into line. 
So I want an iterator that follow curve while, currently, we have only 
iterators that follow line.

So it would be an iterator with an extra argument with a function between x 
and y (or more likely the derivative, as it would give extra precision), and 
when you iterate, it uses the function to compute the next x and y value 
following the curve.

While it would be possible to use our current iterators, I think it would make 
the filter either slow, or unreadable (or worse both at the same time).

And with curve iterator, you have :

KisCurveIterator itSrc = blabla
KisHLineIterator itDst = blablah
while(!itSrc.isDone())
{
	*itSrc = *itDst // <-maybe something more suptile using 
KisColorSpace::mixColor, but that's not the point)
	++itSrc;
	++itDst;
}


-- 
--- Cyrille Berger ---


More information about the kimageshop mailing list