YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
zfpPortmonitor.h
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
6#ifndef YARP_ZFP_CARRIER_ZFPPORTMONITOR_H
7#define YARP_ZFP_CARRIER_ZFPPORTMONITOR_H
8
9#include <yarp/os/Bottle.h>
10#include <yarp/os/Things.h>
11#include <yarp/sig/Image.h>
13
20{
21public:
22 bool create(const yarp::os::Property& options) override;
23 void destroy() override;
24
25 bool setparam(const yarp::os::Property& params) override;
26 bool getparam(yarp::os::Property& params) override;
27
28 bool accept(yarp::os::Things& thing) override;
30protected:
31 int compress(float* array, float* &compressed, int &zfpsize, int nx, int ny, float tolerance);
32 int decompress(float* array, float* &decompressed, int zfpsize, int nx, int ny, float tolerance);
33 void resizeF(float* &array, int newSize);
34 void resizeV(void* &array, int newSize);
35private:
39 bool shouldCompress;
40 void *buffer;
41 float *compressed;
42 float *decompressed;
43 int sizeToAllocate;
44 int sizeToAllocateB;
45};
46
47#endif
ZfpMonitorObject: Portmonitor plugin for compression and decompression of floating point values using...
bool setparam(const yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are set via YARP admin port.
int decompress(float *array, float *&decompressed, int zfpsize, int nx, int ny, float tolerance)
int compress(float *array, float *&compressed, int &zfpsize, int nx, int ny, float tolerance)
bool getparam(yarp::os::Property &params) override
This will be called when the portmonitor carrier parameters are requested via YARP admin port.
void resizeV(void *&array, int newSize)
void resizeF(float *&array, int newSize)
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.
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 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:64
A class for storing options and configuration information.
Definition Property.h:33
Base class for generic things.
Definition Things.h:18
Typed image class.
Definition Image.h:605