YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
IFrameGrabberControlsTest.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2025-2025 Istituto Italiano di Tecnologia (IIT)
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
6
#ifndef IFRAMEGRABBERCONTROLSTEST_H
7
#define IFRAMEGRABBERCONTROLSTEST_H
8
9
#include <array>
10
#include <
yarp/dev/IFrameGrabberControls.h
>
11
#include <catch2/catch_amalgamated.hpp>
12
13
using namespace
yarp::dev
;
14
using namespace
yarp::os
;
15
16
namespace
yarp::dev::tests
17
{
18
inline
void
exec_IFrameGrabberControls_test_1
(
IFrameGrabberControls
*
ictl
)
19
{
20
REQUIRE
(
ictl
);
21
22
// Check busType2String()
23
{
24
yarp::dev::BusType
typeb
=
yarp::dev::BusType::BUS_USB
;
25
std::string s =
ictl
->busType2String(
typeb
);
26
}
27
// Check getActive()
28
{
29
bool
active =
false
;
30
CHECK
(
ictl
->getActive(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
, active));
31
}
32
33
// Check getCameraDescription()
34
{
35
yarp::dev::CameraDescriptor
camera
;
36
CHECK
(
ictl
->getCameraDescription(
camera
));
37
}
38
39
// Check getFeature()
40
{
41
double
val = 0;
42
CHECK
(
ictl
->getFeature(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
, val));
43
}
44
45
// Check getMode()
46
{
47
yarp::dev::FeatureMode
mode
;
48
CHECK
(
ictl
->getMode(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
,
mode
));
49
}
50
51
// Check hasAuto()
52
{
53
bool
bauto
;
54
CHECK
(
ictl
->hasAuto(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
,
bauto
));
55
}
56
57
// Check hasFeature()
58
{
59
bool
bfeat
;
60
CHECK
(
ictl
->hasFeature(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
,
bfeat
));
61
}
62
63
// Check hasManual()
64
{
65
bool
bman
;
66
CHECK
(
ictl
->hasManual(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
,
bman
));
67
}
68
69
// Check hasOnePush()
70
{
71
bool
bpush
;
72
CHECK
(
ictl
->hasOnePush(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
,
bpush
));
73
}
74
75
// Check hasOnOff()
76
{
77
bool
bon
;
78
CHECK
(
ictl
->hasOnOff(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
,
bon
));
79
}
80
81
// Check setFeature()
82
{
83
CHECK
(
ictl
->setFeature(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
, 0));
84
CHECK
(
ictl
->setFeature(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
, 0, 0));
85
}
86
87
// Check setMode()
88
{
89
yarp::dev::FeatureMode
mode
=
yarp::dev::FeatureMode::MODE_AUTO
;
90
CHECK
(
ictl
->setMode(
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
,
mode
));
91
}
92
93
// Check setOnePush()
94
{
95
auto
feat
=
cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
;
96
CHECK
(
ictl
->setOnePush(
feat
));
97
}
98
99
// Check toFeatureMode()
100
{
101
bool
autob
=
true
;
102
CHECK
(
ictl
->toFeatureMode(
autob
) !=
FeatureMode::MODE_UNKNOWN
);
103
}
104
}
105
}
106
107
#endif
camera
CameraDescriptor camera
Definition
FakeFrameGrabber_Controls.cpp:34
mode
FeatureMode mode
Definition
FakeFrameGrabber_Controls.cpp:33
IFrameGrabberControls.h
yarp::dev::IFrameGrabberControls
Control interface for frame grabber devices.
Definition
IFrameGrabberControls.h:72
yarp::os::BufferedPort
A mini-server for performing network communication in the background.
Definition
BufferedPort.h:60
yarp::dev::tests
Definition
IAxisInfoTest.h:16
yarp::dev::tests::exec_IFrameGrabberControls_test_1
void exec_IFrameGrabberControls_test_1(IFrameGrabberControls *ictl)
Definition
IFrameGrabberControlsTest.h:18
yarp::dev
For streams capable of holding different kinds of content, check what they actually have.
Definition
BatteryData.cpp:13
yarp::dev::BusType
BusType
Definition
IFrameGrabberControls.h:18
yarp::dev::BusType::BUS_USB
@ BUS_USB
yarp::dev::FeatureMode
FeatureMode
Definition
IFrameGrabberControls.h:25
yarp::dev::FeatureMode::MODE_UNKNOWN
@ MODE_UNKNOWN
yarp::dev::FeatureMode::MODE_AUTO
@ MODE_AUTO
yarp::dev::cameraFeature_id_t::YARP_FEATURE_BRIGHTNESS
@ YARP_FEATURE_BRIGHTNESS
yarp::os
An interface to the operating system, including Port based communication.
Definition
AbstractCarrier.h:13
yarp::dev::CameraDescriptor
Definition
IFrameGrabberControls.h:32
YARP
4.0.0+20250814.3+git8c5a8e3c5
src
libYARP_dev
src
yarp
dev
tests
IFrameGrabberControlsTest.h
Generated on Sun Aug 24 2025 02:50:16 for YARP by
1.9.8