提交 | 用户 | age
|
4b03ae
|
1 |
#ifndef MV_GENICAM_TYPES_H
|
Q |
2 |
#define MV_GENICAM_TYPES_H
|
|
3 |
|
|
4 |
#if ! defined(_MSC_VER)
|
|
5 |
|
|
6 |
#include <stdint.h>
|
|
7 |
|
|
8 |
#define interface struct
|
|
9 |
|
|
10 |
#else // if defined(_MSC_VER)
|
|
11 |
|
|
12 |
//! \addtogroup Base_PublicUtilities
|
|
13 |
//! \{
|
|
14 |
|
|
15 |
//! makes int 8 portable across different platforms
|
|
16 |
typedef signed char int8_t;
|
|
17 |
//! makes char 8 portable across different platforms
|
|
18 |
typedef char char8_t;
|
|
19 |
//! makes unsigned char portable across different platforms
|
|
20 |
typedef unsigned char uint8_t;
|
|
21 |
//! makes char 8 portable across different platforms
|
|
22 |
typedef unsigned char uchar8_t;
|
|
23 |
|
|
24 |
//! makes short portable across different platforms
|
|
25 |
typedef short int16_t;
|
|
26 |
//! makes unsigned short portable across different platforms
|
|
27 |
typedef unsigned short uint16_t;
|
|
28 |
|
|
29 |
//! makes __int32 portable across different platforms
|
|
30 |
typedef __int32 int32_t;
|
|
31 |
//! makes unsigned int32 portable across different platforms
|
|
32 |
typedef unsigned __int32 uint32_t;
|
|
33 |
|
|
34 |
//! makes int64 portable across different platforms
|
|
35 |
typedef __int64 int64_t;
|
|
36 |
//! makes unsigned int64 portable across different platforms
|
|
37 |
typedef unsigned __int64 uint64_t;
|
|
38 |
|
|
39 |
//! use a universal platform dependend int
|
|
40 |
typedef __int64 int_t;
|
|
41 |
//! use a universal platform dependend unsigned int
|
|
42 |
typedef unsigned __int64 uint_t;
|
|
43 |
|
|
44 |
#ifndef _SIZE_T_DEFINED
|
|
45 |
#ifdef _WIN64
|
|
46 |
//! use a universal platform dependend unsigned int
|
|
47 |
typedef unsigned __int64 size_t;
|
|
48 |
#else
|
|
49 |
//! use a universal platform dependend unsigned int
|
|
50 |
typedef unsigned int size_t;
|
|
51 |
#endif
|
|
52 |
#define _SIZE_T_DEFINED
|
|
53 |
#endif
|
|
54 |
|
|
55 |
#ifndef _INTPTR_T_DEFINED
|
|
56 |
#ifdef _WIN64
|
|
57 |
//! use a universal platform dependend int
|
|
58 |
typedef __int64 intptr_t;
|
|
59 |
#else
|
|
60 |
//! use a universal platform dependend int
|
|
61 |
typedef int intptr_t;
|
|
62 |
#endif
|
|
63 |
#define _INTPTR_T_DEFINED
|
|
64 |
#endif
|
|
65 |
#endif
|
|
66 |
#ifndef INT64_MAX
|
|
67 |
#define INT64_MAX 0x7fffffffffffffffLL /*maximum signed __int64 value */
|
|
68 |
#define INT64_MIN 0x8000000000000000LL /*minimum signed __int64 value */
|
|
69 |
#define UINT64_MAX 0xffffffffffffffffULL /*maximum unsigned __int64 value */
|
|
70 |
|
|
71 |
#define INT32_MAX 0x000000007fffffffLL /*maximum signed __int32 value */
|
|
72 |
#define INT32_MIN 0xffffffff80000000LL /*minimum signed __int32 value */
|
|
73 |
#define UINT32_MAX 0x00000000ffffffffULL /*maximum unsigned __int32 value */
|
|
74 |
|
|
75 |
#define INT8_MAX 0x000000000000007fLL /*maximum signed __int8 value */
|
|
76 |
#define INT8_MIN 0xffffffffffffff80LL /*minimum signed __int8 value */
|
|
77 |
#define UINT8_MAX 0x00000000000000ffULL /*maximum unsigned __int8 value */
|
|
78 |
#endif
|
|
79 |
//! \}
|
|
80 |
|
|
81 |
|
|
82 |
/*
|
|
83 |
* \brief 回调函数得到的数据的结构
|
|
84 |
*/
|
|
85 |
typedef struct _IMAGE_INFO
|
|
86 |
{
|
|
87 |
uint64_t nTimeStamp; ///< 时间戳,采集到图像的时刻,精度为0.01us
|
|
88 |
USHORT nBlockId; ///< 帧号,从开始采集开始计数
|
|
89 |
UCHAR *pImageBuffer; ///< 图像指针,即指向(0,0)像素所在内存位置的指针,通过该指针可以访问整个图像
|
|
90 |
ULONG nImageSizeAcq; ///< 采集到的图像大小[字节]
|
|
91 |
UCHAR nMissingPackets;///< 传输过程中丢掉的包数量
|
|
92 |
uint64_t nPixelType; ///< 图像格式
|
|
93 |
uint32_t nSizeX; ///< 图像宽度
|
|
94 |
uint32_t nSizeY; ///< 图像高度
|
|
95 |
uint32_t nOffsetX; ///< 0
|
|
96 |
uint32_t nOffsetY; ///< 0
|
|
97 |
} MV_IMAGE_INFO, * pMV_IMAGE_INFO ;
|
|
98 |
|
|
99 |
/*
|
|
100 |
* \brief Bayer颜色模式
|
|
101 |
*/
|
|
102 |
typedef enum {
|
|
103 |
BayerRG, //< 颜色模式RGGB
|
|
104 |
BayerBG, //< 颜色模式BGGR
|
|
105 |
BayerGR, //< 颜色模式GRBG
|
|
106 |
BayerGB, //< 颜色模式GBRG
|
|
107 |
BayerGRW, //< 颜色模式GRW
|
|
108 |
BayerInvalid
|
|
109 |
} MV_BAYER_MODE;
|
|
110 |
|
|
111 |
/*
|
|
112 |
* \brief 图像像素格式
|
|
113 |
*/
|
|
114 |
typedef enum {
|
|
115 |
PixelFormat_Mono8, //!<8Bit灰度
|
|
116 |
PixelFormat_BayerBG8, //!<8Bit Bayer图,颜色模式为BGGR
|
|
117 |
PixelFormat_BayerRG8, //!<8Bit Bayer图,颜色模式为RGGB
|
|
118 |
PixelFormat_BayerGB8, //!<8Bit Bayer图,颜色模式为GBRG
|
|
119 |
PixelFormat_BayerGR8, //!<8Bit Bayer图,颜色模式为GRBG
|
|
120 |
PixelFormat_BayerGRW8
|
|
121 |
} MV_PixelFormatEnums;
|
|
122 |
|
|
123 |
/*
|
|
124 |
* \brief 错误返回值类型
|
|
125 |
*/
|
|
126 |
typedef enum
|
|
127 |
{
|
|
128 |
MVST_SUCCESS = 0, ///< 没有错误
|
|
129 |
MVST_ERROR = -1001, ///< 一般错误
|
|
130 |
MVST_ERR_NOT_INITIALIZED = -1002, //!< 没有初始化
|
|
131 |
MVST_ERR_NOT_IMPLEMENTED = -1003, //!< 没有实现
|
|
132 |
MVST_ERR_RESOURCE_IN_USE = -1004, //!< 资源被占用
|
|
133 |
MVST_ACCESS_DENIED = -1005, ///< 无法访问
|
|
134 |
MVST_INVALID_HANDLE = -1006, ///< 错误句柄
|
|
135 |
MVST_INVALID_ID = -1007, ///< 错误ID
|
|
136 |
MVST_NO_DATA = -1008, ///< 没有数据
|
|
137 |
MVST_INVALID_PARAMETER = -1009, ///< 错误参数
|
|
138 |
MVST_FILE_IO = -1010, ///< IO错误
|
|
139 |
MVST_TIMEOUT = -1011, ///< 超时
|
|
140 |
MVST_ERR_ABORT = -1012, ///< 退出
|
|
141 |
MVST_INVALID_BUFFER_SIZE = -1013, ///< 缓冲区尺寸错误
|
|
142 |
MVST_ERR_NOT_AVAILABLE = -1014, ///< 无法访问
|
|
143 |
MVST_INVALID_ADDRESS = -1015, ///< 地址错误
|
|
144 |
}MVSTATUS_CODES;
|
|
145 |
|
|
146 |
typedef struct
|
|
147 |
{
|
|
148 |
unsigned char mIpAddr[4]; //!<相机的IP地址
|
|
149 |
unsigned char mEthernetAddr[6]; //!<相机的MAC地址
|
|
150 |
char mMfgName[32]; //!<相机厂商名称
|
|
151 |
char mModelName[32]; //!<相机型号
|
|
152 |
char mSerialNumber[16]; //!<相机序列号
|
|
153 |
char mUserDefinedName[16]; //!<用户设置的相机名称
|
|
154 |
unsigned char m_IfIp[4]; //!<计算机和相机连接的网卡IP地址
|
|
155 |
unsigned char m_IfMAC[6]; //!<计算机和相机连接的网卡MAC地址
|
|
156 |
}MVCamInfo;
|
|
157 |
|
|
158 |
enum TriggerSourceEnums
|
|
159 |
{
|
|
160 |
TriggerSource_Software=0,//!<触发模式下,由软触发(软件指令)来触发采集
|
|
161 |
TriggerSource_Line1=2 //!<触发模式下,有外触发信号来触发采集
|
|
162 |
};
|
|
163 |
|
|
164 |
enum TriggerModeEnums
|
|
165 |
{
|
|
166 |
TriggerMode_Off, //!<触发模式关,即FreeRun模式,相机连续采集
|
|
167 |
TriggerMode_On //!<触发模式开,相机等待软触发或外触发信号再采集图像
|
|
168 |
};
|
|
169 |
|
|
170 |
enum TriggerActivationEnums
|
|
171 |
{
|
|
172 |
TriggerActivation_RisingEdge,//!<上升沿触发
|
|
173 |
TriggerActivation_FallingEdge//!<下降沿触发
|
|
174 |
};
|
|
175 |
|
|
176 |
enum LineSourceEnums
|
|
177 |
{
|
|
178 |
LineSource_Off=0, //!<关闭
|
|
179 |
LineSource_ExposureActive=5, //!<和曝光同时
|
|
180 |
LineSource_Timer1Active=6, //!<由定时器控制
|
|
181 |
LineSource_UserOutput0=12 //!<直接由软件控制
|
|
182 |
};
|
|
183 |
|
|
184 |
typedef struct
|
|
185 |
{
|
|
186 |
unsigned long m_nTotalBuf; //!<从开始采集,总计成功收到的完整图像帧数
|
|
187 |
unsigned long m_nFailedBuf; //!<从开始采集,总计收到的不完整图像帧数
|
|
188 |
unsigned long m_nTotalPacket; //!<从开始采集,总计收到的图像数据包数
|
|
189 |
unsigned long m_nFailedPacket; //!<从开始采集,总计丢失的图像数据包数
|
|
190 |
unsigned long m_nResendPacketReq;//!<从开始采集,总计重发请求的图像数据包数
|
|
191 |
unsigned long m_nResendPacket;//!<从开始采集,总计重发成功的图像数据包数
|
|
192 |
}MVStreamStatistic;
|
|
193 |
|
|
194 |
enum UserSetSelectorEnums
|
|
195 |
{
|
|
196 |
UserSetSelector_Default, //!<出厂设置
|
|
197 |
UserSetSelector_UserSet1, //!<用户设置1
|
|
198 |
UserSetSelector_UserSet2 //!<用户设置2
|
|
199 |
};
|
|
200 |
|
|
201 |
enum SensorTapsEnums
|
|
202 |
{
|
|
203 |
SensorTaps_One, //!<单通道
|
|
204 |
SensorTaps_Two, //!<双通道
|
|
205 |
SensorTaps_Three, //!<三通道
|
|
206 |
SensorTaps_Four, //!<四通道
|
|
207 |
};
|
|
208 |
|
|
209 |
enum AutoFunctionProfileEnums
|
|
210 |
{
|
|
211 |
AutoFunctionProfile_GainMinimum, //!<Keep gain at minimum
|
|
212 |
AutoFunctionProfile_ExposureMinimum //!<Exposure Time at minimum
|
|
213 |
};
|
|
214 |
|
|
215 |
enum GainAutoEnums
|
|
216 |
{
|
|
217 |
GainAuto_Off, //!<Disables the Gain Auto function.
|
|
218 |
GainAuto_Once, //!<Sets operation mode to 'once'.
|
|
219 |
GainAuto_Continuous //!<Sets operation mode to 'continuous'.
|
|
220 |
};
|
|
221 |
|
|
222 |
//! Valid values for ExposureAuto
|
|
223 |
enum ExposureAutoEnums
|
|
224 |
{
|
|
225 |
ExposureAuto_Off, //!<Disables the Exposure Auto function.
|
|
226 |
ExposureAuto_Once, //!<Sets operation mode to 'once'.
|
|
227 |
ExposureAuto_Continuous //!<Sets operation mode to 'continuous'.
|
|
228 |
};
|
|
229 |
|
|
230 |
enum BalanceWhiteAutoEnums
|
|
231 |
{
|
|
232 |
BalanceWhiteAuto_Off, //!<Disables the Balance White Auto function.
|
|
233 |
BalanceWhiteAuto_Once, //!<Sets operation mode to 'once'.
|
|
234 |
BalanceWhiteAuto_Continuous //!<Sets operation mode to 'continuous'.
|
|
235 |
};
|
|
236 |
|
|
237 |
|
|
238 |
//////////////////////////////////////////////////////////////////////////
|
|
239 |
enum ImageFlipType
|
|
240 |
{
|
|
241 |
FlipHorizontal = 0, //!< 左右翻转
|
|
242 |
FlipVertical = 1, //!< 上下翻转
|
|
243 |
FlipBoth = 2 //!< 旋转180度
|
|
244 |
} ;
|
|
245 |
|
|
246 |
enum ImageRotateType
|
|
247 |
{
|
|
248 |
Rotate90DegCw = 0, //!< 顺时针旋转90度
|
|
249 |
Rotate90DegCcw = 1 //!< 逆时针旋转90度
|
|
250 |
};
|
|
251 |
|
|
252 |
#endif
|