YARP
Yet Another Robot Platform
SegmentationImage.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_CARRIER_SEGMENTATION_CONVERTER_H
10 #define YARP_CARRIER_SEGMENTATION_CONVERTER_H
11 
12 #include <yarp/os/Bottle.h>
13 #include <yarp/os/Things.h>
14 #include <yarp/os/MonitorObject.h>
15 #include <yarp/sig/Image.h>
16 
17 //example usage:
18 //yarp connect /segmentationimage:o /yarpview/img:i tcp+recv.portmonitor+type.dll+file.segmentationimage
19 
20 struct rgbColor
21 {
22  char r;
23  char g;
24  char b;
25 };
26 
28 {
29 public:
30  bool create(const yarp::os::Property& options) override;
31  void destroy() override;
32 
33  bool setparam(const yarp::os::Property& params) override;
34  bool getparam(yarp::os::Property& params) override;
35 
36  bool accept(yarp::os::Things& thing) override;
37  yarp::os::Things& update(yarp::os::Things& thing) override;
38 
39 private:
40  int max_colors;
43  yarp::sig::FlexImage outImg;
44  std::map<int, rgbColor> colormap;
45 };
46 
47 #endif // YARP_CARRIER_SEGMENTATION_CONVERTER_H
bool accept(yarp::os::Things &thing) override
This will be called when the data reach the portmonitor object.
void destroy() override
This will be called when the portmonitor object destroyes.
bool setparam(const yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are set via Yarp admin port.
yarp::os::Things & update(yarp::os::Things &thing) override
After data get accpeted in the accept() callback, an instance of that is given to the update function...
bool getparam(yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are requested via Yarp admin port.
bool create(const yarp::os::Property &options) override
This will be called when the dll is properly loaded by the portmonitor carrier.
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:76
A class for storing options and configuration information.
Definition: Property.h:37
Base class for generic things.
Definition: Things.h:22
Image class with user control of representation details.
Definition: Image.h:403