• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

DjVuImage.h

Go to the documentation of this file.
00001 //C-  -*- C++ -*-
00002 //C- -------------------------------------------------------------------
00003 //C- DjVuLibre-3.5
00004 //C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
00005 //C- Copyright (c) 2001  AT&T
00006 //C-
00007 //C- This software is subject to, and may be distributed under, the
00008 //C- GNU General Public License, Version 2. The license should have
00009 //C- accompanied the software or you may obtain a copy of the license
00010 //C- from the Free Software Foundation at http://www.fsf.org .
00011 //C-
00012 //C- This program is distributed in the hope that it will be useful,
00013 //C- but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //C- GNU General Public License for more details.
00016 //C- 
00017 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
00018 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech 
00019 //C- Software authorized us to replace the original DjVu(r) Reference 
00020 //C- Library notice by the following text (see doc/lizard2002.djvu):
00021 //C-
00022 //C-  ------------------------------------------------------------------
00023 //C- | DjVu (r) Reference Library (v. 3.5)
00024 //C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
00025 //C- | The DjVu Reference Library is protected by U.S. Pat. No.
00026 //C- | 6,058,214 and patents pending.
00027 //C- |
00028 //C- | This software is subject to, and may be distributed under, the
00029 //C- | GNU General Public License, Version 2. The license should have
00030 //C- | accompanied the software or you may obtain a copy of the license
00031 //C- | from the Free Software Foundation at http://www.fsf.org .
00032 //C- |
00033 //C- | The computer code originally released by LizardTech under this
00034 //C- | license and unmodified by other parties is deemed "the LIZARDTECH
00035 //C- | ORIGINAL CODE."  Subject to any third party intellectual property
00036 //C- | claims, LizardTech grants recipient a worldwide, royalty-free, 
00037 //C- | non-exclusive license to make, use, sell, or otherwise dispose of 
00038 //C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the 
00039 //C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU 
00040 //C- | General Public License.   This grant only confers the right to 
00041 //C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to 
00042 //C- | the extent such infringement is reasonably necessary to enable 
00043 //C- | recipient to make, have made, practice, sell, or otherwise dispose 
00044 //C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to 
00045 //C- | any greater extent that may be necessary to utilize further 
00046 //C- | modifications or combinations.
00047 //C- |
00048 //C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
00049 //C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
00050 //C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
00051 //C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
00052 //C- +------------------------------------------------------------------
00053 // 
00054 // $Id: DjVuImage.h,v 1.9 2005/04/27 16:34:13 leonb Exp $
00055 // $Name: release_3_5_15 $
00056 
00057 #ifndef _DJVUIMAGE_H
00058 #define _DJVUIMAGE_H
00059 #ifdef HAVE_CONFIG_H
00060 #include "config.h"
00061 #endif
00062 #if NEED_GNUG_PRAGMAS
00063 # pragma interface
00064 #endif
00065 
00066 
00105 
00106 
00107 
00108 #include "DjVuFile.h"
00109 #include "DjVuAnno.h"
00110 #include "GRect.h"
00111 
00112 #ifdef HAVE_NAMESPACES
00113 namespace DJVU {
00114 # ifdef NOT_DEFINED // Just to fool emacs c++ mode
00115 }
00116 #endif
00117 #endif
00118 
00119 /* Obsolete class included for backward compatibility. */
00120 
00121 class DjVuInterface
00122 {
00123 public:
00124   virtual ~DjVuInterface();
00125   virtual void notify_chunk(const char *chkid, const char *msg) = 0;
00126   virtual void notify_relayout(void) = 0;
00127   virtual void notify_redisplay(void) = 0;
00128 };
00129 
00130 
00138 class DjVuImage : public DjVuPort
00139 {
00140 protected:
00141   DjVuImage(void);
00142 public:
00143   enum { NOINFO, NOTEXT=1, NOMAP=4, NOMETA=8 };
00144   // CONSTRUCTION
00156   static GP<DjVuImage> create(void) {return new DjVuImage();}
00157 
00164   void      connect(const GP<DjVuFile> & file);
00165 
00167   static GP<DjVuImage> create(const GP<DjVuFile> &file)
00168   { const GP<DjVuImage> retval=create(); retval->connect(file); return retval; }
00169       
00171 
00172   // COMPONENTS
00178   GP<DjVuInfo>    get_info() const;
00182   GP<IW44Image>    get_bg44() const;
00187   GP<GPixmap>     get_bgpm() const;
00192   GP<JB2Image>    get_fgjb() const;
00197   GP<GPixmap>     get_fgpm() const;
00201   GP<DjVuPalette> get_fgbc() const;
00206   GP<ByteStream> get_anno() const;
00209   GP<ByteStream> get_text() const;
00212   GP<ByteStream> get_meta() const;
00214 
00215   // NEW STYLE DECODING
00222   bool wait_for_complete_decode(void);
00224   
00225   // OLD STYLE DECODING
00232   void decode(ByteStream & str, DjVuInterface *notifier=0);
00234   
00235   // UTILITIES
00242   int get_width() const;
00247   int get_height() const;
00251   int get_real_width() const;
00255   int get_real_height() const;
00260   int get_version() const;
00265   int get_dpi() const;
00269   int get_rounded_dpi() const;
00273   double get_gamma() const;
00277   GUTF8String get_mimetype() const;
00280   GUTF8String get_short_description() const;
00295   GUTF8String get_long_description() const;
00298   GP<DjVuFile> get_djvu_file(void) const;
00300   void writeXML(ByteStream &str_out,const GURL &doc_url, const int flags=0) const;
00302   void writeXML(ByteStream &str_out) const;
00304   GUTF8String get_XML(const GURL &doc_url, const int flags=0) const;
00306   GUTF8String get_XML(void) const;
00308 
00309   // CHECKING
00317   int is_legal_photo() const;
00323   int is_legal_bilevel() const;
00330   int is_legal_compound() const;
00332 
00333   // RENDERING 
00353   GP<GPixmap>  get_pixmap(const GRect &rect, const GRect &all, double gamma=0) const;
00362   GP<GBitmap>  get_bitmap(const GRect &rect, const GRect &all, int align = 1) const;
00370   GP<GPixmap>  get_bg_pixmap(const GRect &rect, const GRect &all, double gamma=0) const;
00378   GP<GPixmap>  get_fg_pixmap(const GRect &rect, const GRect &all, double gamma=0) const;
00379 
00380 
00383   void set_rotate(int count=0);
00385   int get_rotate() const;
00388   GP<DjVuAnno> get_decoded_anno();
00391   void map(GRect &rect) const;
00394   void unmap(GRect &rect) const;
00397   void map(int &x, int &y) const;
00400   void unmap(int &x, int &y) const;
00401 
00402 
00403 
00405 
00406   // Inherited from DjVuPort.
00407   virtual void notify_chunk_done(const DjVuPort *, const GUTF8String &name);
00408 
00409   // SUPERSEDED
00410   GP<GPixmap>  get_pixmap(const GRect &rect, int subs=1, double gamma=0) const;
00411   GP<GBitmap>  get_bitmap(const GRect &rect, int subs=1, int align = 1) const;
00412   GP<GPixmap>  get_bg_pixmap(const GRect &rect, int subs=1, double gamma=0) const;
00413   GP<GPixmap>  get_fg_pixmap(const GRect &rect, int subs=1, double gamma=0) const;
00414 private:
00415   GP<DjVuFile>      file;
00416   int           rotate_count;
00417   bool          relayout_sent;
00418   
00419   // HELPERS
00420   int stencil(GPixmap *pm, const GRect &rect, int subs, double gcorr) const;
00421   GP<DjVuInfo>      get_info(const GP<DjVuFile> & file) const;
00422   GP<IW44Image>     get_bg44(const GP<DjVuFile> & file) const;
00423   GP<GPixmap>       get_bgpm(const GP<DjVuFile> & file) const;
00424   GP<JB2Image>      get_fgjb(const GP<DjVuFile> & file) const;
00425   GP<GPixmap>       get_fgpm(const GP<DjVuFile> & file) const;
00426   GP<DjVuPalette>      get_fgbc(const GP<DjVuFile> & file) const;
00427   void init_rotate(const DjVuInfo &info);
00428 };
00429 
00430 
00431 inline GP<DjVuFile>
00432 DjVuImage::get_djvu_file(void) const
00433 {
00434    return file;
00435 }
00436 
00438 
00439 
00440 
00441 // ----- THE END
00442 
00443 #ifdef HAVE_NAMESPACES
00444 }
00445 # ifndef NOT_USING_DJVU_NAMESPACE
00446 using namespace DJVU;
00447 # endif
00448 #endif
00449 #endif

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal