YARP
Yet Another Robot Platform
zfpPortmonitor.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_ZFP_CARRIER_ZFPPORTMONITOR_H
10 #define YARP_ZFP_CARRIER_ZFPPORTMONITOR_H
11 
12 #include <yarp/os/Bottle.h>
13 #include <yarp/os/Things.h>
14 #include <yarp/sig/Image.h>
15 #include <yarp/os/MonitorObject.h>
16 
17 
19 {
20 public:
21  bool create(const yarp::os::Property& options) override;
22  void destroy() override;
23 
24  bool setparam(const yarp::os::Property& params) override;
25  bool getparam(yarp::os::Property& params) override;
26 
27  bool accept(yarp::os::Things& thing) override;
28  yarp::os::Things& update(yarp::os::Things& thing) override;
29 protected:
30  int compress(float* array, float* &compressed, int &zfpsize, int nx, int ny, float tolerance);
31  int decompress(float* array, float* &decompressed, int zfpsize, int nx, int ny, float tolerance);
32  void resizeF(float* &array, int newSize);
33  void resizeV(void* &array, int newSize);
34 private:
36  yarp::os::Bottle data;
38  bool shouldCompress;
39  void *buffer;
40  float *compressed;
41  float *decompressed;
42  int sizeToAllocate;
43  int sizeToAllocateB;
44 };
45 
46 #endif
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
Things.h
ZfpMonitorObject::accept
bool accept(yarp::os::Things &thing) override
This will be called when the data reach the portmonitor object.
Definition: zfpPortmonitor.cpp:74
yarp::os::MonitorObject
Definition: MonitorObject.h:26
ZfpMonitorObject::resizeV
void resizeV(void *&array, int newSize)
Definition: zfpPortmonitor.cpp:149
ZfpMonitorObject
Definition: zfpPortmonitor.h:19
ZfpMonitorObject::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: zfpPortmonitor.cpp:96
yarp::os::Things
Base class for generic things.
Definition: Things.h:22
ZfpMonitorObject::create
bool create(const yarp::os::Property &options) override
This will be called when the dll is properly loaded by the portmonitor carrier.
Definition: zfpPortmonitor.cpp:35
yarp::sig::ImageOf< yarp::sig::PixelFloat >
ZfpMonitorObject::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: zfpPortmonitor.cpp:64
ZfpMonitorObject::compress
int compress(float *array, float *&compressed, int &zfpsize, int nx, int ny, float tolerance)
Definition: zfpPortmonitor.cpp:159
ZfpMonitorObject::resizeF
void resizeF(float *&array, int newSize)
Definition: zfpPortmonitor.cpp:140
buffer
Definition: V4L_camera.h:75
ZfpMonitorObject::destroy
void destroy() override
This will be called when the portmonitor object destroyes.
Definition: zfpPortmonitor.cpp:46
ZfpMonitorObject::decompress
int decompress(float *array, float *&decompressed, int zfpsize, int nx, int ny, float tolerance)
Definition: zfpPortmonitor.cpp:207
ZfpMonitorObject::getparam
bool getparam(yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are requested via Yarp admin port.
Definition: zfpPortmonitor.cpp:69
Image.h
MonitorObject.h
Bottle.h
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37