YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FrameGrabberCropper.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7
8#include <yarp/os/Log.h>
9#include <yarp/os/LogStream.h>
10
11namespace {
12YARP_LOG_COMPONENT(FRAMEGRABBERCROPPER, "yarp.device.frameGrabberCropper")
13}
14
19
20
30
31
33{
34 return true;
35}
36
38{
39 if (!poly->isValid()) {
40 yCError(FRAMEGRABBERCROPPER) << "The device is not valid";
41 return false;
42 }
43
46 poly->view(iFrameGrabberControls);
47 poly->view(iFrameGrabberControlsDC1394);
48 poly->view(iRgbVisualParams);
49 poly->view(iPreciselyTimed);
50
52 yCError(FRAMEGRABBERCROPPER) << "The device does not implement the required interfaces";
53 return false;
54 }
55
56 return true;
57}
58
60{
63 iFrameGrabberControls = nullptr;
64 iFrameGrabberControlsDC1394 = nullptr;
65 iRgbVisualParams = nullptr;
66 iPreciselyTimed = nullptr;
67 return true;
68}
69
71{
72 if (device2attach.size() != 1) {
73 yCError(FRAMEGRABBERCROPPER, "Expected only one device to be attached");
74 return false;
75 }
76
77 return attach(device2attach[0]->poly);
78}
79
81{
82 return detach();
83}
yarp::dev::IFrameGrabberOf< yarp::sig::ImageOf< yarp::sig::PixelRgb > > * iFrameGrabberOf
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
bool close() override
Close the DeviceDriver.
bool attachAll(const yarp::dev::PolyDriverList &device2attach) override
Attach to a list of objects.
bool detach() override
Detach the object (you must have first called attach).
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool detachAll() override
Detach the object (you must have first called attach).
bool attach(yarp::dev::PolyDriver *poly) override
Attach to another object.
bool view(T *&x)
Get an interface to the device driver.
A container for a device driver.
Definition PolyDriver.h:23
bool isValid() const
Check if device is valid.
A base class for nested structures that can be searched.
Definition Searchable.h:31
Typed image class.
Definition Image.h:605
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)