YARP
Yet Another Robot Platform
USBcamera.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: LGPL-2.1-or-later
4  */
5 
6 
7 #ifndef YARP_DEVICE_USBCAMERA_COMMON_USBCAMERA_H
8 #define YARP_DEVICE_USBCAMERA_COMMON_USBCAMERA_H
9 
10 
11 #include <yarp/os/Bottle.h>
12 #include <yarp/os/Semaphore.h>
13 #include <yarp/os/Stamp.h>
14 
15 #include <yarp/dev/DeviceDriver.h>
20 
34 {
35  USBCameraDriver(const USBCameraDriver&) = delete;
36  void operator=(const USBCameraDriver&) = delete;
37 
38 protected:
45 
46  size_t _width;
47  size_t _height;
48  int pixelType;
49 
50 public:
55 
59  ~USBCameraDriver() override;
60 
66  bool open(yarp::os::Searchable& config) override;
67 
72  bool close() override;
73 
74  int height() const;
75  int width() const;
76 
82 
88  bool getCameraDescription(CameraDescriptor* camera) override;
89  bool hasFeature(int feature, bool* hasFeature) override;
90  bool setFeature(int feature, double value) override;
91  bool getFeature(int feature, double* value) override;
92  bool setFeature(int feature, double value1, double value2) override;
93  bool getFeature(int feature, double* value1, double* value2) override;
94  bool hasOnOff(int feature, bool* HasOnOff) override;
95  bool setActive(int feature, bool onoff) override;
96  bool getActive(int feature, bool* isActive) override;
97  bool hasAuto(int feature, bool* hasAuto) override;
98  bool hasManual(int feature, bool* hasManual) override;
99  bool hasOnePush(int feature, bool* hasOnePush) override;
100  bool setMode(int feature, FeatureMode mode) override;
101  bool getMode(int feature, FeatureMode* mode) override;
102  bool setOnePush(int feature) override;
107  int getRgbHeight() override;
108 
113  int getRgbWidth() override;
114 
129  bool getRgbResolution(int& width, int& height) override;
130 
138  bool setRgbResolution(int width, int height) override;
139 
147  bool getRgbFOV(double& horizontalFov, double& verticalFov) override;
148 
156  bool setRgbFOV(double horizontalFov, double verticalFov) override;
157 
166  bool getRgbIntrinsicParam(yarp::os::Property& intrinsic) override;
167 
174  bool getRgbMirroring(bool& mirror) override;
175 
182  bool setRgbMirroring(bool mirror) override;
183 };
184 
185 
187  public USBCameraDriver,
190 {
191 private:
192  USBCameraDriverRgb(const USBCameraDriverRgb&) = delete;
193  void operator=(const USBCameraDriverRgb&) = delete;
194 
195 public:
197  ~USBCameraDriverRgb() override;
198 
207 
215 
220  int height() const override;
221 
226  int width() const override;
227 };
228 
235  public USBCameraDriver,
237 {
238 private:
239  USBCameraDriverRaw(const USBCameraDriverRaw&) = delete;
240  void operator=(const USBCameraDriverRaw&) = delete;
241 
242 public:
244  ~USBCameraDriverRaw() override;
245 
254 
259  int height() const override;
260 
265  int width() const override;
266 };
267 
268 #endif // YARP_DEVICE_USBCAMERA_COMMON_USBCAMERA_H
usbCameraRaw: Documentation to be added
Definition: USBcamera.h:237
int height() const override
Return the height of each frame.
Definition: USBcamera.cpp:273
~USBCameraDriverRaw() override
Definition: USBcamera.cpp:258
int width() const override
Return the width of each frame.
Definition: USBcamera.cpp:268
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelMono > &image) override
FrameGrabber image interface, returns the last acquired frame as an rgb image.
Definition: USBcamera.cpp:263
int height() const override
Return the height of each frame.
Definition: USBcamera.cpp:245
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
FrameGrabber image interface, returns the last acquired frame as an rgb image.
Definition: USBcamera.cpp:230
~USBCameraDriverRgb() override
Definition: USBcamera.cpp:225
int width() const override
Return the width of each frame.
Definition: USBcamera.cpp:240
usbCamera: YARP device driver implementation for acquiring images from USB cameras.
Definition: USBcamera.h:34
bool setFeature(int feature, double value) override
Set the requested feature to a value (saturation, brightness ...
Definition: USBcamera.cpp:300
size_t _width
Definition: USBcamera.h:46
bool getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
Definition: USBcamera.cpp:154
yarp::dev::IFrameGrabberImage * frameGrabberImage
Definition: USBcamera.h:40
int getRgbWidth() override
Return the width of each frame.
Definition: USBcamera.cpp:137
bool hasOnePush(int feature, bool *hasOnePush) override
Check if the requested feature has the 'onePush' mode.
Definition: USBcamera.cpp:372
USBCameraDriver()
Constructor.
Definition: USBcamera.cpp:28
bool getFeature(int feature, double *value) override
Get the current value for the requested feature.
Definition: USBcamera.cpp:308
int getRgbHeight() override
Return the height of each frame.
Definition: USBcamera.cpp:129
bool hasOnOff(int feature, bool *HasOnOff) override
Check if the camera has the ability to turn on/off the requested feature.
Definition: USBcamera.cpp:332
bool setRgbMirroring(bool mirror) override
Set the mirroring setting of the sensor.
Definition: USBcamera.cpp:208
~USBCameraDriver() override
Destructor.
Definition: USBcamera.cpp:34
bool close() override
Closes the device driver.
Definition: USBcamera.cpp:88
bool hasAuto(int feature, bool *hasAuto) override
Check if the requested feature has the 'auto' mode.
Definition: USBcamera.cpp:356
bool getActive(int feature, bool *isActive) override
Get the current status of the feature, on or off.
Definition: USBcamera.cpp:348
bool open(yarp::os::Searchable &config) override
Open the device driver.
Definition: USBcamera.cpp:40
bool getRgbMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
Definition: USBcamera.cpp:200
bool setRgbResolution(int width, int height) override
Set the resolution of the rgb image from the camera.
Definition: USBcamera.cpp:162
bool getMode(int feature, FeatureMode *mode) override
Get the current mode for the feature.
Definition: USBcamera.cpp:388
bool getRgbSupportedConfigurations(yarp::sig::VectorOf< yarp::dev::CameraConfig > &configurations) override
Get the possible configurations of the camera.
Definition: USBcamera.cpp:146
bool hasFeature(int feature, bool *hasFeature) override
Check if camera has the requested feature (saturation, brightness ...
Definition: USBcamera.cpp:292
yarp::dev::IFrameGrabberImageRaw * frameGrabberImageRaw
Definition: USBcamera.h:41
bool setMode(int feature, FeatureMode mode) override
Set the requested mode for the feature.
Definition: USBcamera.cpp:380
yarp::dev::IPreciselyTimed * deviceTimed
Definition: USBcamera.h:39
bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override
Get the intrinsic parameters of the rgb camera.
Definition: USBcamera.cpp:192
bool setOnePush(int feature) override
Set the requested feature to a value (saturation, brightness ...
Definition: USBcamera.cpp:396
size_t _height
Definition: USBcamera.h:47
bool getRgbFOV(double &horizontalFov, double &verticalFov) override
Get the field of view (FOV) of the rgb camera.
Definition: USBcamera.cpp:176
bool hasManual(int feature, bool *hasManual) override
Check if the requested feature has the 'manual' mode.
Definition: USBcamera.cpp:364
yarp::dev::DeviceDriver * os_device
Definition: USBcamera.h:42
yarp::os::Stamp getLastInputStamp() override
Implements the IPreciselyTimed interface.
Definition: USBcamera.cpp:120
int width() const
Definition: USBcamera.cpp:96
yarp::dev::IRgbVisualParams * deviceRgbVisualParam
Definition: USBcamera.h:44
bool setActive(int feature, bool onoff) override
Set the requested feature on or off.
Definition: USBcamera.cpp:340
int height() const
Definition: USBcamera.cpp:108
bool getCameraDescription(CameraDescriptor *camera) override
Implementation of IFrameGrabberControls2 interface.
Definition: USBcamera.cpp:284
yarp::dev::IFrameGrabberControls * deviceControls
Definition: USBcamera.h:43
bool setRgbFOV(double horizontalFov, double verticalFov) override
Set the field of view (FOV) of the rgb camera.
Definition: USBcamera.cpp:184
Interface implemented by all device drivers.
Definition: DeviceDriver.h:35
Control interface for frame grabber devices.
An interface for retrieving intrinsic parameter from a rgb camera.
A class for storing options and configuration information.
Definition: Property.h:34
A base class for nested structures that can be searched.
Definition: Searchable.h:66
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:22