Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
DCGrabberThread.h
Go to the documentation of this file.
00001 /********************************************************************
00002 **                Image Component Library (ICL)                    **
00003 **                                                                 **
00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld          **
00005 **                         Neuroinformatics Group                  **
00006 ** Website: www.iclcv.org and                                      **
00007 **          http://opensource.cit-ec.de/projects/icl               **
00008 **                                                                 **
00009 ** File   : ICLIO/src/ICLIO/DCGrabberThread.h                      **
00010 ** Module : ICLIO                                                  **
00011 ** Authors: Christof Elbrechter                                    **
00012 **                                                                 **
00013 **                                                                 **
00014 ** GNU LESSER GENERAL PUBLIC LICENSE                               **
00015 ** This file may be used under the terms of the GNU Lesser General **
00016 ** Public License version 3.0 as published by the                  **
00017 **                                                                 **
00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
00019 ** included in the packaging of this file.  Please review the      **
00020 ** following information to ensure the license requirements will   **
00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt                **
00022 **                                                                 **
00023 ** The development of this software was supported by the           **
00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology.    **
00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche       **
00026 ** Forschungsgemeinschaft (DFG) in the context of the German       **
00027 ** Excellence Initiative.                                          **
00028 **                                                                 **
00029 ********************************************************************/
00030 
00031 #pragma once
00032 
00033 #include <ICLIO/DC.h>
00034 #include <ICLIO/DCDeviceOptions.h>
00035 #include <ICLUtils/Thread.h>
00036 #include <ICLCore/Types.h>
00037 #include <ICLUtils/Time.h>
00038 
00039 
00040 #include <vector>
00041 
00042 
00043 namespace icl{
00044   namespace io{
00045   
00047     class DCGrabber;
00050     namespace dc{
00051       
00053       class DCFrameQueue;
00056 
00057 
00090       class DCGrabberThread : public utils::Thread{
00091         public: 
00093         friend class icl::io::DCGrabber;
00094   
00096         ICLIO_API virtual void run();
00097         
00099         ICLIO_API static void stopAllGrabberThreads();
00100         
00102         ICLIO_API void resetBus();
00103         
00104         private: 
00106         DCGrabberThread(dc1394camera_t* c, DCDeviceOptions *options);
00107   
00109         ~DCGrabberThread();
00110   
00112         //void getCurrentImage(core::ImgBase **ppoDst,dc1394color_filter_t bayerLayout);
00113         
00115 
00125         void getCurrentImage(core::ImgBase **ppoDst, 
00126                              core::ImgBase **ppoDstTmp,
00127                              bool &desiredParamsFullfilled, 
00128                              const utils::Size &desiredSizeHint, 
00129                              core::format desiredFormatHint,
00130                              core::depth desiredDepthHint,
00131                              dc1394color_filter_t bayerLayout,
00132                              dc1394bayer_method_t bayerMethod=DC1394_BAYER_METHOD_BILINEAR);
00133   
00135         void getCurrentImage(core::ImgBase **ppoDst, 
00136                              dc1394color_filter_t bayerLayout,
00137                              dc1394bayer_method_t bayerMethod=DC1394_BAYER_METHOD_BILINEAR);
00138   
00139         
00140         dc1394video_frame_t *waitForNextImageFrame();
00141         
00143         DCFrameQueue *m_poFrameQueue;
00144   
00146         dc1394camera_t* m_poCam;
00147         
00149         std::vector<icl8u> m_oRGBInterleavedBuffer;
00150         
00152         DCDeviceOptions *m_poOptions;
00153   
00155         utils::Time m_lastFramesTimeStamp;
00156       };
00157     }
00158   } // namespace io
00159 }
00160 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines