25 lines
591 B
C++

#ifndef IMAGEPACKET_H
#define IMAGEPACKET_H
#include <opencv2/core/mat.hpp>
#define SLICE_SIZE 768
#define IMAGEPACKET_SIZE sizeof(int) + (SLICE_SIZE * sizeof(uchar))
class ImagePacket {
public:
ImagePacket(const cv::Mat *image, int begin) : ImagePacket(image->data, begin) {}
ImagePacket(const uchar *image, int begin);
~ImagePacket();
unsigned long getBegin() const;
int apply(const cv::Mat *image) const;
void serialize(char* buffer) const;
void deserialize(char* buffer);
private:
unsigned long begin;
uchar *slice;
};
#endif //IMAGEPACKET_H