00001 # ifndef Conjecture_OCRModule_h
00002 # define Conjecture_OCRModule_h Conjecture_OCRModule_h
00003
00004
00005
00006
00007
00008 # include "ProcessComponent.h"
00009 # include "SegmentComponent.h"
00010 # include "IdentifyComponent.h"
00011 # include "FormatComponent.h"
00012
00013 namespace Conjecture {
00014
00015 class Env;
00016
00055 class OCRModule {
00056 public:
00057
00058 OCRModule();
00059
00060
00061
00062
00063
00064
00065 inline FormatComponent* format() const { return this->_format; }
00066 inline IdentifyComponent* identify() const { return this->_identify; }
00067 inline SegmentComponent* segment() const { return this->_segment; }
00068 inline ProcessComponent* process() const { return this->_process; }
00069
00070 void init();
00071
00072
00073 virtual ProcessComponent* createProcessComponent() const = 0;
00074 virtual SegmentComponent* createSegmentComponent() const = 0;
00075 virtual IdentifyComponent* createIdentifyComponent() const = 0;
00076 virtual FormatComponent* createFormatComponent() const = 0;
00077
00085 virtual void processArgs(int argc, const char** argv, Env* env = NULL) { }
00086
00087 protected:
00088
00089 inline void formatIs(FormatComponent* format) { this->_format = format; }
00090 inline void identifyIs(IdentifyComponent* identify) { this->_identify = identify; }
00091 inline void segmentIs(SegmentComponent* segment) { this->_segment = segment; }
00092 inline void processIs(ProcessComponent* process) { this->_process = process; }
00093
00094
00095
00096 private:
00097
00098
00099
00100
00101
00102 FormatComponent* _format;
00103 IdentifyComponent* _identify;
00104 SegmentComponent* _segment;
00105 ProcessComponent* _process;
00106 };
00107 };
00108
00109 # endif // OCRModule_h
00110