Image Component Library (ICL)
DCGrabberThread.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLIO/src/ICLIO/DCGrabberThread.h **
10 ** Module : ICLIO **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLIO/DC.h>
34 #include <ICLIO/DCDeviceOptions.h>
35 #include <ICLUtils/Thread.h>
36 #include <ICLCore/Types.h>
37 #include <ICLUtils/Time.h>
38 
39 
40 #include <vector>
41 
42 
43 namespace icl{
44  namespace io{
45 
47  class DCGrabber;
50  namespace dc{
51 
53  class DCFrameQueue;
56 
91  public:
93  friend class icl::io::DCGrabber;
94 
96  ICLIO_API virtual void run();
97 
99  ICLIO_API static void stopAllGrabberThreads();
100 
102  ICLIO_API void resetBus();
103 
104  private:
106  DCGrabberThread(dc1394camera_t* c, DCDeviceOptions *options);
107 
110 
112  //void getCurrentImage(core::ImgBase **ppoDst,dc1394color_filter_t bayerLayout);
113 
115 
125  void getCurrentImage(core::ImgBase **ppoDst,
126  core::ImgBase **ppoDstTmp,
127  bool &desiredParamsFullfilled,
128  const utils::Size &desiredSizeHint,
129  core::format desiredFormatHint,
130  core::depth desiredDepthHint,
131  dc1394color_filter_t bayerLayout,
132  dc1394bayer_method_t bayerMethod=DC1394_BAYER_METHOD_BILINEAR);
133 
135  void getCurrentImage(core::ImgBase **ppoDst,
136  dc1394color_filter_t bayerLayout,
137  dc1394bayer_method_t bayerMethod=DC1394_BAYER_METHOD_BILINEAR);
138 
139 
140  dc1394video_frame_t *waitForNextImageFrame();
141 
144 
146  dc1394camera_t* m_poCam;
147 
149  std::vector<icl8u> m_oRGBInterleavedBuffer;
150 
153 
156  };
157  }
158  } // namespace io
159 }
160 
undocument this line if you encounter any issues!
Definition: Any.h:37
dc1394video_frame_t * waitForNextImageFrame()
Simple object oriented thread class wrapping the pthread library.
Definition: Thread.h:90
DCFrameQueue * m_poFrameQueue
internally used DCFrameQueue object
Definition: DCGrabberThread.h:143
DCGrabberThread(dc1394camera_t *c, DCDeviceOptions *options)
private constructor )can only be called by icl::DCGrabber
ICL Time class (taken from the Ice lib)
Definition: Time.h:52
Utility struct for DC Camera device options.
Definition: DCDeviceOptions.h:39
static ICLIO_API void stopAllGrabberThreads()
called by the signal handler to stop all grabber threads
Grabber implementation for handling DC-Devices using libdc1394 (Version >= 2.0.rc9) .
Definition: DCGrabber.h:87
format
determines the color-format, that is associated with the images channels
Definition: Types.h:70
ICLIO_API void resetBus()
internally calls dc1394_reset_bus (not save!)
#define ICLIO_API
Definition: CompatMacros.h:176
virtual ICLIO_API void run()
the thread function (moved frames)
Size class of the ICL.
Definition: Size.h:61
DCDeviceOptions * m_poOptions
Parents DCGrabbers options pointer.
Definition: DCGrabberThread.h:152
Internally spawned thread class to provide continuous grabbing without drop frames.
Definition: DCGrabberThread.h:90
dc1394camera_t * m_poCam
Associated camera.
Definition: DCGrabberThread.h:146
depth
determines the pixel type of an image (8Bit-int or 32Bit-float)
Definition: Types.h:60
std::vector< icl8u > m_oRGBInterleavedBuffer
internally used buffer for RGB-Bayer image conversion
Definition: DCGrabberThread.h:149
void getCurrentImage(core::ImgBase **ppoDst, core::ImgBase **ppoDstTmp, bool &desiredParamsFullfilled, const utils::Size &desiredSizeHint, core::format desiredFormatHint, core::depth desiredDepthHint, dc1394color_filter_t bayerLayout, dc1394bayer_method_t bayerMethod=DC1394_BAYER_METHOD_BILINEAR)
private image access function
Internal used utility class for fast handling of DMA buffers.
Definition: DCFrameQueue.h:55
utils::Time m_lastFramesTimeStamp
to remember the time stamp of the last frame grabbed
Definition: DCGrabberThread.h:155
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131