Files
eUi/subModule/Hd_CameraModule_HIK_PCIE/Hd_CameraModule_HIK_PCIE.h
T

85 lines
2.5 KiB
C++
Raw Normal View History

2025-11-10 17:15:21 +08:00
#ifndef Hd_CameraModule_HIK_hard_PCIE_H
#define Hd_CameraModule_HIK_hard_PCIE_H
#include <QtCore/qglobal.h>
#include <MvCameraControl.h>
#include <CameraParams.h>
#include <Windows.h>
#include <time.h>
#include <QThread>
#include <QQueue>
#include <QMutex>
#include <QDebug>
#include <subModuleBase.h>
using namespace cv;
#pragma execution_character_set("utf-8")
static MV_GENTL_IF_INFO_LIST QByteArrayToMV_GENTL_IF_INFO_LIST(const QByteArray& byteArray) {
MV_GENTL_IF_INFO_LIST deviceInfoList;
if (byteArray.size() == sizeof(MV_GENTL_IF_INFO_LIST)) {
memcpy(&deviceInfoList, byteArray.constData(), sizeof(MV_GENTL_IF_INFO_LIST));
}
else {
qDebug() << "Invalid size of QByteArray for MV_GENTL_IF_INFO_LIST!";
}
return deviceInfoList;
}
bool IsColor(MvGvspPixelType enType)
{
switch (enType)
{
case PixelType_Gvsp_RGB8_Packed:
case PixelType_Gvsp_YUV422_Packed:
case PixelType_Gvsp_YUV422_YUYV_Packed:
case PixelType_Gvsp_BayerGR8:
case PixelType_Gvsp_BayerRG8:
case PixelType_Gvsp_BayerGB8:
case PixelType_Gvsp_BayerBG8:
case PixelType_Gvsp_BayerGB10:
case PixelType_Gvsp_BayerGB10_Packed:
case PixelType_Gvsp_BayerBG10:
case PixelType_Gvsp_BayerBG10_Packed:
case PixelType_Gvsp_BayerRG10:
case PixelType_Gvsp_BayerRG10_Packed:
case PixelType_Gvsp_BayerGR10:
case PixelType_Gvsp_BayerGR10_Packed:
case PixelType_Gvsp_BayerGB12:
case PixelType_Gvsp_BayerGB12_Packed:
case PixelType_Gvsp_BayerBG12:
case PixelType_Gvsp_BayerBG12_Packed:
case PixelType_Gvsp_BayerRG12:
case PixelType_Gvsp_BayerRG12_Packed:
case PixelType_Gvsp_BayerGR12:
case PixelType_Gvsp_BayerGR12_Packed:
return true;
default:
return false;
}
}
class Hd_CameraModule_HIK_hard_PCIE :public dsModuleBase
{
public:
Hd_CameraModule_HIK_hard_PCIE();
virtual ~Hd_CameraModule_HIK_hard_PCIE();
//从类中读数据到实例对象
bool readData(std::vector<cv::Mat>& mat, QByteArray& data);
//实例对象把数据写入到类
bool writeData(std::vector<cv::Mat>& mat, QByteArray& data);
bool initParas(QByteArray& initData);
bool run();
bool checkStatus();
private:
std::vector<int> imgShouldGetVec;
int imgShouldGetIndex = 0;
//MyThread *m_thread = nullptr;
//QMutex* m_mutex;
};
extern "C"
{
Q_DECL_EXPORT Hd_CameraModule_HIK_hard_PCIE * create();
Q_DECL_EXPORT void destory(Hd_CameraModule_HIK_hard_PCIE * ptr);
}
#endif // Hd_CameraModule_HIK_hard_H
//Hd_CameraModule_HIK_hard_PCIE