Const iterators

Adrian Page adrian at pagenet.plus.com
Mon Mar 28 22:12:44 CEST 2005


Boudewijn Rempt wrote:
> Wouldn't that slow down all write operations quite a bit --
> adding a
> 
> if x < m_x; m_x = x;
> if y < m_y; m_y = y;
> if x > m_width; m_width = x;
> if y > m_height; m_height = y;
> 
> for every pixel we write?

It would, but I was thinking the default behaviour would be to update 
the extent for every write, but you could disable it and update the 
extent manually after you've finished the updates. I would imagine this 
would be done most of the time anyway, but you have the fallback that it 
does the job for you if you don't.

Another option is that we always update the extent manually after doing 
some writes.

> 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.

Adrian



More information about the kimageshop mailing list