YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IRgbVisualParams.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
9
11{
12 width = w;
13 height = h;
14 framerate = rate;
15 pixelCoding = enc;
16}
17
19{
20 connection.appendInt32(BOTTLE_TAG_LIST);
21 connection.appendInt32(4);
22 connection.appendInt32(BOTTLE_TAG_INT32); // 1
23 connection.appendInt32(width);
24 connection.appendInt32(BOTTLE_TAG_INT32); // 2
25 connection.appendInt32(height);
26 connection.appendInt32(BOTTLE_TAG_FLOAT64); // 3
27 connection.appendFloat64(framerate);
28 connection.appendInt32(BOTTLE_TAG_INT32); // 4
29 connection.appendInt32(pixelCoding);
30
31 connection.convertTextMode();
32 return !connection.isError();
33}
34
36{
37 // auto-convert text mode interaction
38 connection.convertTextMode();
39
40 bool ok = true;
41 connection.expectInt32();
42 connection.expectInt32();
43
44 connection.expectInt32();
45 width = connection.expectInt32(); //1
46 connection.expectInt32();
47 height = connection.expectInt32(); //2
48 connection.expectInt32();
49 framerate = connection.expectFloat64(); //3
50 connection.expectInt32();
51 pixelCoding = (YarpVocabPixelTypesEnum)(connection.expectInt32()); //4
52
53 return !connection.isError();
54}
#define BOTTLE_TAG_FLOAT64
Definition Bottle.h:26
#define BOTTLE_TAG_INT32
Definition Bottle.h:21
#define BOTTLE_TAG_LIST
Definition Bottle.h:29
YarpVocabPixelTypesEnum
Definition Image.h:40
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
YarpVocabPixelTypesEnum pixelCoding
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
virtual yarp::conf::float64_t expectFloat64()=0
Read a 64-bit floating point number from the network connection.
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.
virtual void appendFloat64(yarp::conf::float64_t data)=0
Send a representation of a 64-bit floating point number to the network connection.
constexpr char framerate[]