1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #pragma once
- #include <queue>
- #include "basic_struct.h"
- #include "feeder.h"
- /************************************************************************/
- /* 文件夹图像送入器 */
- /* 2014年12月9日16:04:06 */
- /* 作者:唐林 */
- /************************************************************************/
- class CFolderFeeder:public IFeeder
- {
- public:
- CFolderFeeder(void);
- ~CFolderFeeder(void);
- void SetReStartConfig(CString file,bool flag);
- void SetFolder( const std::string &img_dir );
- void SetPageNumber(int nCount){ m_nPageNumber = nCount; };
- virtual bool GetNext( BOOL wait,IplImage* & img, feeder_param& param );
- virtual BOOL SupportPause( void );
- int CheckFileCountValid();//检查文件夹是否合法
- protected:
- virtual ServiceState OnStarting( void );
- virtual ServiceState OnRunning( void );
- private:
- int m_count;
- std::string root_path;
- //当前正在查找的堆栈
- std::queue<CString> path_stack;
- //当前正在查找的堆栈
- CFileFind finder;
- CString m_reStartFile;
- bool m_reStartFlag;
- // 当前查找类型
- enum{unstart,file,dir,complete}m_cur_find_type;
- enum FILE_TYPE{FT_NONE,FT_JPG,FT_JPEG,FT_PNG,FT_BMP,FT_TIF,FT_TIFF,FT_END};
- int current_file_type;
- //状态同步锁
- RTL_CRITICAL_SECTION m_img_lock;
- BOOL m_finished;
- IplImage* m_img;
- feeder_param m_next_param;
- int m_nPageNumber;//试卷页数
- };
|