Filters : Preview and Adjustement Layer

Cyrille Berger cberger at
Tue Jan 29 22:38:37 CET 2008

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.

Cyrille Berger

More information about the kimageshop mailing list