提交 | 用户 | age
|
4b03ae
|
1 |
#pragma once
|
Q |
2 |
|
|
3 |
#pragma warning (push)
|
|
4 |
#pragma warning (disable : 4005)
|
|
5 |
#include <pylon/PylonIncludes.h>
|
|
6 |
#include <pylon/gige/BaslerGigEInstantCamera.h>
|
|
7 |
#pragma warning (pop)
|
|
8 |
#pragma warning (default : 4005)
|
|
9 |
|
|
10 |
#include "../ImageFunc/ImageFunc.h"
|
|
11 |
#include "MyCameraBase.h"
|
|
12 |
#include <GdiPlus.h>
|
|
13 |
|
|
14 |
typedef Pylon::CBaslerGigEInstantCamera Camera_t;
|
|
15 |
|
|
16 |
class BaslerCamera : public MyCamera
|
|
17 |
{
|
|
18 |
public:
|
|
19 |
BaslerCamera(void);
|
|
20 |
~BaslerCamera(void);
|
|
21 |
public:
|
|
22 |
static int TotalCameraCount; //所有Basler相机数量
|
|
23 |
volatile static int Inited; //是否已经初始化
|
|
24 |
static const int TimeOutmS=1000; //超时时间
|
|
25 |
|
|
26 |
int Index; //相机索引号,多个相机时
|
|
27 |
double ExposeTimemS;
|
|
28 |
|
|
29 |
public:
|
|
30 |
Camera_t camera; //定义全局相机变量
|
|
31 |
private:
|
|
32 |
|
|
33 |
Pylon::CGrabResultPtr ptrGrabResult;
|
|
34 |
public:
|
|
35 |
static int InitLib();
|
|
36 |
int GetCameraInfo(int index, MyCameraInfo * pMyCameraInfo);
|
|
37 |
int GetCameraCount(){return TotalCameraCount;}
|
|
38 |
int OpenCamera(int Index);
|
|
39 |
int CloseCamera();
|
|
40 |
int GetCameraWidthHeight(int *nWidth,int *nHeight)
|
|
41 |
{
|
|
42 |
*nWidth=m_nWidth;
|
|
43 |
*nHeight=m_nHeight;
|
|
44 |
return CameraOk;
|
|
45 |
}
|
|
46 |
int GetCameraPixelFormat(){return m_PixelFormat;}
|
|
47 |
int SetExposureTime(double ExposeTime1);
|
|
48 |
int SetGain(double Gain){return CameraOk;}
|
|
49 |
int SetROI(int nOffsetX, int nOffsetY, int nWidth, int nHeight)
|
|
50 |
{
|
|
51 |
return CameraOk;
|
|
52 |
}
|
|
53 |
int StartGrab();
|
|
54 |
int StopGrab(){return CameraOk;};
|
|
55 |
int WaitForGrabFinish(int TimeOutmS);
|
|
56 |
int FetchImageData();
|
|
57 |
|
|
58 |
int SetPixelFormat(Basler_GigECameraParams::PixelFormatEnums newPixelFormat);
|
|
59 |
};
|
|
60 |
|