Filters : Preview and Adjustement Layer

Boudewijn Rempt boud at valdyas.org
Tue Jan 29 22:42:52 CET 2008


On Tue, 29 Jan 2008, Cyrille Berger wrote:

> On Monday 28 January 2008, Cyrille Berger wrote:
> > > Another thing, now we're on this topic: we will need to save the seed for
> > > some filters that do random permutations in their filter configs, like
> > > raindrops.
> >
> > It's quiet easy, the reason I haven't do it yet, is that I am not sure
> > wether rand and srand are thread safe. But looking at Qt's doc, qrand and
> > qsrand are. So we might just use that.
> In fact what we need is a random number generator that allways return the same 
> value for a pixel (for a given seed). A ugly possibility would be to do 
> something like qsrand( xpixel * ypixel + seed); randum_number = qrand(); A 
> more elegant alternative would be to have a KisRandom class with a function 
> returning the random number for each pixels.

I'm still going to reply to your other mail -- but my social life this
month is madness. In any case, let's go for the elegant alternative. We
can't have images change every time they're opened or a layer is painted on!

Boudewijn



More information about the kimageshop mailing list