2,新增“Apps”; 3,新增“Common”; 4,新增“FileList”; 5,新增“MediaX”; 6,新增“OpenSource”; 7,新增“Samples”; 8,新增“SoftwareBusinessLines”.
113 lines
2.5 KiB
C++
113 lines
2.5 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QComboBox>
|
|
#include <QTimer>
|
|
|
|
#include <thread>
|
|
using namespace std;
|
|
|
|
#include "./../../Common/CommDef.h"
|
|
#include "./../../Common/GCycleQueue.h"
|
|
#include "./../../Common/OpenGLView.h"
|
|
#include "./../../Common/GdImageLib.h"
|
|
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
enum eImageResolution
|
|
{
|
|
eIR_320_256 = 1,
|
|
eIR_320_288,
|
|
eIR_400_300,
|
|
eIR_640_512,
|
|
eIR_800_600,
|
|
eIR_1280_1024,
|
|
eIR_Other,
|
|
eIR_TestImage = 0,
|
|
};
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
~MainWindow();
|
|
|
|
bool CaptureData(byte* pFrameData, int nFrameDataLen);
|
|
|
|
private:
|
|
void InitOpenGLView();
|
|
void Connect();
|
|
void Disconnect();
|
|
|
|
protected:
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
private slots:
|
|
void OnButtonClicked();
|
|
void OnButtonClicked_TestImage();
|
|
void OnButtonClicked_Radio();
|
|
void OnButtonClicked_ProcessData();
|
|
void OnComboxIndexChanged(int nIndex);
|
|
void OnTimer();
|
|
|
|
private:
|
|
void InitStyle();
|
|
|
|
void MakeKList(ushort** pKList, ushort* pY16DataB1, ushort* pY16DataB2, int nPixelSize);
|
|
void MakeBPList(ushort** pBPList, ushort* pKList, int nImageWidth, int nImageHeight);
|
|
void CorrectKList(ushort** pKList, ushort* pBPList, int nPixelSize);
|
|
|
|
private:
|
|
typedef void (MainWindow::*ThreadRunFunPtr)();
|
|
static void ThreadEntry(ThreadRunFunPtr pRunFun, void* pOwner);
|
|
|
|
void ThreadFun_CaptureDeviceData();
|
|
|
|
bool StartThread_DealDeviceData();
|
|
void StopThread_DealDeviceData();
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
|
|
QPoint m_ptMouse;
|
|
bool m_bMousePressed;
|
|
|
|
int m_nImageWidth;
|
|
int m_nImageHeight;
|
|
|
|
byte* m_pTestDataBuffer;
|
|
|
|
QTimer m_varTimer;
|
|
GCycleQueue m_varCaptureData; // 设备采集数据
|
|
|
|
//
|
|
GCycleQueue m_varY16Data;
|
|
|
|
//
|
|
OpenGLView* m_pOpenGLView;
|
|
|
|
//
|
|
bool m_bThreadRunning_CaptureDeviceData;
|
|
std::thread* m_ptrThread_CaptureDeviceData;
|
|
|
|
bool m_bEnableCapture;
|
|
int m_nImageMoveIndex;
|
|
|
|
eImageResolution m_eIR;
|
|
|
|
ushort* m_pY16Data_B1;
|
|
byte* m_pY8Data_B1;
|
|
ushort* m_pY16Data_B2;
|
|
byte* m_pY8Data_B2;
|
|
byte* m_pRGBA;
|
|
ushort* m_pY16Data_KList;
|
|
ushort* m_pY16Data_BPList;
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|