FS#2066 - mandelbrot plugin

Attached to Project: Rockbox
Opened by Matthias Wientapper (mattzz) - Sunday, 14 March 2004, 01:59 GMT
Last edited by Jörg Hohensohn (hohensoh) - Wednesday, 14 April 2004, 23:51 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To Jörg Hohensohn (hohensoh)
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No



this little plugin draws a mandelbrot set on the LCD.
Might be used as a performance test or just for the fun
of it.
It takes about 35 seconds on my JBR20 with recent firmware.
I set the default number of maximum iterations per
pixel to 10. That seems to be a reasonable value for
the start in terms of speed and accuracy of the
resulting image.

After completion you will see two numbers: The upper
one is the number of ticks needed for the mandebrot
set. The lower number is the number of maximum
iterations for each pixel.

If you really have plenty of time:

Play: zoom in
ON: zoom out
OFF: quit
Curser: shift area to the given direction
F1: Increase number of iterations by 5
F2: decrease number of iterations by 5
F3: reset all values

At least it's fun with the simulator...

This task depends upon

Closed by  Jörg Hohensohn (hohensoh)
Wednesday, 14 April 2004, 23:51 GMT
Reason for closing:  Accepted
Comment by Jörg Hohensohn (hohensoh) - Sunday, 14 March 2004, 11:39 GMT

We can use floats? (Although strongly discouraged)
Didn't know that.
Comment by Matthias Wientapper (mattzz) - Sunday, 14 March 2004, 15:11 GMT

Here goes the first patch (mandelbrot-20040314.patch) with
the following changes:

- changed n_iter to 15 (40secs, but much nicer picture)
- added painting of equal diverging speeds
- changed aspect ratio of mandelbrot image with respect to
the display

I think it looks a bit nicer know (still competely pointless
- I know. Who the hell wants a jukebox to do the work of a
numbercruncher... eeh, I do :)

Comment by Matthias Wientapper (mattzz) - Monday, 15 March 2004, 01:28 GMT

This is the much faster fixed point math version.
Now it's even fun on the hardware :-)
(3.5secs for a mandelbrot set @ 15 Iterations per pixel)

Comment by Matthias Wientapper (mattzz) - Wednesday, 14 April 2004, 23:24 GMT

This is a three times faster version with higher accuracy.
- increased fractional part to 28 bit (higher accuracy,
deeper zooming)
- multiplications/divisions are now shift operations
- screen update every 8 lines with lcd_update_rect()
- some code tweaking for the sake of speed

Thanks to Joerg and Jens for the tough code review ;-)

Heading for a grayscale version...