libalvision  2.0.6.8
/home/opennao/work/master/sdk/libnaoqi/libalvision/alvision/alvisionextractor.h
Go to the documentation of this file.
00001 
00007 #ifndef ALVISIONEXTRACTOR_H
00008 #define ALVISIONEXTRACTOR_H
00009 
00010 #include <alvision/alvisiondefinitions.h>
00011 #include <alvision/alimage.h>
00012 #include <alcommon/albroker.h>
00013 #include <alextractor/alextractor.h>
00014 #include <qi/macro.hpp>
00015 
00016 namespace AL {
00017 
00018 class ALValue;
00019 class ALVideoDeviceProxy;
00020 class ALVisionExtractorPrivate;
00021 
00037 class ALVisionExtractor : public ALExtractor {
00038 
00039 public:
00053   ALVisionExtractor(boost::shared_ptr<ALBroker> pBroker,
00054                     const std::string& pName,
00055                     int resolution=kQVGA, int colorspace=kBGRColorSpace,
00056                     int framerate=30, int activecamera=-1);
00057 
00058   virtual ~ALVisionExtractor();
00059 
00065   virtual bool setColorSpace(const int& colorSpace);
00066 
00072   virtual bool setFrameRate(const int& framerate);
00073   virtual bool setFrameRate(const std::string &pSubscribedName,
00074                             const int& framerate);
00075 
00081   virtual bool setResolution(const int& resolution);
00082 
00088   virtual bool setActiveCamera(const int& cameraId);
00089 
00090   boost::shared_ptr<AL::ALVideoDeviceProxy> getVideoDeviceProxy();
00091 
00092   int getColorSpace();
00093 
00094   int getFrameRate();
00095 
00096   int getResolution();
00097 
00098   int getActiveCamera();
00099 
00100   bool isPaused();
00101   bool isProcessing();
00102 
00103 
00110   QI_API_DEPRECATED void setParameter(const std::string& paramName,
00111                                       const ALValue& paramValue);
00112 
00116   virtual void start() = 0;
00117 
00123   virtual void process(ALImage* img) = 0;
00124 
00129   void pause(const bool& paused);
00130 
00134   virtual void stop() = 0;
00135 
00145   int getDefaultPeriod();
00146 
00147 
00155   int getMinimumPeriod();
00156 
00164   int getMaximumPeriod();
00165 
00166 
00167 protected:
00168   void xUpdateParameters(const int pPeriod, const float pPrecision);
00169   void setSubscriptionParameters(const std::vector< std::pair<int, int> >& parameters);
00170 
00171 private:
00172 
00173   //intentionnally undefined.
00174   ALVisionExtractor(const ALVisionExtractor& extractor);
00175   //intentionnally undefined.
00176   ALVisionExtractor& operator =(const ALVisionExtractor& extractor);
00177 
00178   void xStartDetection(const int pPeriod, const float pPrecision);
00179   void xStopDetection();
00180 
00181   void xRun();
00182 
00183   ALVisionExtractorPrivate* _pImpl;
00184 };
00185 
00186 } // namespace AL.
00187 
00188 #endif // ALVISIONEXTRACTOR_H
 All Classes Namespaces Files Functions Variables Defines