mercredi 28 mars 2018

formula to pick every pixel in a bitmap without repeating

I'm looking for an algorithm, I am programming in swift now but any reasonably similar "C family" syntax will do.

Imagine a large list of values, such as pixels in a bitmap. You want to pick each one, one at a time, and never pick the same one twice, and always end up picking them all.

I used it before in a Fractal generator so that it was not just rendering line by line, but built it up slowly in a stochastic way, but that was long ago, in a Java applet, and I no longer have the code.

I do not believe it used any pseudo-random number generator, and the main thing I liked about it is that it did not make the rendering time take longer than the just line by line approach. Any of the shuffling algorithms I looked at would make the rendering take longer with such a large number of values to deal with, unless I'm missing something.




Aucun commentaire:

Enregistrer un commentaire