YARP
Yet Another Robot Platform
FrameGrabberControlImpl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_FRAMEGRABBERCONTROLIMPL_H
10 #define YARP_DEV_FRAMEGRABBERCONTROLIMPL_H
11 
12 #include <string>
13 #include <yarp/os/Port.h>
14 #include <yarp/dev/DeviceDriver.h>
15 #include <yarp/dev/FrameGrabberInterfaces.h> // to include VOCAB definitions
16 
20 namespace yarp{
21  namespace dev {
22  class FrameGrabberControls_Parser;
23  class FrameGrabberControls_Sender;
24  }
25 }
26 
27 
33 {
34 private:
35  yarp::os::Port &_port;
36 
37 public:
40  bool getCameraDescription(CameraDescriptor *camera) override;
41  bool hasFeature(int feature, bool *hasFeature) override;
42  bool setFeature(int feature, double value) override;
43  bool getFeature(int feature, double *value) override;
44  bool setFeature(int feature, double value1, double value2) override;
45  bool getFeature(int feature, double *value1, double *value2) override;
46  bool hasOnOff(int feature, bool *HasOnOff) override;
47  bool setActive(int feature, bool onoff) override;
48  bool getActive(int feature, bool *isActive) override;
49  bool hasAuto(int feature, bool *hasAuto) override;
50  bool hasManual(int feature, bool *hasManual) override;
51  bool hasOnePush(int feature, bool *hasOnePush) override;
52  bool setMode(int feature, FeatureMode mode) override;
53  bool getMode(int feature, FeatureMode *mode) override;
54  bool setOnePush(int feature) override;
55 };
56 
57 
59 {
60 private:
61  IFrameGrabberControls *fgCtrl;
62 
63 public:
66 
67  bool configure(IFrameGrabberControls *interface);
68  bool respond(const yarp::os::Bottle& cmd, yarp::os::Bottle& response) override;
69 };
70 
71 
72 #endif // YARP_DEV_FRAMEGRABBERCONTROLIMPL_H
CameraDescriptor
Definition: FrameGrabberInterfaces.h:35
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
yarp::dev::FrameGrabberControls_Sender
This classes implement a sender / parser for IFrameGrabberControls interface messages.
Definition: FrameGrabberControlImpl.h:33
yarp::dev::FrameGrabberControls_Sender::hasManual
bool hasManual(int feature, bool *hasManual) override
Check if the requested feature has the 'manual' mode.
Definition: FrameGrabberControlImpl.cpp:152
Port.h
yarp::dev::FrameGrabberControls_Sender::setActive
bool setActive(int feature, bool onoff) override
Set the requested feature on or off.
Definition: FrameGrabberControlImpl.cpp:115
yarp::dev::FrameGrabberControls_Parser::FrameGrabberControls_Parser
FrameGrabberControls_Parser()
Definition: FrameGrabberControlImpl.cpp:216
yarp::dev::FrameGrabberControls_Sender::setOnePush
bool setOnePush(int feature) override
Set the requested feature to a value (saturation, brightness ...
Definition: FrameGrabberControlImpl.cpp:202
yarp::dev::FrameGrabberControls_Sender::hasOnePush
bool hasOnePush(int feature, bool *hasOnePush) override
Check if the requested feature has the 'onePush' mode.
Definition: FrameGrabberControlImpl.cpp:165
yarp::dev::FrameGrabberControls_Sender::~FrameGrabberControls_Sender
virtual ~FrameGrabberControls_Sender()
Definition: FrameGrabberControlImpl.h:39
yarp::dev::FrameGrabberControls_Sender::setFeature
bool setFeature(int feature, double value) override
Set the requested feature to a value (saturation, brightness ...
Definition: FrameGrabberControlImpl.cpp:52
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
yarp::dev::FrameGrabberControls_Sender::hasFeature
bool hasFeature(int feature, bool *hasFeature) override
Check if camera has the requested feature (saturation, brightness ...
Definition: FrameGrabberControlImpl.cpp:39
yarp::dev::FrameGrabberControls_Parser::~FrameGrabberControls_Parser
virtual ~FrameGrabberControls_Parser()
Definition: FrameGrabberControlImpl.h:65
yarp::dev::FrameGrabberControls_Parser::respond
bool respond(const yarp::os::Bottle &cmd, yarp::os::Bottle &response) override
Respond to a message.
Definition: FrameGrabberControlImpl.cpp:235
yarp::dev::FrameGrabberControls_Sender::getMode
bool getMode(int feature, FeatureMode *mode) override
Get the current mode for the feature.
Definition: FrameGrabberControlImpl.cpp:189
yarp::dev::FrameGrabberControls_Sender::hasAuto
bool hasAuto(int feature, bool *hasAuto) override
Check if the requested feature has the 'auto' mode.
Definition: FrameGrabberControlImpl.cpp:139
yarp::dev::FrameGrabberControls_Sender::getFeature
bool getFeature(int feature, double *value) override
Get the current value for the requested feature.
Definition: FrameGrabberControlImpl.cpp:75
yarp::dev::IFrameGrabberControls
Control interface for frame grabber devices.
Definition: FrameGrabberInterfaces.h:365
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
FrameGrabberInterfaces.h
define common interfaces to discover remote camera capabilities
yarp::dev::FrameGrabberControls_Sender::getCameraDescription
bool getCameraDescription(CameraDescriptor *camera) override
Get a basic description of the camera hw.
Definition: FrameGrabberControlImpl.cpp:24
yarp::dev::DeviceResponder
A cheap and cheerful framework for human readable/writable forms of messages to devices.
Definition: DeviceDriver.h:134
FeatureMode
FeatureMode
Definition: FrameGrabberInterfaces.h:29
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::FrameGrabberControls_Parser::configure
bool configure(IFrameGrabberControls *interface)
Definition: FrameGrabberControlImpl.cpp:218
yarp::dev::FrameGrabberControls_Parser
Definition: FrameGrabberControlImpl.h:59
yarp::dev::FrameGrabberControls_Sender::getActive
bool getActive(int feature, bool *isActive) override
Get the current status of the feature, on or off.
Definition: FrameGrabberControlImpl.cpp:126
yarp::dev::FrameGrabberControls_Sender::FrameGrabberControls_Sender
FrameGrabberControls_Sender(yarp::os::Port &port)
Definition: FrameGrabberControlImpl.cpp:21
yarp::dev::FrameGrabberControls_Sender::setMode
bool setMode(int feature, FeatureMode mode) override
Set the requested mode for the feature.
Definition: FrameGrabberControlImpl.cpp:178
yarp::dev::FrameGrabberControls_Sender::hasOnOff
bool hasOnOff(int feature, bool *HasOnOff) override
Check if the camera has the ability to turn on/off the requested feature.
Definition: FrameGrabberControlImpl.cpp:102
DeviceDriver.h