Const iterators

Casper Boemann cbr at boemann.dk
Mon Mar 28 23:06:14 CEST 2005


On Monday 28 March 2005 22:41, Adrian Page wrote:
> 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.
well, read-only versions of iterators exist. They just don't enforce it, but 
you would surely know if you write with a read-only interator.

> > 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.
well if you have any ideas

> > 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.
Yes that is currently an example but KisBrush knows the dimensions so that 
shouldn't really be nessesary.

> > This is a bit trickier -- ideally, you want to preserve data that cannot
> > be in a QColor, like wetness/opacity/thickness etc -- and if you convert
> > to QColor and then write, you would lose all the extra data.
>
> True, but I'm thinking more along the lines of our KisPixel object in
> which we have colour channels, an opacity, and 'substance' channels
> (going by the description). Maybe it's too simplistic but I wondered if
> it would be possible to manipulate the colour channels via
> QColor/KisColor, independently of the others. So you would only touch
> the colour channels and leave the rest as they are.
Just remember that you cannot manipulate individual channels outside a color 
strategy, and that inside you would be more efficient manipulating the data 
directly.

So if KisPixel should become useful it should allow you to change the color as 
RGB, as lab , as XYZ eventhough the rawdata might be hsv or something else.

---
best regards / venlig hilsen
Casper Boemann


More information about the kimageshop mailing list