rk3399_arm_lvds/scanner/imageusbtesthandler.cpp

38 lines
1.4 KiB
C++
Raw Permalink Normal View History

2024-03-05 03:46:18 +00:00
#include "imageusbtesthandler.h"
#include "opencv2/opencv.hpp"
#include "imgproc.h"
#include "stringex.hpp"
#include "memoryex.h"
#include "usbimageprocqueue.h"
#include "applog.h"
static std::string loggername = "ImageUsbTestHandler";
ImageUsbTestHandler::ImageUsbTestHandler(std::shared_ptr<UsbImageProcQueue> images)
: ImageUsbHandler(images)
{
}
void ImageUsbTestHandler::add_image(void* data, int width, int height, int type ,int scannnum,unsigned int fpgaversion)
{
// results.emplace_back(
// pool.enqueue([this, data, width, height, type]
// {
// int imtype = type ? CV_8UC3 : CV_8UC1;
// int imheight = height;
// int imwidth = width;
// LOG_TRACE(string_format("buff one"));
// auto mem = VectorMemroyPtr(new VectorMemroy());
// std::vector<unsigned char> &imdata = mem->buf();
// if(imtype == CV_8UC3)
// {
// imheight /= 3;
// imwidth *= 9;
// }
// cv::Mat mat(imheight, imwidth, type, data);
// cv::imencode(".jpg", mat, imdata);
// LOG_TRACE(string_format("buff size = %d \n", mem->size()));
// images->push(mem);
// }));
}