-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split Comm library into two (the one with core functionality; the oth…
…er with opencv integration)
- Loading branch information
Andrei Costinescu
committed
Jan 17, 2022
1 parent
a007be8
commit 67b86b7
Showing
24 changed files
with
486 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Created by Andrei Costinescu ([email protected]) on 01-Apr-21. | ||
// | ||
|
||
#ifndef COMM_DATA_DATACOLLECTIONWITHOPENCV_H | ||
#define COMM_DATA_DATACOLLECTIONWITHOPENCV_H | ||
|
||
#include <comm/data/DataCollection.h> | ||
|
||
namespace comm { | ||
class DataCollectionWithOpenCV : public DataCollection { | ||
public: | ||
DataCollectionWithOpenCV(); | ||
|
||
DataCollectionWithOpenCV(std::function<CommunicationData*(MessageType)> dataCreationFunction); | ||
|
||
~DataCollectionWithOpenCV() override; | ||
}; | ||
} | ||
|
||
|
||
#endif //COMM_DATA_DATACOLLECTIONWITHOPENCV_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// Created by Andrei Costinescu ([email protected]) on 10.03.2021. | ||
// | ||
|
||
#ifndef COMM_DATA_IMAGEDATAWITHOPENCV_H | ||
#define COMM_DATA_IMAGEDATAWITHOPENCV_H | ||
|
||
#include <comm/data/ImageData.h> | ||
#include <opencv2/opencv.hpp> | ||
|
||
namespace comm { | ||
class ImageDataWithOpenCV : public virtual ImageData { | ||
public: | ||
ImageDataWithOpenCV(); | ||
|
||
ImageDataWithOpenCV(cv::Mat image, int id); | ||
|
||
ImageDataWithOpenCV(unsigned char *imageBytes, int imageByteSize, int imageHeight, int imageWidth, int imageType, int id); | ||
|
||
~ImageDataWithOpenCV() override; | ||
|
||
char *getDeserializeBuffer() override; | ||
|
||
bool deserialize(Buffer *buffer, int start, bool forceCopy, bool verbose) override; | ||
|
||
void setImage(cv::Mat image); | ||
|
||
[[nodiscard]] cv::Mat getImage() const; | ||
|
||
void setImage(unsigned char *_imageBytes, int _imageByteSize, int _imageHeight, int _imageWidth, int _imageType) override; | ||
|
||
protected: | ||
cv::Mat image{}; | ||
}; | ||
} | ||
|
||
#endif //COMM_DATA_IMAGEDATAWITHOPENCV_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// Created by Andrei Costinescu ([email protected]) on 29-May-21. | ||
// | ||
|
||
#ifndef COMM_DATA_IMAGEENCODEDATAWITHOPENCV_H | ||
#define COMM_DATA_IMAGEENCODEDATAWITHOPENCV_H | ||
|
||
#include <comm/data/ImageDataWithOpenCV.h> | ||
#include <comm/data/ImageEncodeData.h> | ||
#include <opencv2/opencv.hpp> | ||
|
||
namespace comm { | ||
class ImageEncodeDataWithOpenCV : public ImageEncodeData, public ImageDataWithOpenCV { | ||
public: | ||
ImageEncodeDataWithOpenCV(); | ||
|
||
ImageEncodeDataWithOpenCV(cv::Mat image, int id, Encoding encoding); | ||
|
||
ImageEncodeDataWithOpenCV(const std::vector<unsigned char> &imageEncodedBytes, int imageHeight, int imageWidth, | ||
int imageType, int id, Encoding encoding); | ||
|
||
~ImageEncodeDataWithOpenCV() override; | ||
|
||
bool serialize(Buffer *buffer, int start, bool forceCopy, bool verbose) override; | ||
|
||
char *getDeserializeBuffer() override; | ||
|
||
bool deserialize(Buffer *buffer, int start, bool forceCopy, bool verbose) override; | ||
}; | ||
} | ||
|
||
#endif //COMM_DATA_IMAGEENCODEDATAWITHOPENCV_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Created by Andrei Costinescu ([email protected]) on 24.03.2021. | ||
// | ||
|
||
#ifndef COMM_DATA_DATAUTILSWITHOPENCV_H | ||
#define COMM_DATA_DATAUTILSWITHOPENCV_H | ||
|
||
#include <comm/data/MessageType.h> | ||
#include <comm/data/CommunicationData.h> | ||
|
||
namespace comm { | ||
CommunicationData *createCommunicationDataPtrWithOpenCV(const MessageType &messageType); | ||
} | ||
|
||
#endif //COMM_DATA_DATAUTILSWITHOPENCV_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// Created by Andrei Costinescu ([email protected]) on 01-Apr-21. | ||
// | ||
|
||
#include <comm/data/DataCollectionWithOpenCV.h> | ||
#include <comm/data/dataUtilsWithOpenCV.h> | ||
|
||
using namespace comm; | ||
using namespace std; | ||
|
||
DataCollectionWithOpenCV::DataCollectionWithOpenCV() : DataCollection(createCommunicationDataPtrWithOpenCV) {} | ||
|
||
DataCollectionWithOpenCV::DataCollectionWithOpenCV(function<CommunicationData *(MessageType)> dataCreationFunction) | ||
: DataCollection(move(dataCreationFunction)) {} | ||
|
||
DataCollectionWithOpenCV::~DataCollectionWithOpenCV() = default; |
Oops, something went wrong.