On 12.07.2012 17:32, Andrew Wood wrote:
Im currently trying to improve the efficency of the file reading code though. Initially just to get it up & running I've got it reading every file into a c++ vector before drawing starts. This is fine if the number of images & the file size is modest but it causes problems with lots of large files.
Please have a look at the ShowImage source code in src/apps/showimage. Of special interest are the classes ImageFileNavigator, and ImageCache which you might be able to reuse almost completely.
All that is missing would be using a random order to iterate through the files (possibly using a Navigator wrapper class).
I'm not sure if you've followed Haiku's coding style already, but this sounds like a nice candidate for inclusion in trunk. In that case, the ShowImage sources could be used directly, without the need for duplication in the tree.
I would then also add a query iterator, I don't think ShowImage supports that already.
Bye, Axel.