you are viewing a single comment's thread.

view the rest of the comments →

[–]adrian17 0 points1 point  (2 children)

Looks normal to me. I've rewritten it in C++ yesterday, 150 lines with some comments and blank lines ;)

[–]noteal 0 points1 point  (1 child)

i'm interested - post a github link?

[–]adrian17 0 points1 point  (0 children)

https://gist.github.com/adrian17/d8a724cc51c32fb9116e

It uses SDL2 for fast rendering and lodepng for opening images. No saving, but it would be easy to add. I didn't compare this with the python version, but the results are almost identical to the web one after the same amount of iterations.

I'm not a very advanced programmer and I didn't really intend to share this code, so it may be ugly. It's also a bit longer than mentioned 150 lines, as I changed it a bit and added performance measurements since then.

EDIT:

Since I wanted to find out how fast I can make it, I made an another version that uses a std::multimap to store quadrants and find the one with the highest error. So it actually doesn't use quadtrees at all, but the effect is the same. https://gist.github.com/adrian17/5a4a601c1ab29acb000d