Const iterators

Adrian Page adrian at pagenet.plus.com
Mon Mar 28 22:41:31 CEST 2005


Casper Boemann wrote:
>>Yes, we should have const iterators, or at least a way to access the
>>data in a read-only manner.
> 
> KisROPixel does just that IFAIK

But lots of code doesn't use the KisPixel/KisPixelRO, they use the lower 
level rawData() access method. There should be a read-only version for that.

> It requires an extra memcopy, over the current usage.
> And blitting is not all that fast already.

Blitting is not fast for various reasons and I'm sure a lot can be done 
to improve it.

It would be interesting to see if the extra memory copy really makes 
much difference. I might try a few experiments.

> But exact extents are only useful for bounding box presented to the user
> Not something that is done all that often as compared to blitting...

Currently the process of blitting a 20x20 brush onto a layer updates a 
64x64 square, which is about 10 times as many pixels as it needs to. 
This is one of the reasons painting is slower now than it was before, 
because of the tile based extents. An easy solution to that is to set 
the extent manually, but it shows that it's not just user interface code 
that's involved.

> I think that KisPixel should be how we do that. There shouldn't be a need for 
> yet another structure. It KisPixel lacks somethin then we should change 
> KisPixel, not invent something new again.

I completely agree. KisPixel should be extended to do whatever we want 
without another new concept.

Adrian



More information about the kimageshop mailing list