Logo Search packages:      
Sourcecode: djvulibre version File versions

GP< DataPool > DjVuDocEditor::get_thumbnail ( int  page_num,
bool  dont_decode 
) [protected, virtual]

Returns a {DataPool} containing one chunk TH44# with the encoded thumbnail for the specified page. The function first looks for thumbnails enclosed into the document and if it fails to find one, it decodes the required page and creates the thumbnail on the fly (unless dont_decode# is true).

{ Note:} It may happen that the returned {DataPool} will not contain all the data you need. In this case you will need to install a trigger into the {DataPool} to learn when the data actually arrives.

Reimplemented from DjVuDocument.

Definition at line 1488 of file DjVuDocEditor.cpp.

References GMapTemplate< KTYPE, VTYPE, TI >::contains(), DjVuDocument::get_thumbnail(), and page_to_id().

{
   const GUTF8String id(page_to_id(page_num));

   GCriticalSectionLock lock(&thumb_lock);
   const GPosition pos(thumb_map.contains(id));
   if (pos)
   {
         // Get the image from the map
      return thumb_map[pos];
   } else
   {
      unfile_thumbnails();
      return DjVuDocument::get_thumbnail(page_num, dont_decode);
   }
}


Generated by  Doxygen 1.6.0   Back to index