00001 00034 #ifndef __VETLIB_VETINPUT_H__ 00035 #define __VETLIB_VETINPUT_H__ 00036 00037 #include "vetDefs.h" 00038 #include "vetFrameYUV420.h" 00039 #include "vetFrameRGB24.h" 00040 #include "vetFrameT.h" 00041 00047 #include <time.h> 00048 00049 //CLK_TCK 00050 //CLOCKS_PER_SEC 00051 00052 class vetInput 00053 { 00054 00055 protected: 00056 00063 float v_framerate; 00064 00071 long v_sleeptime; 00072 00080 clock_t v_elab_start; 00081 00090 inline void setElaborationStart(); 00091 00104 inline long getElaborationTime(); 00105 00106 00107 public: 00108 00109 00116 vetInput(float fps = 0); 00117 00118 00119 virtual ~vetInput() { } 00120 00126 virtual unsigned int getHeight() const = 0; 00127 00133 virtual unsigned int getWidth() const = 0; 00134 00135 00136 // getPreferredFormat 00137 00138 00139 00145 virtual VETRESULT reset() = 0; 00146 00153 virtual bool EoF() = 0; 00154 00155 00156 00157 00165 float getFrameRate() const { return v_framerate; }; 00166 00181 VETRESULT setFrameRate(float fps); 00182 00183 00184 00197 virtual VETRESULT extractTo(vetFrameYUV420& img) = 0; 00198 00211 virtual VETRESULT extractTo(vetFrameRGB24& img) = 0; 00212 00225 virtual VETRESULT extractTo(vetFrameT<unsigned char>& img) = 0; 00226 00227 00243 vetInput& operator >> (vetFrameYUV420& img); 00244 00260 vetInput& operator >> (vetFrameRGB24& img); 00261 00277 vetInput& operator >> (vetFrameT<unsigned char>& img); 00278 00279 00280 00287 enum{ vetClassType = VETCLASS_TYPE_INPUT }; 00288 00289 }; 00290 00291 00292 #endif //__VETLIB_VETINPUT_H__ 00293 00294
1.4.4