FWIW, a little trick for creating thumbnails quickly is to do nearest-neighbor vertically, using data only from the same number of scanlines as the thumbnail has vertically, but do a nice resampling horizontally. This is especially good for file formats that allow you to have fast access to individual scanlines, even if it is only in-order access.
On Sat, Mar 31, 2012 at 1:12 PM, Larry Gritz <[email protected]> wrote: > I think relying on Qt to read and resize the image is probably not the > right approach. After all, OIIO is an image reading package! We probably > already have the images in memory (or will need them in memory), so the > last thing we want is a redundant read and copy by Qt. > > Some of the images formats we support can contain thumbnail images in the > files. In those cases, we should use the pre-computed thumbnails. By > convention, we store those in the metadata as "thumbnail_width", > "thumbnail_height", "thumbnail_nchannels", and "thumbnail_image". Look > through the code in src/targa.imageio to see an example of how those are > used. If those aren't present, we'll have to read the image and downsize > it. Also, for files that are already MIP-maps, you can pull a thumbnail > out by just grabbing one of the low res MIPmap levels. > > What do we do if no thumbnail is present in the file and it's not a > MIPmap? Well, you could pre-read all the files and generate thumbnails. > But you don't want to hold everything up for that to happen, so you > probably want a second thread that is reading ahead and filling in the > thumbnail images as it goes. Is it a big cost every time you start up? > Should there be a cache of thumbnails on disk (say, in $HOME/.ivthumb/*)? > Which would need to be careful to check for updates, delete old ones, and > not let cruft accumulate too much space there. > > -- lg > > On Mar 27, 2012, at 4:23 PM, Panks wrote: > > Hello! > I would like to put proposal for iv viewer thumbnail view. > I just have a small idea of how we can put it all together, we can put a > bar at the bottom of the iv with slider if required with a toggle button in > the menu bar which shows and hide the thumbnail bar at the bottom. > If the images have thumbnails embedded and they are of acceptable ratio > then we can use them directly else we can use QImage Scale() to scale them > to the required resolution. > And in case big images when we don't have thumbnails at all, we can make > the thumbnails in a separate thread using QImageReader class as this > article describes: > http://olliwang.com/2010/01/30/creating-thumbnail-images-in-qt/ > so that it will not affect the performance of iv viewer. We can implement > multiple selection on thumbnails and implement 'delete', 'shuffle by drag > and drop' and few more functions. > > Please Comment or put suggestion. > > Thank you > > -- > Pankaj > UG Student *|* Dept. of Computer Science and Engineering > IIT Madras, Chennai, India > > > -- > Larry Gritz > [email protected] > > > > _______________________________________________ > Oiio-dev mailing list > [email protected] > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org > >
_______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
