huago-corrcet_tools/HuaGoCorrect/jpeglib.h

27 lines
491 B
C
Raw Normal View History

2020-08-31 08:08:50 +00:00
#pragma once
#include "turbojpeg.h"
#include <memory>
#include <opencv2\opencv.hpp>
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<void> handle;
std::shared_ptr<unsigned char> img_buffer;
int sizeBuffer;
int width;
int height;
};