Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
vpPylonGrabber.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 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 https://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 
45 #ifndef _vpPylonGrabber_h_
46 #define _vpPylonGrabber_h_
47 
48 #include <ostream>
49 #include <visp3/core/vpConfig.h>
50 #include <visp3/core/vpFrameGrabber.h>
51 
52 #ifdef VISP_HAVE_PYLON
53 
54 // Work around: /usr/X11R6/include/X11/X.h:115:30: note: expanded from macro
55 // 'None'
56 #ifdef None
57 #undef None
58 #endif
59 // Work around: /usr/X11R6/include/X11/Xlib.h:83:16: note: expanded from
60 // macro 'Status'
61 #ifdef Status
62 #undef Status
63 #endif
64 
65 #include <pylon/PylonIncludes.h>
66 
97 class VISP_EXPORT vpPylonGrabber : public vpFrameGrabber
98 {
99 public:
103  virtual ~vpPylonGrabber() { };
104 
108  {
113  USERSET_UNKNOWN
114  };
115 
121  virtual void acquire(vpImage<unsigned char> &I) = 0;
127  virtual void acquire(vpImage<vpRGBa> &I) = 0;
128 
137  virtual void close() = 0;
143  virtual void connect() = 0;
149  virtual void disconnect() = 0;
150 
162  virtual float getBlackLevel() = 0;
168  virtual std::ostream &getCameraInfo(std::ostream &os) = 0;
175  virtual Pylon::CInstantCamera *getCameraHandler() = 0;
177  virtual unsigned int getCameraIndex() const = 0;
184  virtual std::string getCameraSerial(unsigned int index) = 0;
196  virtual float getExposure() = 0;
203  virtual float getFrameRate() = 0;
210  virtual float getGain() = 0;
216  virtual unsigned int getNumCameras() = 0;
223  virtual float getGamma() = 0;
233  virtual bool loadUserSet(UserSetName user_set) = 0;
241 
243  virtual bool isConnected() const = 0;
245  virtual bool isCaptureStarted() const = 0;
250  virtual void open(vpImage<unsigned char> &I) = 0;
255  virtual void open(vpImage<vpRGBa> &I) = 0;
256 
267 
282  virtual float setBlackLevel(float blacklevel_value) = 0;
299  virtual void setCameraIndex(unsigned int index) = 0;
306  virtual void setCameraSerial(const std::string &serial) = 0;
324  virtual float setExposure(bool exposure_on, bool exposure_auto, float exposure_value) = 0;
337  virtual float setGain(bool gain_auto, float gain_value) = 0;
345  virtual float setFrameRate(float frame_rate) = 0;
358  virtual float setGamma(bool gamma_on, float gamma_value = 1) = 0;
370  virtual bool saveUserSet(UserSetName user_set, bool set_default = false) = 0;
380  virtual bool setUserSetDefault(UserSetName user_set) = 0;
381 
387  virtual void startCapture() = 0;
393  virtual void stopCapture() = 0;
394 };
395 END_VISP_NAMESPACE
396 #endif // #ifdef VISP_HAVE_PYLON
397 #endif // #ifndef _vpPylonGrabber_h_
Base class for all video devices. It is designed to provide a front end to video sources.
virtual void startCapture()=0
virtual void close()=0
Stop active camera capturing images and disconnect the active camera.
virtual float getFrameRate()=0
virtual void disconnect()=0
virtual float setExposure(bool exposure_on, bool exposure_auto, float exposure_value)=0
virtual float setGain(bool gain_auto, float gain_value)=0
virtual bool isConnected() const =0
Return true if the camera is connected.
virtual unsigned int getNumCameras()=0
Get the number of cameras of specific subclasses. GigE, USB, etc.
virtual void open(vpImage< vpRGBa > &I)=0
virtual void setCameraSerial(const std::string &serial)=0
virtual vpPylonGrabber & operator>>(vpImage< vpRGBa > &I)=0
virtual float getBlackLevel()=0
virtual void acquire(vpImage< vpRGBa > &I)=0
virtual float setGamma(bool gamma_on, float gamma_value=1)=0
virtual float setFrameRate(float frame_rate)=0
virtual float getGain()=0
virtual void acquire(vpImage< unsigned char > &I)=0
virtual void stopCapture()=0
virtual float getExposure()=0
virtual bool setUserSetDefault(UserSetName user_set)=0
Sets the configuration set to be used as the default startup set.
virtual void open(vpImage< unsigned char > &I)=0
virtual vpPylonGrabber & operator>>(vpImage< unsigned char > &I)=0
virtual void connect()=0
virtual unsigned int getCameraIndex() const =0
virtual std::string getCameraSerial(unsigned int index)=0
virtual std::ostream & getCameraInfo(std::ostream &os)=0
virtual UserSetName getUserSetDefault()=0
Gets the configuration set being used as the default startup set.
virtual ~vpPylonGrabber()
virtual bool isCaptureStarted() const =0
Return true if the camera capture is started.
@ USERSET_DEFAULT
The default user set.
@ USERSET_USERSET1
User set 1.
@ USERSET_USERSET3
User set 3.
@ USERSET_USERSET2
User set 2.
virtual Pylon::CInstantCamera * getCameraHandler()=0
virtual void setCameraIndex(unsigned int index)=0
virtual bool loadUserSet(UserSetName user_set)=0
Loads the selected configuration into the camera's volatile memory and makes it the active configurat...
virtual bool saveUserSet(UserSetName user_set, bool set_default=false)=0
Saves the current active configuration set into the selected user set.
virtual float setBlackLevel(float blacklevel_value)=0
virtual float getGamma()=0