frame_observer.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 #ifndef FRAME_OBSERVER_H
00034 #define FRAME_OBSERVER_H
00035 
00036 #include <queue>
00037 #include <boost/thread/mutex.hpp>
00038 #include <boost/function.hpp>
00039 
00040 #include <VimbaCPP/Include/VimbaCPP.h>
00041 
00042 using namespace AVT::VmbAPI;
00043 
00044 class FrameObserver : virtual public IFrameObserver
00045 {
00046   public:
00047 
00048     typedef boost::function<void (const FramePtr vimba_frame_ptr)> Callback;
00049 
00050     // We pass the camera that will deliver the frames to the constructor
00051     FrameObserver( CameraPtr cam_ptr, Callback callback);
00052 
00053     // Destructor
00054     ~FrameObserver(){};
00055 
00056     // This is our callback routine that will be executed on every received frame
00057     virtual void FrameReceived( const FramePtr vimba_frame_ptr );
00058 
00059     // After the view has been notified about a new frame it can pick it up
00060     FramePtr GetFrame();
00061 
00062     // Clears the double buffer frame queue
00063     void ClearFrameQueue();
00064 
00065   private:
00066     // Frame observer stores all FramePtr
00067     std::queue<FramePtr> vimba_frames;
00068     CameraPtr cam_ptr_;
00069     boost::mutex mutex;
00070     Callback callback_;
00071 };
00072 
00073 #endif


avt_vimba_camera
Author(s): Miquel Massot , Allied Vision Technologies
autogenerated on Thu Aug 27 2015 12:29:49