00001 # ifndef OCRModule_h
00002 # define OCRModule_h OCRModule_h
00003
00004 # include "ProcessComponent.h"
00005 # include "SegmentComponent.h"
00006 # include "IdentifyComponent.h"
00007 # include "FormatComponent.h"
00008
00009 namespace Conjecture {
00010
00011 class Env;
00012
00047
00048 class OCRModule {
00049 public:
00050
00051 OCRModule();
00052
00053
00054
00055
00056
00057
00058 inline FormatComponent* format() const { return this->_format; }
00059 inline IdentifyComponent* identify() const { return this->_identify; }
00060 inline SegmentComponent* segment() const { return this->_segment; }
00061 inline ProcessComponent* process() const { return this->_process; }
00062
00063 void init();
00064
00065
00066 virtual ProcessComponent* createProcessComponent() const = 0;
00067 virtual SegmentComponent* createSegmentComponent() const = 0;
00068 virtual IdentifyComponent* createIdentifyComponent() const = 0;
00069 virtual FormatComponent* createFormatComponent() const = 0;
00070
00078 virtual void processArgs(int argc, const char** argv, Env* env = NULL) { }
00079
00080 protected:
00081
00082 inline void formatIs(FormatComponent* format) { this->_format = format; }
00083 inline void identifyIs(IdentifyComponent* identify) { this->_identify = identify; }
00084 inline void segmentIs(SegmentComponent* segment) { this->_segment = segment; }
00085 inline void processIs(ProcessComponent* process) { this->_process = process; }
00086
00087
00088
00089 private:
00090
00091
00092
00093
00094
00095 FormatComponent* _format;
00096 IdentifyComponent* _identify;
00097 SegmentComponent* _segment;
00098 ProcessComponent* _process;
00099 };
00100 };
00101
00102 # endif // OCRModule_h
00103