#pragma once #include "turbojpeg.h" #include #include class JpegLib { public: JpegLib(); ~JpegLib(); void clear(); cv::Mat decode(cv::Mat buf, int pixelFormat); void decode(unsigned char* buff, unsigned long buff_size, int pixelFormat); int getWidth(); int getHeight(); int getBufferSize(); unsigned char* getData(); private: std::shared_ptr handle; std::shared_ptr img_buffer; int sizeBuffer; int width; int height; };