YARP
Yet Another Robot Platform
SegmentationImage.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 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
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
SegmentationImageConverter::destroy
void destroy() override
This will be called when the portmonitor object destroyes.
Definition: SegmentationImage.cpp:113
SegmentationImageConverter::setparam
bool setparam(const yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are set via Yarp admin port.
Definition: SegmentationImage.cpp:117
Things.h
yarp::os::MonitorObject
Definition: MonitorObject.h:26
rgbColor
Definition: SegmentationImage.h:21
yarp::os::Things
Base class for generic things.
Definition: Things.h:22
rgbColor::g
char g
Definition: SegmentationImage.h:23
SegmentationImageConverter::create
bool create(const yarp::os::Property &options) override
This will be called when the dll is properly loaded by the portmonitor carrier.
Definition: SegmentationImage.cpp:39
SegmentationImageConverter
Definition: SegmentationImage.h:28
yarp::sig::FlexImage
Image class with user control of representation details.
Definition: Image.h:403
SegmentationImageConverter::update
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...
Definition: SegmentationImage.cpp:149
SegmentationImageConverter::getparam
bool getparam(yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are requested via Yarp admin port.
Definition: SegmentationImage.cpp:122
Image.h
MonitorObject.h
rgbColor::b
char b
Definition: SegmentationImage.h:24
Bottle.h
rgbColor::r
char r
Definition: SegmentationImage.h:22
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37
SegmentationImageConverter::accept
bool accept(yarp::os::Things &thing) override
This will be called when the data reach the portmonitor object.
Definition: SegmentationImage.cpp:127