what is the best and efficient way to display bunch of images (fast transition animation)?
basic idea is hold about 10,000 images and randomely select 20~50 images and display fast switching image animation in certain time trigger by something event.
as far as I know, raspberry pi has very limited memory, so definitely cannot load of all images. so… probably get random index number between 0 - 9999 and load that images… and displaying …
it’s just idea… I’ll gonna write and test soon… but
anyone have good suggestion ?
Take a look at this thread
You cannot do any OpenGL work outside of the main thread. When you call loadImage(...), internally the ofImage object automatically attempts to upload the pixels data into a texture on the graphics card (it does this using OpenGL). Since you are trying to do this in a thread outside of the main thread, it fails to upload the texture to the graphics card and without that you can’t draw it.
In addons like ofxIpVideoGrabber I start off by disabling texture use. See this:
Then once we’re bac…
Maybe do some tests and see how many images you can handle at once, make two arrays (using pixels and just uploading to textures as you need as outlined in the discussion) for this amount and as you are using one set you can load another set in a background thread. You can use them in a cyclic way, using one set to draw while you have another set loading.
Also i would recommend using ofThreadChannel instead of mutexes if you want to avoid some headaches.
The ofxThreadedImageLoader is a good place to look into to see how to use it or any of the examples.
Apart from that freeimage is relatively slow so something like libjpeg-turbo can make loading much faster in the raspberry
@fresla , @arturo thanks all ! I’ll checking !