Image Component Library (ICL)
PylonGrabberThread.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/PylonGrabberThread.h **
10 ** Module : ICLIO **
11 ** Authors: Viktor Richter **
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 <ICLUtils/CompatMacros.h>
34 #include <ICLUtils/Thread.h>
35 #include <ICLIO/PylonUtils.h>
38 
39 #include <queue>
40 
41 namespace icl {
42  namespace io{
43  namespace pylon {
44 
47  public:
49 
54  ICLIO_API PylonGrabberThread(Pylon::IStreamGrabber* grabber,
55  PylonColorConverter* converter,
56  PylonCameraOptions* options);
60  ICLIO_API void run();
62  ICLIO_API void resetBuffer();
64 
70  private:
72  Pylon::IStreamGrabber* m_Grabber;
80  int m_Error;
82  int m_Timeout;
85 
87  void grab();
88  };
89 
90  }//namespace pylon
91  } // namespace io
92 }//namespace icl
ICLIO_API PylonGrabberThread(Pylon::IStreamGrabber *grabber, PylonColorConverter *converter, PylonCameraOptions *options)
Constructor sets all internal fields and allocates memory.
undocument this line if you encounter any issues!
Definition: Any.h:37
Simple object oriented thread class wrapping the pthread library.
Definition: Thread.h:90
ICLIO_API void run()
acquires images and writes them into an internal queue
int m_Timeout
A counter for acquisition timeouts.
Definition: PylonGrabberThread.h:82
This is the color-conversion-class for Pylon images.
Definition: PylonColorConverter.h:58
PylonColorConverter * m_Converter
A pointer to the ColorConverter.
Definition: PylonGrabberThread.h:74
ConcGrabberBuffer m_Buffers
A buffer holding read and write buffers.
Definition: PylonGrabberThread.h:78
ICLIO_API core::ImgBase * getCurrentImage()
getter for the most current image
ICLIO_API ~PylonGrabberThread()
Destructor frees all allocated memory.
#define ICLIO_API
Definition: CompatMacros.h:176
int m_Acquired
A counter for correct acquisitions.
Definition: PylonGrabberThread.h:84
PylonCameraOptions * m_Options
A pointer to the CameraOptions.
Definition: PylonGrabberThread.h:76
Pylon::IStreamGrabber * m_Grabber
A pointer to the image-providing StreamGrabber.
Definition: PylonGrabberThread.h:72
int m_Error
A counter for acquisition errors.
Definition: PylonGrabberThread.h:80
This is used for concurrent writing and reading of ConvBuffers.
Definition: PylonUtils.h:137
ICLIO_API void resetBuffer()
reinitializes buffer
Internally spawned thread class for continuous grabbing.
Definition: PylonGrabberThread.h:46
This is a helper class for Pylon camera settings.
Definition: PylonCameraOptions.h:44
void grab()
grabs a single image into m_BufferQueue.
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131