Easy layer access for rgb8 filters.

Casper Boemann cbr at boemann.dk
Mon Jan 17 11:57:17 CET 2005


> I know I repeat myself, but imagine you have a 20x20 pixel photo. Now you
> create another layer, say a 20000x20000 pixel landscape. Now you have two
> layers, one 20x20 pixels wide, the other one 20000x20000 pixels wide. Now
you
> want to apply a filter to the 20x20 pixel photo.
>
> With that code, QImage img = src->convertToQImage(0)  will give you a
> 20000x20000 pixel QImage, won't it? Maybe in this case it is really better
to
> use the extent function, even if it does not give you the true extension
of
> your photo, but the size of a tile (64x64 pixels).

Only if your image is also 20000x20000, but you are right, which is why for
filters that change what is visible using the extent function is indeed
better.

Does it matter if it is a little bit larger than actual (I could change to a
closer fit on the expence of slower iterators). But I don't see a real need
for a closer fit - why is that important ?

> Do the iterators know the exact extent of an image? Then one could just
use
> a QMemArray instead of a QUANTUM array, iterate over the whole image and
get
> the size and the width from the iterators while iterating.

No they don't. Not more than the extent function



More information about the kimageshop mailing list