Visual Servoing Platform  version 3.2.1 under development (2019-08-19)
vpPylonGrabber.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See http://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description: Classes allow to grab images from a Basler camera using
32  * Pylon SDK.
33  *
34  * Authors:
35  * Wenfeng CAI
36  *
37  *****************************************************************************/
38 
39 #ifndef _vpPylonGrabber_h_
40 #define _vpPylonGrabber_h_
41 
42 #include <ostream>
43 #include <visp3/core/vpConfig.h>
44 #include <visp3/core/vpFrameGrabber.h>
45 
46 #ifdef VISP_HAVE_PYLON
47 
48 // Work arround: /usr/X11R6/include/X11/X.h:115:30: note: expanded from macro
49 // 'None'
50 #ifdef None
51 #undef None
52 #endif
53 // Work arround: /usr/X11R6/include/X11/Xlib.h:83:16: note: expanded from
54 // macro 'Status'
55 #ifdef Status
56 #undef Status
57 #endif
58 
59 #include <pylon/PylonIncludes.h>
60 
96 class VISP_EXPORT vpPylonGrabber : public vpFrameGrabber
97 {
98 public:
102  virtual ~vpPylonGrabber(){};
103 
106  enum UserSetName {
111  USERSET_UNKNOWN
112  };
113 
119  virtual void acquire(vpImage<unsigned char> &I) = 0;
125  virtual void acquire(vpImage<vpRGBa> &I) = 0;
126 
135  virtual void close() = 0;
141  virtual void connect() = 0;
147  virtual void disconnect() = 0;
148 
160  virtual float getBlackLevel() = 0;
166  virtual std::ostream &getCameraInfo(std::ostream &os) = 0;
173  virtual Pylon::CInstantCamera *getCameraHandler() = 0;
175  virtual unsigned int getCameraIndex() const = 0;
182  virtual std::string getCameraSerial(unsigned int index) = 0;
194  virtual float getExposure() = 0;
201  virtual float getFrameRate() = 0;
208  virtual float getGain() = 0;
214  virtual unsigned int getNumCameras() = 0;
221  virtual float getGamma() = 0;
231  virtual bool loadUserSet(UserSetName user_set) = 0;
238  virtual UserSetName getUserSetDefault() = 0;
239 
241  virtual bool isConnected() const = 0;
243  virtual bool isCaptureStarted() const = 0;
248  virtual void open(vpImage<unsigned char> &I) = 0;
253  virtual void open(vpImage<vpRGBa> &I) = 0;
254 
259  virtual vpPylonGrabber &operator>>(vpImage<unsigned char> &I) = 0;
264  virtual vpPylonGrabber &operator>>(vpImage<vpRGBa> &I) = 0;
265 
280  virtual float setBlackLevel(float blacklevel_value) = 0;
297  virtual void setCameraIndex(unsigned int index) = 0;
304  virtual void setCameraSerial(const std::string &serial) = 0;
322  virtual float setExposure(bool exposure_on, bool exposure_auto, float exposure_value) = 0;
335  virtual float setGain(bool gain_auto, float gain_value) = 0;
343  virtual float setFrameRate(float frame_rate) = 0;
356  virtual float setGamma(bool gamma_on, float gamma_value = 1) = 0;
368  virtual bool saveUserSet(UserSetName user_set, bool set_default = false) = 0;
378  virtual bool setUserSetDefault(UserSetName user_set) = 0;
379 
385  virtual void startCapture() = 0;
391  virtual void stopCapture() = 0;
392 };
393 
394 #endif // #ifdef VISP_HAVE_PYLON
395 #endif // #ifndef _vpPylonGrabber_h_
virtual ~vpPylonGrabber()
virtual void open(vpImage< unsigned char > &I)=0
The default user set.
Base class for all video devices. It is designed to provide a front end to video sources.
virtual void close()=0
virtual void acquire(vpImage< unsigned char > &I)=0