00001 00002 00003 #ifndef __FLYCAPTUREVS_H 00004 #define __FLYCAPTUREVS_H 00005 00006 #include "videosource.h" 00007 #include <pgrflycapture.h> 00008 00010 class FlyCaptureVideoSource : public VideoSource 00011 { 00012 public: 00013 00014 FlyCaptureVideoSource(); 00015 00016 virtual bool initialize(); 00017 virtual bool getFrame(IplImage *dst); 00018 void getSize(int &width, int &height); 00019 virtual ~FlyCaptureVideoSource(); 00020 virtual void start(); 00021 virtual void stop(); 00022 virtual bool isPlaying() { return playing; }; 00023 virtual const char *getStreamName() const { return "FlyCapture live stream"; } 00024 virtual const char *getStreamType() const { return "FlyCapture"; } 00025 00026 private: 00027 FlyCaptureError error; 00028 FlyCaptureContext context; 00029 FlyCaptureVideoMode videoMode; 00030 FlyCaptureImage pImage; 00031 IplImage *tempImageColor; 00032 IplImage *tempImageGray ; 00033 IplImage *tempImageColorResized ; 00034 bool playing; 00035 bool imagesExist; 00036 }; 00037 00038 class FlyCaptureFactory : public ParticularVSFactory { 00039 public: 00040 FlyCaptureFactory() { name="FlyCapture"; }; 00041 virtual void registerParameters(ParamSection *sec); 00042 virtual VideoSource *construct(); 00043 private: 00044 bool use; 00045 }; 00046 #endif 00047