YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
20
34{
35 USBCameraDriver(const USBCameraDriver&) = delete;
36 void operator=(const USBCameraDriver&) = delete;
37
38protected:
45
46 size_t _width;
47 size_t _height;
49
50public:
55
59 ~USBCameraDriver() override;
60
61 bool open(yarp::os::Searchable& config) override;
62 bool close() override;
63
64 int height() const;
65 int width() const;
66
68
74 bool getCameraDescription(CameraDescriptor* camera) override;
75 bool hasFeature(int feature, bool* hasFeature) override;
76 bool setFeature(int feature, double value) override;
77 bool getFeature(int feature, double* value) override;
78 bool setFeature(int feature, double value1, double value2) override;
79 bool getFeature(int feature, double* value1, double* value2) override;
80 bool hasOnOff(int feature, bool* HasOnOff) override;
81 bool setActive(int feature, bool onoff) override;
82 bool getActive(int feature, bool* isActive) override;
83 bool hasAuto(int feature, bool* hasAuto) override;
84 bool hasManual(int feature, bool* hasManual) override;
85 bool hasOnePush(int feature, bool* hasOnePush) override;
86 bool setMode(int feature, FeatureMode mode) override;
87 bool getMode(int feature, FeatureMode* mode) override;
88 bool setOnePush(int feature) override;
89
90 int getRgbHeight() override;
91 int getRgbWidth() override;
93 bool getRgbResolution(int& width, int& height) override;
94 bool setRgbResolution(int width, int height) override;
95 bool getRgbFOV(double& horizontalFov, double& verticalFov) override;
96 bool setRgbFOV(double horizontalFov, double verticalFov) override;
97 bool getRgbIntrinsicParam(yarp::os::Property& intrinsic) override;
98 bool getRgbMirroring(bool& mirror) override;
99 bool setRgbMirroring(bool mirror) override;
100};
101
102
104 public USBCameraDriver,
107{
108private:
109 USBCameraDriverRgb(const USBCameraDriverRgb&) = delete;
110 void operator=(const USBCameraDriverRgb&) = delete;
111
112public:
114 ~USBCameraDriverRgb() override;
115
118 int height() const override;
119 int width() const override;
120};
121
128 public USBCameraDriver,
130{
131private:
132 USBCameraDriverRaw(const USBCameraDriverRaw&) = delete;
133 void operator=(const USBCameraDriverRaw&) = delete;
134
135public:
137 ~USBCameraDriverRaw() override;
138
140 int height() const override;
141 int width() const override;
142};
143
144#endif // YARP_DEVICE_USBCAMERA_COMMON_USBCAMERA_H
usbCameraRaw: Documentation to be added
Definition USBcamera.h:130
int height() const override
Return the height of each frame.
~USBCameraDriverRaw() override
int width() const override
Return the width of each frame.
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelMono > &image) override
Get an image from the frame grabber.
int height() const override
Return the height of each frame.
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
Get an image from the frame grabber.
~USBCameraDriverRgb() override
int width() const override
Return the width of each frame.
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 ... )
bool getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
yarp::dev::IFrameGrabberImage * frameGrabberImage
Definition USBcamera.h:40
int getRgbWidth() override
Return the width of each frame.
bool hasOnePush(int feature, bool *hasOnePush) override
Check if the requested feature has the 'onePush' mode.
USBCameraDriver()
Constructor.
Definition USBcamera.cpp:28
bool getFeature(int feature, double *value) override
Get the current value for the requested feature.
int getRgbHeight() override
Return the height of each frame.
bool hasOnOff(int feature, bool *HasOnOff) override
Check if the camera has the ability to turn on/off the requested feature.
bool setRgbMirroring(bool mirror) override
Set the mirroring setting of the sensor.
~USBCameraDriver() override
Destructor.
Definition USBcamera.cpp:34
bool close() override
Close the DeviceDriver.
Definition USBcamera.cpp:88
bool hasAuto(int feature, bool *hasAuto) override
Check if the requested feature has the 'auto' mode.
bool getActive(int feature, bool *isActive) override
Get the current status of the feature, on or off.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition USBcamera.cpp:40
bool getRgbMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
bool setRgbResolution(int width, int height) override
Set the resolution of the rgb image from the camera.
bool getMode(int feature, FeatureMode *mode) override
Get the current mode for the feature.
bool getRgbSupportedConfigurations(yarp::sig::VectorOf< yarp::dev::CameraConfig > &configurations) override
Get the possible configurations of the camera.
bool hasFeature(int feature, bool *hasFeature) override
Check if camera has the requested feature (saturation, brightness ... )
yarp::dev::IFrameGrabberImageRaw * frameGrabberImageRaw
Definition USBcamera.h:41
bool setMode(int feature, FeatureMode mode) override
Set the requested mode for the feature.
yarp::dev::IPreciselyTimed * deviceTimed
Definition USBcamera.h:39
bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override
Get the intrinsic parameters of the rgb camera.
bool setOnePush(int feature) override
Set the requested feature to a value (saturation, brightness ... )
bool getRgbFOV(double &horizontalFov, double &verticalFov) override
Get the field of view (FOV) of the rgb camera.
bool hasManual(int feature, bool *hasManual) override
Check if the requested feature has the 'manual' mode.
yarp::dev::DeviceDriver * os_device
Definition USBcamera.h:42
yarp::os::Stamp getLastInputStamp() override
Return the time stamp relative to the last acquisition.
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.
int height() const
bool getCameraDescription(CameraDescriptor *camera) override
Implementation of IFrameGrabberControls2 interface.
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.
Interface implemented by all device drivers.
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:33
A base class for nested structures that can be searched.
Definition Searchable.h:31
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
Typed image class.
Definition Image.h:605