WmhIdentify.h

00001 # ifndef WmhIdentify_h
00002 # define WmhIdentify_h WmhIdentify_h
00003 
00004 // ####################################################################
00005 // # Conjecture: An Extensible Optical Character Recognition Framework  #
00006 // #                                                                  #
00007 // # Copyright: Lesser GNU Public License (LGPL)                      #
00008 // #                                                                  #
00009 // # Overview:                                                        #
00010 // #  - Conjecture is a collection of C++ classes, and an OCR engine    #
00011 // #  - Conjecture is designed to allow customization at all levels     #
00012 // #    and to encourage individuals to contribute incremental        #
00013 // #    improvements in algorithms.                                   #
00014 // #  - Overall design discussions can be found in                    #
00015 // #      $SNROOT/docs/doxygen/html/index.html                        #
00016 // #  - Conjecture is designed to interact with and build on other      #
00017 // #    open-source OCR programs.                                     #
00018 // ####################################################################
00019 
00020 # include "IdentifyComponent.h" // parent
00021 # include <vector>
00022 # include <map>
00023 
00024 namespace Conjecture {
00025     class Glyph;
00026     class PixFilt;
00027     class GlyphFeatures;
00028 
00029     // ##################################################################
00035     // ##################################################################
00036     class WmhIdentify : public IdentifyComponent {
00037       public:
00038         // Types
00039         typedef std::map<wchar_t,GlyphFeatures*> Charset;
00040 
00041         // Constructors/Destructors
00042         WmhIdentify();
00043         virtual ~WmhIdentify();
00044         
00045         // **************
00046         // Accessors
00047         inline const Charset & charset() const { return this->_charset; }
00048         inline const PixFilt*  stdfilt() const { return this->_stdfilt; }
00049         inline const std::vector<PixFilt*> & filters() const { return this->_filters; }
00050         
00051         // **************
00052         // Input/Output
00053         
00054         // **************
00055         // Interface
00056         virtual bool execute(Page* page);
00057 
00058         virtual bool execute(Glyph* glyph);
00059         
00060       protected:
00061         // **************
00062         // Accessors
00063         inline void            charsetIs(const Charset & charset) { this->_charset = charset; }
00064         inline void            stdfiltIs(PixFilt* stdfilt) { this->_stdfilt = stdfilt; }
00065         inline void            filtersIs(const std::vector<PixFilt*> & filters) { this->_filters = filters; }
00066         
00067         // **************
00068         // Methods 
00069         
00070       private: 
00071         // **************
00072         // Accessors
00073         inline Charset &       charsetRef() { return this->_charset; }
00074         inline PixFilt* &      stdfiltRef() { return this->_stdfilt; }
00075         inline std::vector<PixFilt*> & filtersRef() { return this->_filters; }
00076         
00077         // **************
00078         // Methods 
00079         
00080         // **************
00081         // State
00082 
00094         Charset         _charset;
00095 
00100         PixFilt*        _stdfilt;
00101 
00103         std::vector<PixFilt*> _filters;
00104     };
00105 }
00106 
00107 # endif // WmhIdentify_h
00108 

Generated on Wed Jun 14 15:08:02 2006 for Conjecture by  doxygen 1.4.6