YARP
Yet Another Robot Platform
ImageNetworkHeader.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_SIG_IMAGENETWORKHEADER_H
11 #define YARP_SIG_IMAGENETWORKHEADER_H
12 
13 #include <yarp/conf/system.h>
14 
15 #include <yarp/os/NetInt32.h>
16 #include <yarp/os/Bottle.h>
17 
18 #include <yarp/sig/Image.h>
19 
20 namespace yarp {
21  namespace sig {
22  class ImageNetworkHeader;
23  }
24 }
25 
33 {
34 public:
35 
51 
53  paramName(0), paramIdTag(0), id(0),
54  paramListTag(0), paramListLen(0), depth(0),
55  imgSize(0), quantum(0), width(0),
56  height(0), paramBlobTag(0), paramBlobLen(0) {}
57 
58  void setFromImage(const Image& image) {
60  listLen = 4;
62  paramName = yarp::os::createVocab('m','a','t');
64  id = image.getPixelCode();
66  paramListLen = 5;
67  depth = image.getPixelSize();
68  imgSize = image.getRawImageSize();
69  quantum = image.getQuantum();
70  width = image.width();
71  height = image.height();
73  paramBlobLen = image.getRawImageSize();
74  }
75 
76 };
78 
79 #endif // YARP_SIG_IMAGENETWORKHEADER_H
yarp::sig::ImageNetworkHeader::paramName
yarp::os::NetInt32 paramName
Definition: ImageNetworkHeader.h:39
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
yarp::sig::ImageNetworkHeader
Byte order in image header for network transmission.
Definition: ImageNetworkHeader.h:33
YARP_END_PACK
#define YARP_END_PACK
Ends 1 byte packing for structs/classes.
Definition: system.h:194
BOTTLE_TAG_LIST
#define BOTTLE_TAG_LIST
Definition: Bottle.h:30
yarp::sig::ImageNetworkHeader::paramNameTag
yarp::os::NetInt32 paramNameTag
Definition: ImageNetworkHeader.h:38
yarp::sig::ImageNetworkHeader::depth
yarp::os::NetInt32 depth
Definition: ImageNetworkHeader.h:44
NetInt32.h
YARP_BEGIN_PACK
#define YARP_BEGIN_PACK
Starts 1 byte packing for structs/classes.
Definition: system.h:193
yarp::sig::ImageNetworkHeader::width
yarp::os::NetInt32 width
Definition: ImageNetworkHeader.h:47
yarp::sig::Image::getQuantum
size_t getQuantum() const
The size of a row is constrained to be a multiple of the "quantum".
Definition: Image.h:186
yarp::sig::ImageNetworkHeader::paramBlobLen
yarp::os::NetInt32 paramBlobLen
Definition: ImageNetworkHeader.h:50
yarp::sig::ImageNetworkHeader::paramListLen
yarp::os::NetInt32 paramListLen
Definition: ImageNetworkHeader.h:43
yarp::sig::ImageNetworkHeader::setFromImage
void setFromImage(const Image &image)
Definition: ImageNetworkHeader.h:58
yarp::sig::ImageNetworkHeader::id
yarp::os::NetInt32 id
Definition: ImageNetworkHeader.h:41
yarp::sig::Image::getPixelSize
virtual size_t getPixelSize() const
Gets pixel size in memory in bytes.
Definition: Image.cpp:449
yarp::sig::Image::getRawImageSize
size_t getRawImageSize() const
Access to the internal buffer size information (this is how much memory has been allocated for the im...
Definition: Image.cpp:543
yarp::sig::ImageNetworkHeader::paramBlobTag
yarp::os::NetInt32 paramBlobTag
Definition: ImageNetworkHeader.h:49
BOTTLE_TAG_INT32
#define BOTTLE_TAG_INT32
Definition: Bottle.h:23
yarp::sig::Image::width
size_t width() const
Gets width of image in pixels.
Definition: Image.h:153
BOTTLE_TAG_VOCAB
#define BOTTLE_TAG_VOCAB
Definition: Bottle.h:25
yarp::sig::ImageNetworkHeader::listTag
yarp::os::NetInt32 listTag
Definition: ImageNetworkHeader.h:36
yarp::sig::ImageNetworkHeader::height
yarp::os::NetInt32 height
Definition: ImageNetworkHeader.h:48
yarp::sig::Image::height
size_t height() const
Gets height of image in pixels.
Definition: Image.h:159
yarp::sig::ImageNetworkHeader::ImageNetworkHeader
ImageNetworkHeader()
Definition: ImageNetworkHeader.h:52
system.h
Image.h
BOTTLE_TAG_BLOB
#define BOTTLE_TAG_BLOB
Definition: Bottle.h:29
yarp::sig::ImageNetworkHeader::quantum
yarp::os::NetInt32 quantum
Definition: ImageNetworkHeader.h:46
yarp::sig::ImageNetworkHeader::paramIdTag
yarp::os::NetInt32 paramIdTag
Definition: ImageNetworkHeader.h:40
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::sig::ImageNetworkHeader::listLen
yarp::os::NetInt32 listLen
Definition: ImageNetworkHeader.h:37
yarp::sig::Image
Base class for storing images.
Definition: Image.h:85
yarp::sig::ImageNetworkHeader::paramListTag
yarp::os::NetInt32 paramListTag
Definition: ImageNetworkHeader.h:42
Bottle.h
yarp::sig::ImageNetworkHeader::imgSize
yarp::os::NetInt32 imgSize
Definition: ImageNetworkHeader.h:45
yarp::os::NetInt32
std::int32_t NetInt32
Definition of the NetInt32 type.
Definition: NetInt32.h:33
yarp::sig::Image::getPixelCode
virtual int getPixelCode() const
Gets pixel type identifier.
Definition: Image.cpp:454