YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IFrameGrabberImage.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
8
10
11YARP_LOG_COMPONENT(IFRAMEGRABBEROF, "yarp.dev.IFrameGrabberOf")
12
13yarp::dev::IFrameGrabberImageBase::~IFrameGrabberImageBase() = default;
14
15template class yarp::dev::IFrameGrabberOf<yarp::sig::ImageOf<yarp::sig::PixelRgb>>;
16template class yarp::dev::IFrameGrabberOf<yarp::sig::ImageOf<yarp::sig::PixelMono>>;
17template class yarp::dev::IFrameGrabberOf<yarp::sig::ImageOf<yarp::sig::PixelFloat>>;
18template class yarp::dev::IFrameGrabberOf<yarp::sig::FlexImage>;
19
20yarp::dev::vertex_t::~vertex_t() = default;
21
22yarp::dev::vertex_t::vertex_t(int x_, int y_)
23{
24 x = x_;
25 y = y_;
26}
27
29{
30 // auto-convert text mode interaction
31 connection.convertTextMode();
32
33 bool ok = true;
34 connection.expectInt32();
35 connection.expectInt32();
36
37 connection.expectInt32();
38 x = connection.expectInt32(); // 1
39 connection.expectInt32();
40 y = connection.expectInt32(); // 2
41
42 return !connection.isError();
43}
44
46{
47 connection.appendInt32(BOTTLE_TAG_LIST);
48 connection.appendInt32(2);
49 connection.appendInt32(BOTTLE_TAG_INT32); // 1
50 connection.appendInt32(x);
51 connection.appendInt32(BOTTLE_TAG_INT32); // 2
52 connection.appendInt32(y);
53 connection.convertTextMode();
54 return !connection.isError();
55}
#define BOTTLE_TAG_INT32
Definition Bottle.h:21
#define BOTTLE_TAG_LIST
Definition Bottle.h:29
const yarp::os::LogComponent & IFRAMEGRABBEROF()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
An interface for reading from a network connection.
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual bool isError() const =0
An interface for writing to a network connection.
virtual bool isError() const =0
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
#define YARP_LOG_COMPONENT(name,...)
The main, catch-all namespace for YARP.
Definition dirs.h:16