Easy layer access for rgb8 filters.

Casper Boemann cbr at boemann.dk
Mon Jan 17 14:44:31 CET 2005


On Monday 17 January 2005 13:50, Boudewijn Rempt wrote:
> On Monday 17 January 2005 13:34, Casper Boemann wrote:
> > I might be able to make an exact fit if we believe that an iterator is
> > always walked all the way through. That way I could update the extent
> > whenever an iterator is created. My first thought of an exact fit was to
> > update the extent whenever the iterator moves a single pixel (thus the
> > huge overhead I feared). Should I do this ??
>
> No, I don't think so... I think it's time for some decisions.

I don't think you know what you turned down. please read again

> All paint 
> apps and image editors I've tried behave differently in this regard, so we
> are safe if we can just set down the way Krita behaves. My preference is
> the following:
>
> * New layers cover the entire image by default -- this is meaningless if
> you have transparent pixels, but if you have a background colour, then it
> becomes important because we must fill those pixels.
>
> * If you move a layer and paint outside the previous layer extent, the
> layer will be extended automatically (with background pixels?).
yes. Easily done actually. The decision lies in if we extend with background 
color or transparent pixels. Easy any way.

> * Filtering. Filters only cover the actual tile extent of the layer that
> has been painted on. I don't think this would hit performance much.
>
> * Filling (all types, including gradient, patterns and rendering filters)
> fills the layer within the image bounds. A layer that has been moved will
> be extended to cover the entire image.

> Finally, I'd like to add a function that returns the exact extent ()-- this
> one is going to be expensive to call, but it shouldn't be necessary often,
> mostly for use with selections. This would iterate over the border tiles to
> determing the the extact extent.
Sure, but with the above suggestioon of mine - that you turned down, we would 
gain both performance (better than current) AND exact fit. But it does mean 
that iterators (in write mode) are assumed to truly affect every pixel

With you last suggestion we would have a problem if it is based on 
transparency and we have a background color.
-- 
mvh
Casper Boemann


More information about the kimageshop mailing list