twain3.0/huagao/Device/jpeglib.h

27 lines
489 B
C++

#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;
};