Autolayer merge done

Casper Boemann cbr at boemann.dk
Sun Jan 16 14:17:41 CET 2005


----- Original Message ----- 
From: "Sven Langkamp" <longamp at reallygood.de>
To: "For developers of Krayon (previously known as KImageShop)"
<kimageshop at kde.org>
Sent: Sunday, January 16, 2005 1:43 PM
Subject: Re: Autolayer merge done


> On Sunday 16 January 2005 09:21, Casper Boemann wrote:
> > > Thanks for the hint. Using the image dimensions works, but now I'm
having
> > > troubles with KisRectIterator. I have fixed a problem with the
operator,
> >
> > but
> >
> > > I can't get the iterator working on the specified rect. It always
stops
> > > in the middle of the first tile. So for now I'm using KisHLineIterator
> > > which works perfect.
> >
> > Yes KisRectIterator is broken. I never fixed it because I realised that
the
> > usage is quite limited so I implemented KisHLineIterator instead.
> >
> > The usage problem with KisRectIterator is that you dont know which pixel
> > you have so unless its an one pixel function like change color it's no
use.
> > You could call x() and y() of the iterator, but that feels quite slow
and
> > clumpsy.
> I don't see the reason why it should be so slow to get x and y from the
> iterator.
>
> If you use a KisHLineIterator you have to get a new Iterator for each
line.
> The KisHLineIterator also does 64 times more tile switches than the
> KisRectIterator.
True, but then you need to access the destination and that requires a tile
switch per access if the destination is a paintdevice. but if you just dump
it into a buffer then it's just a *and a + and an indexed storage.

btw: For both iterators I envision a function that return the number of
horizontal pixel that you can read in one go. So you read the first pixel,
and you are then told that the pointer is valid for say 64 consequtive
horizontal pixels. That is useful info for optimizing blitting (which at the
moment is quite crude). Naturally you would also need to be able to advance
the iterator that many number of pixels in a single call.



More information about the kimageshop mailing list