using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;
using System.Diagnostics;
namespace MvCamCtrl.NET
{
///
/// MyCamera
///
public class MyCamera
{
///
/// Constructor
///
public MyCamera()
{
handle = IntPtr.Zero;
}
///
/// Destructor
///
~MyCamera()
{
handle = IntPtr.Zero;
}
///
/// 设备句柄
///
IntPtr handle;
#region ch:委托声明 | en:delegate
///
/// Grab callback
///
/// Image data
/// Frame info
/// User defined variable
public delegate void cbOutputdelegate(IntPtr pData, ref MV_FRAME_OUT_INFO pFrameInfo, IntPtr pUser);
///
/// Grab callback
///
/// Image data
/// Frame info
/// User defined variable
public delegate void cbOutputExdelegate(IntPtr pData, ref MV_FRAME_OUT_INFO_EX pFrameInfo, IntPtr pUser);
///
/// Xml Update callback(Interfaces not recommended)
///
/// Node type
/// Current node feature structure
/// Nodes list
/// User defined variable
public delegate void cbXmlUpdatedelegate(MV_XML_InterfaceType enType, IntPtr pstFeature, ref MV_XML_NODES_LIST pstNodesList, IntPtr pUser);
///
/// Exception callback
///
/// Msg type
/// User defined variable
public delegate void cbExceptiondelegate(UInt32 nMsgType, IntPtr pUser);
///
/// Event callback (Interfaces not recommended)
///
/// User defined ID
/// User defined variable
public delegate void cbEventdelegate(UInt32 nUserDefinedId, IntPtr pUser);
///
/// Event callback
///
/// Event Info
/// User defined variable
public delegate void cbEventdelegateEx(ref MV_EVENT_OUT_INFO pEventInfo, IntPtr pUser);
///
/// Stream Exception callback
///
/// Msg type
/// User defined variable
public delegate void cbStreamException(MV_CC_STREAM_EXCEPTION_TYPE enExceptionType, IntPtr pUser);
#endregion
///
/// Initialize
///
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_CC_Initialize_NET()
{
return MV_CC_Initialize();
}
///
/// Finalize
///
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_CC_Finalize_NET()
{
return MV_CC_Finalize();
}
#region 采集卡接口
///
/// 枚举采集卡设备信息
///
/// 采集卡类型
/// 设备信息
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_CC_EnumInterfaces_NET(UInt32 nTLayerType, ref MV_INTERFACE_INFO_LIST pInterfaceInfoList)
{
return MV_CC_EnumInterfaces(nTLayerType, ref pInterfaceInfoList);
}
///
/// 创建采集卡设备句柄
///
/// 采集卡设备信息
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_CreateInterface_NET(ref MV_INTERFACE_INFO pInterfaceInfo)
{
if (IntPtr.Zero != handle)
{
MV_CC_DestroyInterface(handle);
handle = IntPtr.Zero;
}
return MV_CC_CreateInterface(ref handle, ref pInterfaceInfo);
}
///
/// 通过采集卡ID创建设备句柄
///
/// 采集卡ID
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_CreateInterfaceByID_NET(String pInterfaceID)
{
if (IntPtr.Zero != handle)
{
MV_CC_DestroyInterface(handle);
handle = IntPtr.Zero;
}
return MV_CC_CreateInterfaceByID(ref handle, pInterfaceID);
}
///
/// 打开采集卡设备
///
/// 采集卡信息配置文件(目前不支持传配置文件)
///
public Int32 MV_CC_OpenInterface_NET(String strConfigFile)
{
return MV_CC_OpenInterface(handle, strConfigFile);
}
///
/// 关闭采集卡
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_CloseInterface_NET()
{
return MV_CC_CloseInterface(handle);
}
///
/// 销毁采集卡句柄
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_DestroyInterface_NET()
{
Int32 nRet = MV_CC_DestroyInterface(handle);
handle = IntPtr.Zero;
return nRet;
}
#endregion
#region ch:相机的控制和取流接口 | en:Camera control and streaming
///
/// Get Camera Handle
///
///
public IntPtr GetCameraHandle()
{
return handle;
}
///
/// Get SDK Version
///
/// Always return 4 Bytes of version number |Main |Sub |Rev |Test|
/// 8bits 8bits 8bits 8bits
///
public static UInt32 MV_CC_GetSDKVersion_NET()
{
return MV_CC_GetSDKVersion();
}
///
/// Get supported Transport Layer
///
/// Supported Transport Layer number
public static Int32 MV_CC_EnumerateTls_NET()
{
return MV_CC_EnumerateTls();
}
///
/// Enumerate Device
///
/// Enumerate TLs
/// Device List
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_CC_EnumDevices_NET(UInt32 nTLayerType, ref MV_CC_DEVICE_INFO_LIST stDevList)
{
return MV_CC_EnumDevices(nTLayerType, ref stDevList);
}
///
/// Enumerate device according to manufacture name
///
/// Enumerate TLs
/// Device List
/// Manufacture Name
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_CC_EnumDevicesEx_NET(UInt32 nTLayerType, ref MV_CC_DEVICE_INFO_LIST stDevList, string pManufacturerName)
{
return MV_CC_EnumDevicesEx(nTLayerType, ref stDevList, pManufacturerName);
}
///
/// Enumerate device according to the specified ordering
///
/// Transmission layer of enumeration(All layer protocol type can input)
/// Device list
/// Manufacture Name
/// Sorting Method
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_CC_EnumDevicesEx2_NET(UInt32 nTLayerType, ref MV_CC_DEVICE_INFO_LIST stDevList, string pManufacturerName, MV_SORT_METHOD enSortMethod)
{
return MV_CC_EnumDevicesEx2(nTLayerType, ref stDevList, pManufacturerName, enSortMethod);
}
///
/// Is the device accessible
///
/// Device Information
/// Access Right
/// Access, return true. Not access, return false
public static Boolean MV_CC_IsDeviceAccessible_NET(ref MV_CC_DEVICE_INFO stDevInfo, UInt32 nAccessMode)
{
Byte bRet = MV_CC_IsDeviceAccessible(ref stDevInfo, nAccessMode);
if (bRet != 0)
{
return true;
}
return false;
}
///
/// Set SDK log path (Interfaces not recommended)
/// If the logging service MvLogServer is enabled, the interface is invalid and The logging service is enabled by default
///
///
///
public static Int32 MV_CC_SetSDKLogPath_NET(String pSDKLogPath)
{
return MV_CC_SetSDKLogPath(pSDKLogPath);
}
///
/// Create Device
///
/// Device Information
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_CreateDevice_NET(ref MV_CC_DEVICE_INFO stDevInfo)
{
if (IntPtr.Zero != handle)
{
MV_CC_DestroyHandle(handle);
handle = IntPtr.Zero;
}
return MV_CC_CreateHandle(ref handle, ref stDevInfo);
}
///
/// Create Device without log
///
/// Device Information
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_CreateDeviceWithoutLog_NET(ref MV_CC_DEVICE_INFO stDevInfo)
{
if (IntPtr.Zero != handle)
{
MV_CC_DestroyHandle(handle);
handle = IntPtr.Zero;
}
return MV_CC_CreateHandleWithoutLog(ref handle, ref stDevInfo);
}
///
/// Destroy Device
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_DestroyDevice_NET()
{
Int32 nRet = MV_CC_DestroyHandle(handle);
handle = IntPtr.Zero;
return nRet;
}
///
/// Open Device
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_OpenDevice_NET()
{
return MV_CC_OpenDevice(handle, 1, 0);
}
///
/// Open Device
///
/// Access Right
/// Switch key of access right
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_OpenDevice_NET(UInt32 nAccessMode, UInt16 nSwitchoverKey)
{
return MV_CC_OpenDevice(handle, nAccessMode, nSwitchoverKey);
}
///
/// Close Device
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_CloseDevice_NET()
{
return MV_CC_CloseDevice(handle);
}
///
/// Is the device connected
///
/// Connected, return true. Not Connected or DIsconnected, return false
public Boolean MV_CC_IsDeviceConnected_NET()
{
if (handle == IntPtr.Zero)
{
return false;
}
Byte bRet = MV_CC_IsDeviceConnected(handle);
if (bRet != 0)
{
return true;
}
return false;
}
///
/// Register the image callback function
///
/// Callback function pointer
/// User defined variable
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_RegisterImageCallBackEx_NET(cbOutputExdelegate cbOutput, IntPtr pUser)
{
return MV_CC_RegisterImageCallBackEx(handle, cbOutput, pUser);
}
///
/// Register the RGB image callback function
///
/// Callback function pointer
/// User defined variable
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_RegisterImageCallBackForRGB_NET(cbOutputExdelegate cbOutput, IntPtr pUser)
{
return MV_CC_RegisterImageCallBackForRGB(handle, cbOutput, pUser);
}
///
/// Register the BGR image callback function
///
/// Callback function pointer
/// User defined variable
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_RegisterImageCallBackForBGR_NET(cbOutputExdelegate cbOutput, IntPtr pUser)
{
return MV_CC_RegisterImageCallBackForBGR(handle, cbOutput, pUser);
}
///
/// Start Grabbing
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_StartGrabbing_NET()
{
return MV_CC_StartGrabbing(handle);
}
///
/// Stop Grabbing
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_StopGrabbing_NET()
{
return MV_CC_StopGrabbing(handle);
}
///
/// Get one frame of RGB image, this function is using query to get data
/// query whether the internal cache has data, get data if there has, return error code if no data
///
/// Image data receiving buffer
/// Buffer size
/// Image information
/// Waiting timeout
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetImageForRGB_NET(IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO_EX pFrameInfo, Int32 nMsec)
{
return MV_CC_GetImageForRGB(handle, pData, nDataSize, ref pFrameInfo, nMsec);
}
///
/// Get one frame of BGR image, this function is using query to get data
/// query whether the internal cache has data, get data if there has, return error code if no data
///
/// Image data receiving buffer
/// Buffer size
/// Image information
/// Waiting timeout
/// Success, return MV_OK. Failure, return error cod
public Int32 MV_CC_GetImageForBGR_NET(IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO_EX pFrameInfo, Int32 nMsec)
{
return MV_CC_GetImageForBGR(handle, pData, nDataSize, ref pFrameInfo, nMsec);
}
///
/// Get a frame of an image using an internal cache
///
/// Image data and image information
/// Waiting timeout
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetImageBuffer_NET(ref MV_FRAME_OUT pFrame, Int32 nMsec)
{
return MV_CC_GetImageBuffer(handle, ref pFrame, nMsec);
}
///
/// Free image buffer(used with MV_CC_GetImageBuffer)
///
/// Image data and image information
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_FreeImageBuffer_NET(ref MV_FRAME_OUT pFrame)
{
return MV_CC_FreeImageBuffer(handle, ref pFrame);
}
///
/// Get a frame of an image
///
/// Image data receiving buffer
/// Buffer size
/// Image information
/// Waiting timeout
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetOneFrameTimeout_NET(IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO_EX pFrameInfo, Int32 nMsec)
{
return MV_CC_GetOneFrameTimeout(handle, pData, nDataSize, ref pFrameInfo, nMsec);
}
///
/// Clear image Buffers to clear old data
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_ClearImageBuffer_NET()
{
return MV_CC_ClearImageBuffer(handle);
}
///
/// Get the number of valid images in the current image buffer
///
/// The number of valid images in the current image buffer
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetValidImageNum_NET(ref UInt32 pnValidImageNum)
{
return MV_CC_GetValidImageNum(handle, ref pnValidImageNum);
}
///
/// Display one frame image
///
/// Image information
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_DisplayOneFrame_NET(ref MV_DISPLAY_FRAME_INFO pDisplayInfo)
{
return MV_CC_DisplayOneFrame(handle, ref pDisplayInfo);
}
///
/// Display one frame image Ex
///
/// dispaly Handle
/// Image information
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_DisplayOneFrameEx_NET(IntPtr pDisplayHandle, ref MV_DISPLAY_FRAME_INFO_EX pDisplayInfoEx)
{
if (IntPtr.Zero == pDisplayHandle)
{
return MV_E_PARAMETER;
}
return MV_CC_DisplayOneFrameEx(handle, pDisplayHandle, ref pDisplayInfoEx);
}
///
/// Set the number of the internal image cache nodes in SDK(Greater than or equal to 1, to be called before the capture)
///
/// Number of cache nodes
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetImageNodeNum_NET(UInt32 nNum)
{
return MV_CC_SetImageNodeNum(handle, nNum);
}
///
/// Set Grab Strategy
///
/// The value of grab strategy
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetGrabStrategy_NET(MV_GRAB_STRATEGY enGrabStrategy)
{
return MV_CC_SetGrabStrategy(handle, enGrabStrategy);
}
///
/// Set The Size of Output Queue(Only work under the strategy of MV_GrabStrategy_LatestImages,rang:1-ImageNodeNum)
///
/// The Size of Output Queue
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetOutputQueueSize_NET(UInt32 nOutputQueueSize)
{
return MV_CC_SetOutputQueueSize(handle, nOutputQueueSize);
}
///
/// Get device information(Called before start grabbing)
///
/// device information
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetDeviceInfo_NET(ref MV_CC_DEVICE_INFO pstDevInfo)
{
return MV_CC_GetDeviceInfo(handle, ref pstDevInfo);
}
///
/// Get various type of information
///
/// Various type of information
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetAllMatchInfo_NET(ref MV_ALL_MATCH_INFO pstInfo)
{
return MV_CC_GetAllMatchInfo(handle, ref pstInfo);
}
#endregion
#region ch:相机属性万能配置接口&读写寄存器接口 | en: Camera attribute nodes set and obtained universal interface
///
/// Get Integer value
///
/// Key value, for example, using "Width" to get width
/// Value of device features
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetIntValueEx_NET(String strKey, ref MVCC_INTVALUE_EX pstValue)
{
return MV_CC_GetIntValueEx(handle, strKey, ref pstValue);
}
///
/// Set Integer value
///
/// Key value, for example, using "Width" to set width
/// Feature value to set
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetIntValueEx_NET(String strKey, Int64 nValue)
{
return MV_CC_SetIntValueEx(handle, strKey, nValue);
}
///
/// Get Enum value
///
/// Key value, for example, using "PixelFormat" to get pixel format
/// Value of device features
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetEnumValue_NET(String strKey, ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetEnumValue(handle, strKey, ref pstValue);
}
///
/// Set Enum value
///
/// Key value, for example, using "PixelFormat" to set pixel format
/// Feature value to set
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetEnumValue_NET(String strKey, UInt32 nValue)
{
return MV_CC_SetEnumValue(handle, strKey, nValue);
}
///
/// Get the symbolic of the specified value of the Enum type node
///
/// Key value, for example, using "PixelFormat" to set pixel format
/// Symbolic to get
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetEnumEntrySymbolic_NET(String strKey, ref MVCC_ENUMENTRY pstEnumEntry)
{
return MV_CC_GetEnumEntrySymbolic(handle, strKey, ref pstEnumEntry);
}
///
/// Set Enum value
///
/// Key value, for example, using "PixelFormat" to set pixel format
/// Feature String to set
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetEnumValueByString_NET(String strKey, String sValue)
{
return MV_CC_SetEnumValueByString(handle, strKey, sValue);
}
///
/// Get Float value
///
/// Key value
/// Value of device features
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetFloatValue_NET(String strKey, ref MVCC_FLOATVALUE pstValue)
{
return MV_CC_GetFloatValue(handle, strKey, ref pstValue);
}
///
/// Set float value
///
/// Key value
/// Feature value to set
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetFloatValue_NET(String strKey, Single fValue)
{
return MV_CC_SetFloatValue(handle, strKey, fValue);
}
///
/// Get Boolean value
///
/// Key value
/// Value of device features
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetBoolValue_NET(String strKey, ref Boolean pbValue)
{
return MV_CC_GetBoolValue(handle, strKey, ref pbValue);
}
///
/// Set Boolean value
///
/// Key value
/// Feature value to set
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetBoolValue_NET(String strKey, Boolean bValue)
{
return MV_CC_SetBoolValue(handle, strKey, bValue);
}
///
/// Get String value
///
/// Key value
/// Value of device features
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetStringValue_NET(String strKey, ref MVCC_STRINGVALUE pstValue)
{
return MV_CC_GetStringValue(handle, strKey, ref pstValue);
}
///
/// Set String value
///
/// Key value
/// Feature value to set
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetStringValue_NET(String strKey, String strValue)
{
return MV_CC_SetStringValue(handle, strKey, strValue);
}
///
/// Send Command
///
/// Key value
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetCommandValue_NET(String strKey)
{
return MV_CC_SetCommandValue(handle, strKey);
}
///
/// Read Memory
///
/// Used as a return value, save the read-in memory value(Memory value is stored in accordance with the big end model)
/// Memory address to be read, which can be obtained from the Camera.xml file of the device, the form xml node value of xxx_RegAddr
/// Length of the memory to be read
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_ReadMemory_NET(IntPtr pBuffer, Int64 nAddress, Int64 nLength)
{
return MV_CC_ReadMemory(handle, pBuffer, nAddress, nLength);
}
///
/// Write Memory
///
/// Memory value to be written ( Note the memory value to be stored in accordance with the big end model)
/// Memory address to be written, which can be obtained from the Camera.xml file of the device, the form xml node value of xxx_RegAddr
/// Length of the memory to be written
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_WriteMemory_NET(IntPtr pBuffer, Int64 nAddress, Int64 nLength)
{
return MV_CC_WriteMemory(handle, pBuffer, nAddress, nLength);
}
///
/// Invalidate GenICam Nodes
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_InvalidateNodes_NET()
{
return MV_CC_InvalidateNodes(handle);
}
///
/// Get camera feature tree XML
///
/// XML data receiving buffer
/// Buffer size
/// Actual data length
/// Success, return MV_OK. Failure, return error code
public Int32 MV_XML_GetGenICamXML_NET(IntPtr pData, UInt32 nDataSize, ref UInt32 pnDataLen)
{
return MV_XML_GetGenICamXML(handle, pData, nDataSize, ref pnDataLen);
}
///
/// Get Access mode of cur node
///
/// Name of node
/// Access mode of the node
/// Success, return MV_OK. Failure, return error code
public Int32 MV_XML_GetNodeAccessMode_NET(String pstrName, ref MV_XML_AccessMode pAccessMode)
{
return MV_XML_GetNodeAccessMode(handle, pstrName, ref pAccessMode);
}
///
/// Get Interface Type of cur node
///
/// Name of node
/// Interface Type of the node
/// Success, return MV_OK. Failure, return error code
public Int32 MV_XML_GetNodeInterfaceType_NET(String pstrName, ref MV_XML_InterfaceType pInterfaceType)
{
return MV_XML_GetNodeInterfaceType(handle, pstrName, ref pInterfaceType);
}
///
/// Save camera feature
///
/// File name
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_FeatureSave_NET(String pFileName)
{
return MV_CC_FeatureSave(handle, pFileName);
}
///
/// Load camera feature
///
/// File name
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_FeatureLoad_NET(String pFileName)
{
return MV_CC_FeatureLoad(handle, pFileName);
}
///
/// Read the file from the camera
///
/// File access structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_FileAccessRead_NET(ref MV_CC_FILE_ACCESS pstFileAccess)
{
return MV_CC_FileAccessRead(handle, ref pstFileAccess);
}
///
/// Read the file from the camera
///
/// File access structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_FileAccessReadEx_NET(ref MV_CC_FILE_ACCESS_EX pstFileAccessEx)
{
return MV_CC_FileAccessReadEx(handle, ref pstFileAccessEx);
}
///
/// Write the file to camera
///
/// File access structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_FileAccessWrite_NET(ref MV_CC_FILE_ACCESS pstFileAccess)
{
return MV_CC_FileAccessWrite(handle, ref pstFileAccess);
}
///
/// Write the file to camera
///
/// File access structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_FileAccessWriteEx_NET(ref MV_CC_FILE_ACCESS_EX pstFileAccessEx)
{
return MV_CC_FileAccessWriteEx(handle, ref pstFileAccessEx);
}
///
/// Get File Access Progress
///
/// File access Progress
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetFileAccessProgress_NET(ref MV_CC_FILE_ACCESS_PROGRESS pstFileAccessProgress)
{
return MV_CC_GetFileAccessProgress(handle, ref pstFileAccessProgress);
}
#endregion
#region ch: 设备升级 | en: Device upgrade interface
///
/// Device Local Upgrade
///
/// File path and name
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_LocalUpgrade_NET(String pFilePathName)
{
return MV_CC_LocalUpgrade(handle, pFilePathName);
}
///
/// Get Upgrade Progress
///
/// Value of Progress
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_GetUpgradeProcess_NET(ref UInt32 pnProcess)
{
return MV_CC_GetUpgradeProcess(handle, ref pnProcess);
}
#endregion
#region ch: 注册异常回调和事件接口 | en: Enrol abnormal callbacks and event interface
///
/// Register Exception Message CallBack, call after open device
///
/// Exception Message CallBack Function
/// User defined variable
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_RegisterExceptionCallBack_NET(cbExceptiondelegate cbException, IntPtr pUser)
{
return MV_CC_RegisterExceptionCallBack(handle, cbException, pUser);
}
///
/// Register event callback, which is called after the device is opened
///
/// Event CallBack Function
/// User defined variable
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_RegisterAllEventCallBack_NET(cbEventdelegateEx cbEvent, IntPtr pUser)
{
return MV_CC_RegisterAllEventCallBack(handle, cbEvent, pUser);
}
///
/// Register single event callback, which is called after the device is opened
///
/// Event name
/// Event CallBack Function
/// User defined variable
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_RegisterEventCallBackEx_NET(String pEventName, cbEventdelegateEx cbEvent, IntPtr pUser)
{
return MV_CC_RegisterEventCallBackEx(handle, pEventName, cbEvent, pUser);
}
#endregion
#region ch: 仅GigE设备支持的接口 | en: Only support GigE device interface
///
/// Set enumerate device timeout
///
/// time out,default 100ms
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_GIGE_SetEnumDevTimeout_NET(UInt32 nMilTimeout)
{
return MV_GIGE_SetEnumDevTimeout(nMilTimeout);
}
///
/// Force IP
///
/// IP to set
/// Subnet mask
/// Default gateway
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_ForceIpEx_NET(UInt32 nIP, UInt32 nSubNetMask, UInt32 nDefaultGateWay)
{
return MV_GIGE_ForceIpEx(handle, nIP, nSubNetMask, nDefaultGateWay);
}
///
/// IP configuration method
///
/// IP type, refer to MV_IP_CFG_x
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetIpConfig_NET(UInt32 nType)
{
return MV_GIGE_SetIpConfig(handle, nType);
}
///
/// Set to use only one mode,type: MV_NET_TRANS_x. When do not set, priority is to use driver by default
///
/// Net transmission mode, refer to MV_NET_TRANS_x
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetNetTransMode_NET(UInt32 nType)
{
return MV_GIGE_SetNetTransMode(handle, nType);
}
///
/// Get net transmission information
///
/// Transmission information
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_GetNetTransInfo_NET(ref MV_NETTRANS_INFO pstInfo)
{
return MV_GIGE_GetNetTransInfo(handle, ref pstInfo);
}
///
/// Setting the ACK mode of devices Discovery
///
/// ACK mode(Default-Broadcast),0-Unicast,1-Broadcast
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_GIGE_SetDiscoveryMode_NET(UInt32 nMode)
{
return MV_GIGE_SetDiscoveryMode(nMode);
}
///
/// Set GVSP streaming timeout
///
/// Timeout, default 300ms, range: >10ms
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetGvspTimeout_NET(UInt32 nMillisec)
{
return MV_GIGE_SetGvspTimeout(handle, nMillisec);
}
///
/// Get GVSP streaming timeout
///
/// Timeout, ms as unit
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_GetGvspTimeout_NET(ref UInt32 pMillisec)
{
return MV_GIGE_GetGvspTimeout(handle, ref pMillisec);
}
///
/// Set GVCP cammand timeout
///
/// Timeout, ms as unit, range: 0-10000
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetGvcpTimeout_NET(UInt32 nMillisec)
{
return MV_GIGE_SetGvcpTimeout(handle, nMillisec);
}
///
/// Get GVCP cammand timeout
///
/// Timeout, ms as unit
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_GetGvcpTimeout_NET(ref UInt32 pMillisec)
{
return MV_GIGE_GetGvcpTimeout(handle, ref pMillisec);
}
///
/// Set the number of retry GVCP cammand
///
/// The number of retries,rang:0-100
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetRetryGvcpTimes_NET(UInt32 nRetryGvcpTimes)
{
return MV_GIGE_SetRetryGvcpTimes(handle, nRetryGvcpTimes);
}
///
/// Get the number of retry GVCP cammand
///
/// The number of retries
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_GetRetryGvcpTimes_NET(ref UInt32 pRetryGvcpTimes)
{
return MV_GIGE_GetRetryGvcpTimes(handle, ref pRetryGvcpTimes);
}
///
/// Get the optimal Packet Size, Only support GigE Camera
///
/// Optimal packet size
public Int32 MV_CC_GetOptimalPacketSize_NET()
{
return MV_CC_GetOptimalPacketSize(handle);
}
///
/// Set whethe to enable resend, and set resend
///
/// Enable resend
/// Max resend persent
/// Resend timeout
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetResend_NET(UInt32 bEnable, UInt32 nMaxResendPercent, UInt32 nResendTimeout)
{
return MV_GIGE_SetResend(handle, bEnable, nMaxResendPercent, nResendTimeout);
}
///
/// Set the max resend retry times
///
/// The max times to retry resending lost packets,default 20
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetResendMaxRetryTimes_NET(UInt32 nRetryTimes)
{
return MV_GIGE_SetResendMaxRetryTimes(handle, nRetryTimes);
}
///
/// Get the max resend retry times
///
/// the max times to retry resending lost packets
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_GetResendMaxRetryTimes_NET(ref UInt32 pnRetryTimes)
{
return MV_GIGE_GetResendMaxRetryTimes(handle, ref pnRetryTimes);
}
///
/// Set time interval between same resend requests
///
/// The time interval between same resend requests,default 10ms
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetResendTimeInterval_NET(UInt32 nMillisec)
{
return MV_GIGE_SetResendTimeInterval(handle, nMillisec);
}
///
/// Get time interval between same resend requests
///
/// The time interval between same resend requests
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_GetResendTimeInterval_NET(ref UInt32 pnMillisec)
{
return MV_GIGE_GetResendTimeInterval(handle, ref pnMillisec);
}
///
/// Set transmission type,Unicast or Multicast
///
/// Struct of transmission type
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_SetTransmissionType_NET(ref MV_CC_TRANSMISSION_TYPE pstTransmissionType)
{
return MV_GIGE_SetTransmissionType(handle, ref pstTransmissionType);
}
///
/// Issue Action Command
///
/// Action Command info
/// Action Command Result List
/// Success, return MV_OK. Failure, return error code
public Int32 MV_GIGE_IssueActionCommand_NET(ref MV_ACTION_CMD_INFO pstActionCmdInfo, ref MV_ACTION_CMD_RESULT_LIST pstActionCmdResults)
{
return MV_GIGE_IssueActionCommand(ref pstActionCmdInfo, ref pstActionCmdResults);
}
///
/// Get Multicast Status
///
/// Device Information
/// Status of Multicast
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_GIGE_GetMulticastStatus_NET(ref MV_CC_DEVICE_INFO pstDevInfo, ref Boolean pStatus)
{
return MV_GIGE_GetMulticastStatus(ref pstDevInfo, ref pStatus);
}
#endregion
#region ch: 仅CameraLink 设备支持的接口 | en: Only support camlink device interface
///
/// Set device baudrate using one of the CL_BAUDRATE_XXXX value
///
/// Baudrate to set. Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CAML_SetDeviceBauderate_NET(UInt32 nBaudrate)
{
return MV_CAML_SetDeviceBaudrate(handle, nBaudrate);
}
///
/// Get device baudrate, using one of the CL_BAUDRATE_XXXX value
///
/// Return pointer of baud rate to user.
/// Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CAML_GetDeviceBauderate_NET(ref UInt32 pnCurrentBaudrate)
{
return MV_CAML_GetDeviceBaudrate(handle, ref pnCurrentBaudrate);
}
///
/// Get supported baudrates of the combined device and host interface
///
/// Return pointer of the supported baudrates to user. 'OR' operation results of the supported baudrates.
/// Refer to the 'CameraParams.h' for single value definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CAML_GetSupportBauderates_NET(ref UInt32 pnBaudrateAblity)
{
return MV_CAML_GetSupportBaudrates(handle, ref pnBaudrateAblity);
}
///
/// Sets the timeout for operations on the serial port
///
/// Timeout in [ms] for operations on the serial port.
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CAML_SetGenCPTimeOut_NET(UInt32 nMillisec)
{
return MV_CAML_SetGenCPTimeOut(handle, nMillisec);
}
#endregion
#region ch: 仅U3V设备支持的接口 | en: Only support U3V device interface
///
/// Set transfer size of U3V device
///
/// Transfer size,Byte,default:1M,rang:>=0x10000
/// Success, return MV_OK. Failure, return error code
public Int32 MV_USB_SetTransferSize_NET(UInt32 nTransferSize)
{
return MV_USB_SetTransferSize(handle, nTransferSize);
}
///
/// Get transfer size of U3V device
///
/// Transfer size,Byte
/// Success, return MV_OK. Failure, return error code
public Int32 MV_USB_GetTransferSize_NET(ref UInt32 pTransferSize)
{
return MV_USB_GetTransferSize(handle, ref pTransferSize);
}
///
/// Set transfer ways of U3V device
///
/// Transfer ways,rang:1-10
/// Success, return MV_OK. Failure, return error code
public Int32 MV_USB_SetTransferWays_NET(UInt32 nTransferWays)
{
return MV_USB_SetTransferWays(handle, nTransferWays);
}
///
/// Get transfer ways of U3V device
///
/// Transfer ways
/// Success, return MV_OK. Failure, return error code
public Int32 MV_USB_GetTransferWays_NET(ref UInt32 pTransferWays)
{
return MV_USB_GetTransferWays(handle, ref pTransferWays);
}
///
/// Register Stream Exception Message CallBack
///
/// Stream Exception Message CallBack Function
/// User defined variable
/// Success, return MV_OK. Failure, return error code
public Int32 MV_USB_RegisterStreamExceptionCallBack_NET(cbStreamException cbException, IntPtr pUser)
{
return MV_USB_RegisterStreamExceptionCallBack(handle, cbException, pUser);
}
///
/// Set the number of U3V device event cache nodes
///
/// Event Node Number
/// Success, return MV_OK. Failure, return error code
public Int32 MV_USB_SetEventNodeNum_NET(UInt32 nEventNodeNum)
{
return MV_USB_SetEventNodeNum(handle, nEventNodeNum);
}
///
/// Set U3V Camera Synchronisation timeout
///
/// Synchronisation time(ms), default 1000ms
/// Success, return MV_OK. Failure, return error code
public Int32 MV_USB_SetSyncTimeOut_NET(UInt32 nMills)
{
return MV_USB_SetSyncTimeOut(handle, nMills);
}
///
/// Get U3V Camera Synchronisation timeout
///
/// Synchronisation time(ms), default 1000ms
/// Success, return MV_OK. Failure, return error code
public Int32 MV_USB_GetSyncTimeOut_NET(ref UInt32 pnMills)
{
return MV_USB_GetSyncTimeOut(handle, ref pnMills);
}
#endregion
#region ch: GenTL相关接口 | en: GenTL related interface
///
/// Enumerate interfaces by GenTL
///
/// Interface information list
/// Path of GenTL's cti file
///
public static Int32 MV_CC_EnumInterfacesByGenTL_NET(ref MV_GENTL_IF_INFO_LIST stIFInfoList, String pGenTLPath)
{
return MV_CC_EnumInterfacesByGenTL(ref stIFInfoList, pGenTLPath);
}
///
/// Unload cti library
///
/// GenTL cti file path
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_CC_UnloadGenTLLibrary_NET(String strGenTLPath)
{
return MV_CC_UnloadGenTLLibrary(strGenTLPath);
}
///
/// Enumerate Device Based On GenTL
///
/// Interface information
/// Device List
/// Success, return MV_OK. Failure, return error code
public static Int32 MV_CC_EnumDevicesByGenTL_NET(ref MV_GENTL_IF_INFO stIFInfo, ref MV_GENTL_DEV_INFO_LIST stDevList)
{
return MV_CC_EnumDevicesByGenTL(ref stIFInfo, ref stDevList);
}
///
/// Create Device Handle Based On GenTL Device Info
///
/// Device Information Structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_CreateDeviceByGenTL_NET(ref MV_GENTL_DEV_INFO stDevInfo)
{
if (IntPtr.Zero != handle)
{
MV_CC_DestroyHandle(handle);
handle = IntPtr.Zero;
}
return MV_CC_CreateHandleByGenTL(ref handle, ref stDevInfo);
}
#endregion
#region ch: 图像保存、格式转换等相关接口 | en: Related image save and format convert interface
///
/// Save image, support Bmp and Jpeg.
///
/// Save image parameters structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SaveImageEx3_NET(ref MV_SAVE_IMAGE_PARAM_EX3 stSaveParam)
{
return MV_CC_SaveImageEx3(handle, ref stSaveParam);
}
///
/// Save the image file, support Bmp、 Jpeg、Png and Tiff. Encoding quality(50-99]
///
/// Save the image file parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SaveImageToFileEx_NET(ref MV_SAVE_IMG_TO_FILE_PARAM_EX pstSaveFileParam)
{
return MV_CC_SaveImageToFileEx(handle, ref pstSaveFileParam);
}
///
/// Save 3D point data, support PLY、CSV and OBJ
///
/// Save 3D point data parameters structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SavePointCloudData_NET(ref MV_SAVE_POINT_CLOUD_PARAM pstPointDataParam)
{
return MV_CC_SavePointCloudData(handle, ref pstPointDataParam);
}
///
/// Rotate Image
///
/// Rotate image parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_RotateImage_NET(ref MV_CC_ROTATE_IMAGE_PARAM pstRotateParam)
{
return MV_CC_RotateImage(handle, ref pstRotateParam);
}
///
/// Flip Image
///
/// Flip image parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_FlipImage_NET(ref MV_CC_FLIP_IMAGE_PARAM pstFlipParam)
{
return MV_CC_FlipImage(handle, ref pstFlipParam);
}
///
/// Pixel format conversion
///
/// Convert Pixel Type parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_ConvertPixelTypeEx_NET(ref MV_CC_PIXEL_CONVERT_PARAM_EX pstCvtParam)
{
return MV_CC_ConvertPixelTypeEx(handle, ref pstCvtParam);
}
///
/// Interpolation algorithm type setting
///
/// Bayer interpolation method 0-Fast 1-Equilibrium 2-Optimal
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetBayerCvtQuality_NET(UInt32 BayerCvtQuality)
{
return MV_CC_SetBayerCvtQuality(handle, BayerCvtQuality);
}
///
/// Filter type of the bell interpolation quality algorithm setting
///
/// Filter type enable
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetBayerFilterEnable_NET(Boolean bFilterEnable)
{
return MV_CC_SetBayerFilterEnable(handle, bFilterEnable);
}
///
/// Set Bayer Gamma value
///
/// Gamma value[0.1,4.0]
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetBayerGammaValue_NET(Single fBayerGammaValue)
{
return MV_CC_SetBayerGammaValue(handle, fBayerGammaValue);
}
///
/// Set Mono8/Bayer Gamma value
///
/// PixelType
/// Gamma value[0.1,4.0]
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetGammaValue_NET(MvGvspPixelType enPixelType, Single fGammaValue)
{
return MV_CC_SetGammaValue(handle, enPixelType, fGammaValue);
}
///
/// Set Gamma param
///
/// Gamma parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetBayerGammaParam_NET(ref MV_CC_GAMMA_PARAM pstGammaParam)
{
return MV_CC_SetBayerGammaParam(handle, ref pstGammaParam);
}
///
/// Set CCM param
///
/// CCM parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetBayerCCMParam_NET(ref MV_CC_CCM_PARAM pstCCMParam)
{
return MV_CC_SetBayerCCMParam(handle, ref pstCCMParam);
}
///
/// Set CCM param
///
/// CCM parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetBayerCCMParamEx_NET(ref MV_CC_CCM_PARAM_EX pstCCMParam)
{
return MV_CC_SetBayerCCMParamEx(handle, ref pstCCMParam);
}
///
/// Adjust image contrast
///
/// Contrast parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_ImageContrast_NET(ref MV_CC_CONTRAST_PARAM pstContrastParam)
{
return MV_CC_ImageContrast(handle, ref pstContrastParam);
}
///
/// High Bandwidth Decode
///
/// High Bandwidth Decode parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_HB_Decode_NET(ref MV_CC_HB_DECODE_PARAM pstDecodeParam)
{
return MV_CC_HB_Decode(handle, ref pstDecodeParam);
}
///
/// Draw Rect Auxiliary Line
///
/// Rect Auxiliary Line Info
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_DrawRect_NET(ref MVCC_RECT_INFO pstRectInfo)
{
return MV_CC_DrawRect(handle, ref pstRectInfo);
}
///
/// Draw Circle Auxiliary Line
///
/// Circle Auxiliary Line Info
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_DrawCircle_NET(ref MVCC_CIRCLE_INFO pstCircleInfo)
{
return MV_CC_DrawCircle(handle, ref pstCircleInfo);
}
///
/// Draw Line Auxiliary Line
///
/// Linear Auxiliary Line Info
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_DrawLines_NET(ref MVCC_LINES_INFO pstLinesInfo)
{
return MV_CC_DrawLines(handle, ref pstLinesInfo);
}
///
/// Start Record
///
/// Record param structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_StartRecord_NET(ref MV_CC_RECORD_PARAM pstRecordParam)
{
return MV_CC_StartRecord(handle, ref pstRecordParam);
}
///
/// Input RAW data to Record
///
/// Record data structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_InputOneFrame_NET(ref MV_CC_INPUT_FRAME_INFO pstInputFrameInfo)
{
return MV_CC_InputOneFrame(handle, ref pstInputFrameInfo);
}
///
/// Stop Record
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_StopRecord_NET()
{
return MV_CC_StopRecord(handle);
}
///
/// Open the GUI interface for getting or setting camera parameters
///
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_OpenParamsGUI_NET()
{
return MV_CC_OpenParamsGUI(handle);
}
///
/// Reconstruct Image(For time-division exposure function)
///
/// Reconstruct image parameters
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_ReconstructImage_NET(ref MV_RECONSTRUCT_IMAGE_PARAM pstReconstructParam)
{
return MV_CC_ReconstructImage(handle, ref pstReconstructParam);
}
#endregion
#region ch: 内部使用的公共功能接口 | en: Inner Interface
///
/// Byte array to struct
///
/// Byte array
/// Struct type
/// Struct object
public static object ByteToStruct(Byte[] bytes, Type type)
{
int size = Marshal.SizeOf(type);
if (size > bytes.Length)
{
return null;
}
// 分配结构体内存空间
IntPtr structPtr = Marshal.AllocHGlobal(size);
// 将byte数组拷贝到分配好的内存空间
Marshal.Copy(bytes, 0, structPtr, size);
// 将内存空间转换为目标结构体
object obj = Marshal.PtrToStructure(structPtr, type);
// 释放内存空间
Marshal.FreeHGlobal(structPtr);
return obj;
}
///
/// 判断字符数组是否为utf-8
///
/// 字符数组
///
public static bool IsTextUTF8(byte[] inputStream)
{
int encodingBytesCount = 0;
bool allTextsAreASCIIChars = true;
for (int i = 0; i < inputStream.Length; i++)
{
byte current = inputStream[i];
if ((current & 0x80) == 0x80)
{
allTextsAreASCIIChars = false;
}
// First byte
if (encodingBytesCount == 0)
{
if ((current & 0x80) == 0)
{
// ASCII chars, from 0x00-0x7F
continue;
}
if ((current & 0xC0) == 0xC0)
{
encodingBytesCount = 1;
current <<= 2;
// More than two bytes used to encoding a unicode char.
// Calculate the real length.
while ((current & 0x80) == 0x80)
{
current <<= 1;
encodingBytesCount++;
}
}
else
{
// Invalid bits structure for UTF8 encoding rule.
return false;
}
}
else
{
// Following bytes, must start with 10.
if ((current & 0xC0) == 0x80)
{
encodingBytesCount--;
}
else
{
// Invalid bits structure for UTF8 encoding rule.
return false;
}
}
}
if (encodingBytesCount != 0)
{
// Invalid bits structure for UTF8 encoding rule.
// Wrong following bytes count.
return false;
}
// Although UTF8 supports encoding for ASCII chars, we regard as a input stream, whose contents are all ASCII as default encoding.
return !allTextsAreASCIIChars;
}
///
/// Write Error Message
///
/// Message
/// ErrorNum
public static void WriteErrorMsg(string csMessage, int nErrorNum)
{
string errorMsg;
if (nErrorNum == 0)
{
errorMsg = csMessage;
}
else
{
errorMsg = csMessage + ": Error =" + String.Format("{0:X}", nErrorNum);
}
//TextWriterTraceListener TraceListener = new System.Diagnostics.TextWriterTraceListener(@"debug.txt");
//Debug.Listeners.Add(TraceListener);
//Debug.WriteLine(System.DateTime.Now.ToString());
//Debug.WriteLine(errorMsg);
//TraceListener.Flush();
Debug.WriteLine(errorMsg);
}
#endregion
#region ch: 弃用的接口 | en: Abandoned interface
///
/// Save image, support Bmp and Jpeg.
///
/// Save image parameters structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SaveImageEx2_NET(ref MV_SAVE_IMAGE_PARAM_EX2 stSaveParam)
{
return MV_CC_SaveImageEx2(handle, ref stSaveParam);
}
///
/// Save the image file, support Bmp、 Jpeg、Png and Tiff. Encoding quality(50-99]
///
/// Save the image file parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SaveImageToFile_NET(ref MV_SAVE_IMG_TO_FILE_PARAM pstSaveFileParam)
{
return MV_CC_SaveImageToFile(handle, ref pstSaveFileParam);
}
///
/// Pixel format conversion
///
/// Convert Pixel Type parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_ConvertPixelType_NET(ref MV_PIXEL_CONVERT_PARAM pstCvtParam)
{
return MV_CC_ConvertPixelType(handle, ref pstCvtParam);
}
///
/// Get basic information of image (Interfaces not recommended)
///
///
///
public Int32 MV_CC_GetImageInfo_NET(ref MV_IMAGE_BASIC_INFO pstInfo)
{
return MV_CC_GetImageInfo(handle, ref pstInfo);
}
///
/// Get GenICam proxy (Interfaces not recommended)
///
///
public IntPtr MV_CC_GetTlProxy_NET()
{
return MV_CC_GetTlProxy(handle);
}
///
/// Get root node (Interfaces not recommended)
///
///
///
public Int32 MV_XML_GetRootNode_NET(ref MV_XML_NODE_FEATURE pstNode)
{
return MV_XML_GetRootNode(handle, ref pstNode);
}
///
/// Get all children node of specific node from xml, root node is Root (Interfaces not recommended)
///
///
///
///
public Int32 MV_XML_GetChildren_NET(ref MV_XML_NODE_FEATURE pstNode, IntPtr pstNodesList)
{
return MV_XML_GetChildren(handle, ref pstNode, pstNodesList);
}
///
/// Get all children node of specific node from xml, root node is Root (Interfaces not recommended)
///
///
///
///
public Int32 MV_XML_GetChildren_NET(ref MV_XML_NODE_FEATURE pstNode, ref MV_XML_NODES_LIST pstNodesList)
{
return MV_XML_GetChildren(handle, ref pstNode, ref pstNodesList);
}
///
/// Get current node feature (Interfaces not recommended)
///
///
///
///
public Int32 MV_XML_GetNodeFeature_NET(ref MV_XML_NODE_FEATURE pstNode, IntPtr pstFeature)
{
return MV_XML_GetNodeFeature(handle, ref pstNode, pstFeature);
}
///
/// Update node (Interfaces not recommended)
///
///
///
///
public Int32 MV_XML_UpdateNodeFeature_NET(MV_XML_InterfaceType enType, IntPtr pstFeature)
{
return MV_XML_UpdateNodeFeature(handle, enType, pstFeature);
}
///
/// Register update callback (Interfaces not recommended)
///
///
///
///
public Int32 MV_XML_RegisterUpdateCallBack_NET(cbXmlUpdatedelegate cbXmlUpdate, IntPtr pUser)
{
return MV_XML_RegisterUpdateCallBack(handle, cbXmlUpdate, pUser);
}
///
/// Noise estimate of Bayer format
///
/// Noise estimate parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_BayerNoiseEstimate_NET(ref MV_CC_BAYER_NOISE_ESTIMATE_PARAM pstNoiseEstimateParam)
{
return MV_CC_BayerNoiseEstimate(handle, ref pstNoiseEstimateParam);
}
///
/// Spatial Denoise of Bayer format
///
/// Spatial Denoise parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_BayerSpatialDenoise_NET(ref MV_CC_BAYER_SPATIAL_DENOISE_PARAM pstSpatialDenoiseParam)
{
return MV_CC_BayerSpatialDenoise(handle, ref pstSpatialDenoiseParam);
}
///
/// This interface is abandoned, it is recommended to use the MV_CC_DisplayOneFrame
///
///
///
public Int32 MV_CC_Display_NET(IntPtr hWnd)
{
return MV_CC_Display(handle, hWnd);
}
///
/// This interface is abandoned, it is recommended to use the MV_CC_GetOneFrameTimeOut
///
///
///
///
///
public Int32 MV_CC_GetOneFrame_NET(IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO pFrameInfo)
{
return MV_CC_GetOneFrame(handle, pData, nDataSize, ref pFrameInfo);
}
///
/// This interface is abandoned, it is recommended to use the MV_CC_GetOneFrameTimeOut
///
///
///
///
///
public Int32 MV_CC_GetOneFrameEx_NET(IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO_EX pFrameInfo)
{
return MV_CC_GetOneFrameEx(handle, pData, nDataSize, ref pFrameInfo);
}
///
/// This interface is abandoned, it is recommended to use the MV_CC_SaveImageEx
///
///
///
public Int32 MV_CC_SaveImage_NET(ref MV_SAVE_IMAGE_PARAM stSaveParam)
{
return MV_CC_SaveImage(ref stSaveParam);
}
///
/// This interface is abandoned, it is recommended to use the MV_GIGE_ForceIpEx
///
///
///
public Int32 MV_GIGE_ForceIp_NET(UInt32 nIP)
{
return MV_GIGE_ForceIp(handle, nIP);
}
///
/// This interface is abandoned, it is recommended to use the MV_CC_RegisterEventCallBackEx
///
///
///
///
public Int32 MV_CC_RegisterEventCallBack_NET(cbEventdelegate cbEvent, IntPtr pUser)
{
return MV_CC_RegisterEventCallBack(handle, cbEvent, pUser);
}
///
/// This interface is abandoned, it is recommended to use the MV_CC_GetIntValueEx
///
///
///
///
public Int32 MV_CC_GetIntValue_NET(String strKey, ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetIntValue(handle, strKey, ref pstValue);
}
///
/// This interface is abandoned, it is recommended to use the MV_CC_SetIntValueEx
///
///
///
///
public Int32 MV_CC_SetIntValue_NET(String strKey, UInt32 nValue)
{
return MV_CC_SetIntValue(handle, strKey, nValue);
}
///
/// Set CLUT param
///
/// CLUT parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SetBayerCLUTParam_NET(ref MV_CC_CLUT_PARAM pstCLUTParam)
{
return MV_CC_SetBayerCLUTParam(handle, ref pstCLUTParam);
}
///
/// Image sharpen
///
/// Sharpen parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_ImageSharpen_NET(ref MV_CC_SHARPEN_PARAM pstSharpenParam)
{
return MV_CC_ImageSharpen(handle, ref pstSharpenParam);
}
///
/// Color Correct(include CCM and CLUT)
///
/// Color Correct parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_ColorCorrect_NET(ref MV_CC_COLOR_CORRECT_PARAM pstColorCorrectParam)
{
return MV_CC_ColorCorrect(handle, ref pstColorCorrectParam);
}
///
/// Noise Estimate
///
/// Noise Estimate parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_NoiseEstimate_NET(ref MV_CC_NOISE_ESTIMATE_PARAM pstNoiseEstimateParam)
{
return MV_CC_NoiseEstimate(handle, ref pstNoiseEstimateParam);
}
///
/// Spatial Denoise
///
/// Spatial Denoise parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_SpatialDenoise_NET(ref MV_CC_SPATIAL_DENOISE_PARAM pstSpatialDenoiseParam)
{
return MV_CC_SpatialDenoise(handle, ref pstSpatialDenoiseParam);
}
///
/// LSC Calib
///
/// LSC Calib parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_LSCCalib_NET(ref MV_CC_LSC_CALIB_PARAM pstLSCCalibParam)
{
return MV_CC_LSCCalib(handle, ref pstLSCCalibParam);
}
///
/// LSC Correct
///
/// LSC Correct parameter structure
/// Success, return MV_OK. Failure, return error code
public Int32 MV_CC_LSCCorrect_NET(ref MV_CC_LSC_CORRECT_PARAM pstLSCCorrectParam)
{
return MV_CC_LSCCorrect(handle, ref pstLSCCorrectParam);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetWidth_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetWidth(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetWidth_NET(UInt32 nValue)
{
return MV_CC_SetWidth(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetHeight_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetHeight(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetHeight_NET(UInt32 nValue)
{
return MV_CC_SetHeight(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetAOIoffsetX_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetAOIoffsetX(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetAOIoffsetX_NET(UInt32 nValue)
{
return MV_CC_SetAOIoffsetX(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetAOIoffsetY_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetAOIoffsetY(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetAOIoffsetY_NET(UInt32 nValue)
{
return MV_CC_SetAOIoffsetY(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetAutoExposureTimeLower_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetAutoExposureTimeLower(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetAutoExposureTimeLower_NET(UInt32 nValue)
{
return MV_CC_SetAutoExposureTimeLower(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetAutoExposureTimeUpper_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetAutoExposureTimeUpper(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetAutoExposureTimeUpper_NET(UInt32 nValue)
{
return MV_CC_SetAutoExposureTimeUpper(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetBrightness_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetBrightness(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetBrightness_NET(UInt32 nValue)
{
return MV_CC_SetBrightness(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetFrameRate_NET(ref MVCC_FLOATVALUE pstValue)
{
return MV_CC_GetFrameRate(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetFrameRate_NET(Single fValue)
{
return MV_CC_SetFrameRate(handle, fValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetGain_NET(ref MVCC_FLOATVALUE pstValue)
{
return MV_CC_GetGain(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetGain_NET(Single fValue)
{
return MV_CC_SetGain(handle, fValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetExposureTime_NET(ref MVCC_FLOATVALUE pstValue)
{
return MV_CC_GetExposureTime(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetExposureTime_NET(Single fValue)
{
return MV_CC_SetExposureTime(handle, fValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetPixelFormat_NET(ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetPixelFormat(handle, ref pstValue);
}
///
/// Set PixelFormat
///
/// PixelFormat
///
public Int32 MV_CC_SetPixelFormat_NET(UInt32 nValue)
{
return MV_CC_SetPixelFormat(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetAcquisitionMode_NET(ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetAcquisitionMode(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetAcquisitionMode_NET(UInt32 nValue)
{
return MV_CC_SetAcquisitionMode(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetGainMode_NET(ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetGainMode(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetGainMode_NET(UInt32 nValue)
{
return MV_CC_SetGainMode(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetExposureAutoMode_NET(ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetExposureAutoMode(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetExposureAutoMode_NET(UInt32 nValue)
{
return MV_CC_SetExposureAutoMode(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetTriggerMode_NET(ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetTriggerMode(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetTriggerMode_NET(UInt32 nValue)
{
return MV_CC_SetTriggerMode(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetTriggerDelay_NET(ref MVCC_FLOATVALUE pstValue)
{
return MV_CC_GetTriggerDelay(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetTriggerDelay_NET(Single fValue)
{
return MV_CC_SetTriggerDelay(handle, fValue);
}
///
/// Get Trigger Source
///
/// Trigger Source
///
public Int32 MV_CC_GetTriggerSource_NET(ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetTriggerSource(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetTriggerSource_NET(UInt32 nValue)
{
return MV_CC_SetTriggerSource(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
public Int32 MV_CC_TriggerSoftwareExecute_NET()
{
return MV_CC_TriggerSoftwareExecute(handle);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetGammaSelector_NET(ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetGammaSelector(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetGammaSelector_NET(UInt32 nValue)
{
return MV_CC_SetGammaSelector(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetGamma_NET(ref MVCC_FLOATVALUE pstValue)
{
return MV_CC_GetGamma(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetGamma_NET(Single fValue)
{
return MV_CC_SetGamma(handle, fValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetSharpness_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetSharpness(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetSharpness_NET(UInt32 nValue)
{
return MV_CC_SetSharpness(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetHue_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetHue(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetHue_NET(UInt32 nValue)
{
return MV_CC_SetHue(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetSaturation_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetSaturation(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetSaturation_NET(UInt32 nValue)
{
return MV_CC_SetSaturation(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetBalanceWhiteAuto_NET(ref MVCC_ENUMVALUE pstValue)
{
return MV_CC_GetBalanceWhiteAuto(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetBalanceWhiteAuto_NET(UInt32 nValue)
{
return MV_CC_SetBalanceWhiteAuto(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetBalanceRatioRed_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetBalanceRatioRed(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetBalanceRatioRed_NET(UInt32 nValue)
{
return MV_CC_SetBalanceRatioRed(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetBalanceRatioGreen_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetBalanceRatioGreen(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetBalanceRatioGreen_NET(UInt32 nValue)
{
return MV_CC_SetBalanceRatioGreen(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetBalanceRatioBlue_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetBalanceRatioBlue(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetBalanceRatioBlue_NET(UInt32 nValue)
{
return MV_CC_SetBalanceRatioBlue(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetDeviceUserID_NET(ref MVCC_STRINGVALUE pstValue)
{
return MV_CC_GetDeviceUserID(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetDeviceUserID_NET(string chValue)
{
return MV_CC_SetDeviceUserID(handle, chValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetBurstFrameCount_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetBurstFrameCount(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetBurstFrameCount_NET(UInt32 nValue)
{
return MV_CC_SetBurstFrameCount(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetAcquisitionLineRate_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetAcquisitionLineRate(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetAcquisitionLineRate_NET(UInt32 nValue)
{
return MV_CC_SetAcquisitionLineRate(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_GetHeartBeatTimeout_NET(ref MVCC_INTVALUE pstValue)
{
return MV_CC_GetHeartBeatTimeout(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_CC_SetHeartBeatTimeout_NET(UInt32 nValue)
{
return MV_CC_SetHeartBeatTimeout(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_GIGE_GetGevSCPSPacketSize_NET(ref MVCC_INTVALUE pstValue)
{
return MV_GIGE_GetGevSCPSPacketSize(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_GIGE_SetGevSCPSPacketSize_NET(UInt32 nValue)
{
return MV_GIGE_SetGevSCPSPacketSize(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_GIGE_GetGevSCPD_NET(ref MVCC_INTVALUE pstValue)
{
return MV_GIGE_GetGevSCPD(handle, ref pstValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_GIGE_SetGevSCPD_NET(UInt32 nValue)
{
return MV_GIGE_SetGevSCPD(handle, nValue);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_GIGE_GetGevSCDA_NET(ref UInt32 pnIP)
{
return MV_GIGE_GetGevSCDA(handle, ref pnIP);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_GIGE_SetGevSCDA_NET(UInt32 nIP)
{
return MV_GIGE_SetGevSCDA(handle, nIP);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_GIGE_GetGevSCSP_NET(ref UInt32 pnPort)
{
return MV_GIGE_GetGevSCSP(handle, ref pnPort);
}
///
/// This interface is replaced by general interface
///
///
///
public Int32 MV_GIGE_SetGevSCSP_NET(UInt32 nPort)
{
return MV_GIGE_SetGevSCSP(handle, nPort);
}
///
/// This interface is abandoned, it is recommended to use the MV_CC_RegisterImageCallBackEx
///
///
///
///
public Int32 MV_CC_RegisterImageCallBack_NET(cbOutputdelegate cbOutput, IntPtr pUser)
{
return MV_CC_RegisterImageCallBack(handle, cbOutput, pUser);
}
#endregion
#region ch: 参数定义 | en: Paramera Define
#region ch采集卡类型 |en Interface type
/// ch GigE Vision采集卡 |en GigE Vision interface
public const Int32 MV_GIGE_INTERFACE = unchecked((Int32)0x00000001);
/// ch Camera Link采集卡 |en Camera Link interface
public const Int32 MV_CAMERALINK_INTERFACE = unchecked((Int32)0x00000004);
/// ch CoaXPress采集卡 |en CoaXPress interface
public const Int32 MV_CXP_INTERFACE = unchecked((Int32)0x00000008);
/// ch XoFLink采集卡 |en XoFLink interface
public const Int32 MV_XOF_INTERFACE = unchecked((Int32)0x00000010);
#endregion
#region 设备类型定义
/// Unknown Device Type, Reserved
public const Int32 MV_UNKNOW_DEVICE = unchecked((Int32)0x00000000);
/// GigE Device
public const Int32 MV_GIGE_DEVICE = unchecked((Int32)0x00000001);
/// 1394-a/b Device
public const Int32 MV_1394_DEVICE = unchecked((Int32)0x00000002);
/// USB3.0 Device
public const Int32 MV_USB_DEVICE = unchecked((Int32)0x00000004);
/// CameraLink Device
public const Int32 MV_CAMERALINK_DEVICE = unchecked((Int32)0x00000008);
/// Virtual GigE Device
public const Int32 MV_VIR_GIGE_DEVICE = unchecked((Int32)0x00000010);
/// Virtual USB Device
public const Int32 MV_VIR_USB_DEVICE = unchecked((Int32)0x00000020);
/// GenTL GigE Device
public const Int32 MV_GENTL_GIGE_DEVICE = unchecked((Int32)0x00000040);
/// GenTL CML Device
public const Int32 MV_GENTL_CAMERALINK_DEVICE = unchecked((Int32)0x00000080);
/// GenTL CXP Device
public const Int32 MV_GENTL_CXP_DEVICE = unchecked((Int32)0x00000100);
/// GenTL XOF Device
public const Int32 MV_GENTL_XOF_DEVICE = unchecked((Int32)0x00000200);
///
/// ch:信息结构体的最大缓存 | en: Max buffer size of information structs
///
public const Int32 INFO_MAX_BUFFER_SIZE = 64;
///
/// 最大的相机数量
///
public const Int32 MV_MAX_DEVICE_NUM = 256;
///
/// ch:最大Interface数量 | en:Max num of interfaces
///
public const Int32 MV_MAX_GENTL_IF_NUM = 256;
///
/// ch:最大GenTL设备数量 | en:Max num of GenTL devices
///
public const Int32 MV_MAX_GENTL_DEV_NUM = 256;
///
/// XML节点描述最大长度
///
public const Int32 MV_MAX_XML_DISC_STRLEN_C = 512;
///
/// XML节点最大长度
///
public const Int32 MV_MAX_XML_NODE_STRLEN_C = 64;
///
/// XML节点最大数量
///
public const Int32 MV_MAX_XML_NODE_NUM_C = 128;
///
/// XML节点显示名最大数量
///
public const Int32 MV_MAX_XML_SYMBOLIC_NUM = 64;
///
/// string类型节点值的最大长度
///
public const Int32 MV_MAX_XML_STRVALUE_STRLEN_C = 64;
///
/// 最大父节点数
///
public const Int32 MV_MAX_XML_PARENTS_NUM = 8;
///
/// 最大节点描述长度
///
public const Int32 MV_MAX_XML_SYMBOLIC_STRLEN_C = 64;
// 异常消息类型
///
/// 设备断开连接
///
public const Int32 MV_EXCEPTION_DEV_DISCONNECT = 0x00008001;
///
/// SDK与驱动版本不匹配
///
public const Int32 MV_EXCEPTION_VERSION_CHECK = 0x00008002;
//Event事件回调信息
///
/// 相机Event事件名称最大长度
///
public const Int32 MAX_EVENT_NAME_SIZE = 128;
/// 最大枚举条目对应的符号长度
public const Int32 MV_MAX_SYMBOLIC_LEN = 64;
/// 分时曝光时最多将源图像拆分的个数
public const Int32 MV_MAX_SPLIT_NUM = 8;
///
/// ch:最大支持的采集卡数量 | en:The maximum number of Frame Grabber interface supported
///
public const Int32 MV_MAX_INTERFACE_NUM = 64;
// ch GigEVision IP配置 |en GigEVision IP Configuration
///
/// ch 静态 |en Static
///
public const Int32 MV_IP_CFG_STATIC = 0x05000000;
///
/// ch DHCP |en DHCP
///
public const Int32 MV_IP_CFG_DHCP = 0x06000000;
///
/// ch LLA |en LLA
///
public const Int32 MV_IP_CFG_LLA = 0x04000000;
// ch CameraLink波特率 |en CameraLink Baud Rates (CLUINT32)
///
/// 9600
///
public const Int32 MV_CAML_BAUDRATE_9600 = 0x00000001;
///
/// 19200
///
public const Int32 MV_CAML_BAUDRATE_19200 = 0x00000002;
///
/// 38400
///
public const Int32 MV_CAML_BAUDRATE_38400 = 0x00000004;
///
/// 57600
///
public const Int32 MV_CAML_BAUDRATE_57600 = 0x00000008;
///
/// 115200
///
public const Int32 MV_CAML_BAUDRATE_115200 = 0x00000010;
///
/// 230400
///
public const Int32 MV_CAML_BAUDRATE_230400 = 0x00000020;
///
/// 460800
///
public const Int32 MV_CAML_BAUDRATE_460800 = 0x00000040;
///
/// 921600
///
public const Int32 MV_CAML_BAUDRATE_921600 = 0x00000080;
///
/// ch 最大值 |en Auto Max
///
public const Int32 MV_CAML_BAUDRATE_AUTOMAX = 0x40000000;
// chinese 信息类型 |en Information Type
///
/// ch 网络流量和丢包信息 |en Network traffic and packet loss information
///
public const Int32 MV_MATCH_TYPE_NET_DETECT = 0x00000001;
///
/// ch host接收到来自U3V设备的字节总数 |en The total number of bytes host received from U3V device
///
public const Int32 MV_MATCH_TYPE_USB_DETECT = 0x00000002;
// 设备的访问模式
///
/// ch独占权限,其他APP只允许读CCP寄存器 |en Exclusive authority, other APP is only allowed to read the CCP register
///
public const Int32 MV_ACCESS_Exclusive = 1;
///
/// ch 可以从5模式下抢占权限,然后以独占权限打开 |en You can seize the authority from the 5 mode, and then open with exclusive authority
///
public const Int32 MV_ACCESS_ExclusiveWithSwitch = 2;
///
/// ch 控制权限,其他APP允许读所有寄存器 |en Control authority, allows other APP reading all registers
///
public const Int32 MV_ACCESS_Control = 3;
///
/// ch 可以从5的模式下抢占权限,然后以控制权限打开 |en You can seize the authority from the 5 mode, and then open with control authority
///
public const Int32 MV_ACCESS_ControlWithSwitch = 4;
///
/// ch 以可被抢占的控制权限打开 |en Open with seized control authority
///
public const Int32 MV_ACCESS_ControlSwitchEnable = 5;
///
/// ch 可以从5的模式下抢占权限,然后以可被抢占的控制权限打开 |en You can seize the authority from the 5 mode, and then open with seized control authority
///
public const Int32 MV_ACCESS_ControlSwitchEnableWithKey = 6;
///
/// ch 读模式打开设备,适用于控制权限下 |en Open with read mode and is available under control authority
///
public const Int32 MV_ACCESS_Monitor = 7;
#endregion
#region 相机参数结构体定义
///
/// ch:采集卡信息列表 | en: Interface Information List
///
public struct MV_INTERFACE_INFO_LIST
{
///
/// ch:在线设备数量 | en:Online Interface Number
///
public UInt32 nInterfaceNum;
///
/// ch:支持最多64个设备 | en:Support up to 64 Interfaces
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_INTERFACE_NUM)]
public IntPtr[] pInterfaceInfo;
};
///
/// ch:采集卡信息 | en: Interface information
///
public struct MV_INTERFACE_INFO
{
///
/// ch: 采集卡类型; 低16位有效: bits(0~2)代表功能, bits(3~7)代表相机, bits(8-15)代表总线| en: Interface type
///
public UInt32 nTLayerType;
///
/// ch: 采集卡的PCIE插槽信息 | en: PCIe slot information of interface
///
public UInt32 nPCIEInfo;
///
/// ch: 采集卡ID | en: Interface ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chInterfaceID;
///
/// ch 显示名称 | en: Display name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chDisplayName;
///
/// ch 序列号 |en: Serial number
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chSerialNumber;
///
/// ch 型号 | en: model name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chModelName;
///
/// ch: 厂商 |en: manufacturer name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chManufacturer;
///
/// ch: 版本号| en: device version
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chDeviceVersion;
///
/// ch: 自定义名称 |en: user defined name
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = INFO_MAX_BUFFER_SIZE)]
public Byte[] chUserDefinedName;
///
/// ch 保留字段 | en Reserved
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public UInt32[] nReserved;
};
///
/// 排序方式
///
public enum MV_SORT_METHOD
{
///
/// 按序列号排序
///
SORTMETHOD_SERIALNUMBER = 0,
///
/// 按用户自定义名字排序
///
SORTMETHOD_USERID = 1,
///
/// 按当前IP地址排序(升序)
///
SORTMETHOD_CURRENTIP_ASC = 2,
///
/// 按当前IP地址排序(降序)
///
SORTMETHOD_CURRENTIP_DESC = 3,
};
///
/// ch: GigE设备信息 | en: GigE device information
///
public struct MV_GIGE_DEVICE_INFO
{
///
/// IP 配置选项
///
public UInt32 nIpCfgOption;
///
/// IP configuration:bit31-static bit30-dhcp bit29-lla
///
public UInt32 nIpCfgCurrent;
///
/// curtent ip
///
public UInt32 nCurrentIp;
///
/// curtent subnet mask
///
public UInt32 nCurrentSubNetMask;
///
/// current gateway
///
public UInt32 nDefultGateWay;
///
/// 制造商名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public String chManufacturerName;
///
/// 型号名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public String chModelName;
///
/// 设备版本信息
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public String chDeviceVersion;
///
/// 制造商特殊信息
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)]
public String chManufacturerSpecificInfo;
///
/// 序列号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public String chSerialNumber;
///
/// 用户自定义名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public String chUserDefinedName;
///
/// 网口IP地址
///
public UInt32 nNetExport;
///
/// 预留
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
};
///
/// ch: GigE设备信息 | en: GigE device information
///
public struct MV_GIGE_DEVICE_INFO_EX
{
///
/// IP 配置选项
///
public UInt32 nIpCfgOption;
///
/// IP configuration:bit31-static bit30-dhcp bit29-lla
///
public UInt32 nIpCfgCurrent;
///
/// curtent ip
///
public UInt32 nCurrentIp;
///
/// curtent subnet mask
///
public UInt32 nCurrentSubNetMask;
///
/// current gateway
///
public UInt32 nDefultGateWay;
///
/// 制造商名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public String chManufacturerName;
///
/// 型号名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public String chModelName;
///
/// 设备版本信息
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public String chDeviceVersion;
///
/// 制造商特殊信息
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)]
public String chManufacturerSpecificInfo;
///
/// 序列号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public String chSerialNumber;
///
/// 用户自定义名
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public Byte[] chUserDefinedName;
///
/// 网口IP地址
///
public UInt32 nNetExport;
///
/// 预留
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
};
///
/// ch:USB3 设备信息 | en:USB3 device information
///
public struct MV_USB3_DEVICE_INFO
{
///
/// 控制输入端点
///
public Byte CrtlInEndPoint;
///
/// 控制输出端点
///
public Byte CrtlOutEndPoint;
///
/// 流端点
///
public Byte StreamEndPoint;
///
/// 事件端点
///
public Byte EventEndPoint;
///
/// 供应商ID号
///
public UInt16 idVendor;
///
/// 产品ID号
///
public UInt16 idProduct;
///
/// 设备索引号
///
public UInt32 nDeviceNumber;
///
/// 设备GUID号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceGUID;
///
/// 供应商名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chVendorName;
///
/// 型号名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chModelName;
///
/// 家族名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chFamilyName;
///
/// 设备版本号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceVersion;
///
/// 制造商名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chManufacturerName;
///
/// 序列号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chSerialNumber;
///
/// 用户自定义名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chUserDefinedName;
///
/// 支持的USB协议
///
public UInt32 nbcdUSB;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public UInt32[] nReserved;
};
///
/// ch:USB3 设备信息 | en:USB3 device information
///
public struct MV_USB3_DEVICE_INFO_EX
{
///
/// 控制输入端点
///
public Byte CrtlInEndPoint;
///
/// 控制输出端点
///
public Byte CrtlOutEndPoint;
///
/// 流端点
///
public Byte StreamEndPoint;
///
/// 事件端点
///
public Byte EventEndPoint;
///
/// 供应商ID号
///
public UInt16 idVendor;
///
/// 产品ID号
///
public UInt16 idProduct;
///
/// 设备索引号
///
public UInt32 nDeviceNumber;
///
/// 设备GUID号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceGUID;
///
/// 供应商名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chVendorName;
///
/// 型号名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chModelName;
///
/// 家族名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chFamilyName;
///
/// 设备版本号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceVersion;
///
/// 制造商名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chManufacturerName;
///
/// 序列号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chSerialNumber;
///
/// 用户自定义名字
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = INFO_MAX_BUFFER_SIZE)]
public Byte[] chUserDefinedName;
///
/// 支持的USB协议
///
public UInt32 nbcdUSB;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public UInt32[] nReserved;
};
///
/// ch:CamLink设备信息 | en:CamLink device information
///
public struct MV_CamL_DEV_INFO
{
///
/// 端口号ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chPortID;
///
/// 模型名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chModelName;
///
/// 家族名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chFamilyName;
///
/// 设备版本信息
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceVersion;
///
/// 制造商名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chManufacturerName;
///
/// 序列号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chSerialNumber;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public UInt32[] nReserved;
};
///
/// ch:采集卡Camera Link相机信息 | en:Camera Link device information on frame grabber
///
public struct MV_CML_DEVICE_INFO
{
///
/// ch 采集卡ID |en Interface ID of Frame Grabber
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chInterfaceID;
///
/// ch 供应商名字 |en Vendor name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chVendorName;
///
/// ch 型号名字 |en Model name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chModelName;
///
/// ch 厂商信息 |en Manufacturer information
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chManufacturerInfo;
///
/// ch 相机版本 |en Device version
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceVersion;
///
/// ch 序列号 |en Serial number
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chSerialNumber;
///
/// ch 用户自定义名字 |en User defined name
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = INFO_MAX_BUFFER_SIZE)]
public Byte[] chUserDefinedName;
///
/// ch 相机ID |en Device ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceID;
///
/// ch 保留字段 |en Reserved
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
public UInt32[] nReserved; // 保留字节
};
///
/// ch:CoaXPress相机信息 | en:CoaXPress device information
///
public struct MV_CXP_DEVICE_INFO
{
///
/// ch 采集卡ID |en Interface ID of Frame Grabber
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chInterfaceID;
///
/// ch 供应商名字 |en Vendor name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chVendorName;
///
/// ch 型号名字 |en Model name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chModelName;
///
/// ch 厂商信息 |en Manufacturer information
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chManufacturerInfo;
///
/// ch 相机版本 |en Device version
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceVersion;
///
/// ch 序列号 |en Serial number
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chSerialNumber;
///
/// ch 用户自定义名字 |en User defined name
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = INFO_MAX_BUFFER_SIZE)]
public Byte[] chUserDefinedName;
///
/// ch 相机ID |en Device ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceID;
///
/// ch 保留字段 |en Reserved
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
public UInt32[] nReserved; // 保留字节
};
///
/// ch:XoFLink相机信息 | en:XoFLink device information
///
public struct MV_XOF_DEVICE_INFO
{
///
/// ch 采集卡ID |en Interface ID of Frame Grabber
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chInterfaceID;
///
/// ch 供应商名字 |en Vendor name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chVendorName;
///
/// ch 型号名字 |en Model name
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chModelName;
///
/// ch 厂商信息 |en Manufacturer information
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chManufacturerInfo;
///
/// ch 相机版本 |en Device version
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceVersion;
///
/// ch 序列号 |en Serial number
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chSerialNumber;
///
/// ch 用户自定义名字 |en User defined name
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = INFO_MAX_BUFFER_SIZE)]
public Byte[] chUserDefinedName;
///
/// ch 相机ID |en Device ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceID;
///
/// ch 保留字段 |en Reserved
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
public UInt32[] nReserved; // 保留字节
};
///
/// ch:设备信息 | en:Device information
///
[StructLayout(LayoutKind.Sequential)] //结构体顺序布局
public struct MV_CC_DEVICE_INFO
{
///
/// 主版本号
///
public UInt16 nMajorVer;
///
/// 次版本号
///
public UInt16 nMinorVer;
///
/// MAC高地址
///
public UInt32 nMacAddrHigh;
///
/// MAC低地址
///
public UInt32 nMacAddrLow;
///
/// 设备传输层协议类型,e.g. MV_GIGE_DEVICE
///
public UInt32 nTLayerType;
///
/// ch 设备类型信息 | en Device Type Info
///
public UInt32 nDevTypeInfo;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public UInt32[] nReserved;
///
/// ch:特定类型的设备信息 | en:Special devcie information
///
[StructLayout(LayoutKind.Explicit, Size = 540)]
public struct SPECIAL_INFO
{
///
/// GigE
///
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 216)]
public Byte[] stGigEInfo;
///
/// Camera Link
///
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 536)]
public Byte[] stCamLInfo;
///
/// Usb
///
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 540)]
public Byte[] stUsb3VInfo;
///
/// CML
///
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 540)]
public Byte[] stCMLInfo;
///
/// CXP
///
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 540)]
public Byte[] stCXPInfo;
///
/// XOF
///
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 540)]
public Byte[] stXoFInfo;
};
///
/// 设备类型
///
public SPECIAL_INFO SpecialInfo;
///
/// 构造函数
///
/// 输入任意数,因为不接受无参构造函数
public MV_CC_DEVICE_INFO(UInt32 nAnyNum)
{
nMajorVer = 0;
nMinorVer = 0;
nMacAddrHigh = 0;
nMacAddrLow = 0;
nTLayerType = 0;
nDevTypeInfo = 0;
nReserved = new uint[3];
SpecialInfo.stGigEInfo = new byte[216];
SpecialInfo.stCamLInfo = new byte[536];
SpecialInfo.stUsb3VInfo = new byte[540];
SpecialInfo.stCMLInfo = new byte[540];
SpecialInfo.stCXPInfo = new byte[540];
SpecialInfo.stXoFInfo = new byte[540];
}
};
///
/// 相机列表
///
public struct MV_CC_DEVICE_INFO_LIST
{
///
/// 在线设备数量
///
public UInt32 nDeviceNum;
///
/// 支持最多256个设备
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_DEVICE_NUM)]
public IntPtr[] pDeviceInfo;
};
///
/// ch:通过GenTL枚举到的Interface信息 | en:Interface Information with GenTL
///
[StructLayout(LayoutKind.Sequential)]
public struct MV_GENTL_IF_INFO
{
///
/// GenTL接口ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chInterfaceID;
///
/// 传输层类型
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chTLType;
///
/// 设备显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public String chDisplayName;
///
/// GenTL的cti文件索引
///
public UInt32 nCtiIndex;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nReserved;
};
///
/// ch:通过GenTL枚举到的设备信息列表 | en:Interface Information List with GenTL
///
public struct MV_GENTL_IF_INFO_LIST
{
///
/// ch:在线设备数量 | en:Online Interface Number
///
public UInt32 nInterfaceNum;
///
/// ch:支持最多256个设备 | en:Support up to 256 Interfaces
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_GENTL_IF_NUM)]
public IntPtr[] pIFInfo;
};
///
/// ch:通过GenTL枚举到的设备信息 | en:Device Information discovered by with GenTL
///
public struct MV_GENTL_DEV_INFO
{
///
/// 采集卡ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chInterfaceID;
///
/// 设备ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceID;
///
/// 供应商名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chVendorName;
///
/// 模型名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chModelName;
///
/// 传输类型
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chTLType;
///
/// 显示名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDisplayName;
///
/// 用户自定义名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chUserDefinedName;
///
/// 序列号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chSerialNumber;
///
/// 设备版本信息
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceVersion;
///
/// cti文件序号
///
public UInt32 nCtiIndex;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nReserved;
};
///
/// ch:通过GenTL枚举到的设备信息 | en:Device Information discovered by with GenTL
///
public struct MV_GENTL_DEV_INFO_EX
{
///
/// 采集卡ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chInterfaceID;
///
/// 设备ID
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceID;
///
/// 供应商名字
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chVendorName;
///
/// 模型名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chModelName;
///
/// 传输类型
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chTLType;
///
/// 显示名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDisplayName;
///
/// 用户自定义名
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = INFO_MAX_BUFFER_SIZE)]
public Byte[] chUserDefinedName;
///
/// 序列号
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chSerialNumber;
///
/// 设备版本信息
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = INFO_MAX_BUFFER_SIZE)]
public string chDeviceVersion;
///
/// cti文件序号
///
public UInt32 nCtiIndex;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nReserved;
};
///
/// ch:GenTL设备列表 | en:GenTL devices list
///
public struct MV_GENTL_DEV_INFO_LIST
{
///
/// 在线设备数量
///
public UInt32 nDeviceNum;
///
/// 支持最多256个设备
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_GENTL_DEV_NUM)]
public IntPtr[] pDeviceInfo;
};
///
/// Net Trans Info
///
public struct MV_NETTRANS_INFO
{
///
/// 已接收数据大小 [统计StartGrabbing和StopGrabbing之间的数据量]
///
public Int64 nReviceDataSize;
///
/// 丢帧数量
///
public Int32 nThrowFrameCount;
///
/// 接收帧数
///
public UInt32 nNetRecvFrameCount;
///
/// 请求重发包数
///
public Int64 nRequestResendPacketCount;
///
/// 重发包数
///
public Int64 nResendPacketCount;
};
///
/// Frame Out Info
///
public struct MV_FRAME_OUT_INFO
{
///
/// 图像宽
///
public UInt16 nWidth;
///
/// 图像高
///
public UInt16 nHeight;
///
/// 像素格式
///
public MvGvspPixelType enPixelType;
///
/// 帧号
///
public UInt32 nFrameNum;
///
/// 时间戳高32位
///
public UInt32 nDevTimeStampHigh;
///
/// 时间戳低32位
///
public UInt32 nDevTimeStampLow;
///
/// 保留,8字节对齐
///
public UInt32 nReserved0;
///
/// 主机生成的时间戳
///
public Int64 nHostTimeStamp;
///
/// 帧数据大小
///
public UInt32 nFrameLen;
///
/// 丢包数量
///
public UInt32 nLostPacket;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public UInt32[] nReserved;
};
///
/// Chunk数据信息
///
public struct MV_CHUNK_DATA_CONTENT
{
///
/// Chunk数据
///
public IntPtr pChunkData;
///
/// ChunkID
///
public UInt32 nChunkID;
///
/// Chunk大小
///
public UInt32 nChunkLen;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nReserved;
};
///
/// Frame Out Info Ex
///
public struct MV_FRAME_OUT_INFO_EX
{
///
/// 图像宽
///
public UInt16 nWidth;
///
/// 图像高
///
public UInt16 nHeight;
///
/// 像素格式
///
public MvGvspPixelType enPixelType;
///
/// 帧号
///
public UInt32 nFrameNum;
///
/// 时间戳高32位
///
public UInt32 nDevTimeStampHigh;
///
/// 时间戳低32位
///
public UInt32 nDevTimeStampLow;
///
/// 保留,8字节对齐
///
public UInt32 nReserved0;
///
/// 主机生成的时间戳
///
public Int64 nHostTimeStamp;
///
/// Frame大小
///
public UInt32 nFrameLen;
// 以下为chunk新增水印信息
// 设备水印时标
///
/// 秒数
///
public UInt32 nSecondCount;
///
/// 周期数
///
public UInt32 nCycleCount;
///
/// 周期偏移量
///
public UInt32 nCycleOffset;
///
/// 增益
///
public Single fGain;
///
/// 曝光时间
///
public Single fExposureTime;
///
/// 平均亮度
///
public UInt32 nAverageBrightness;
// 白平衡相关
///
/// Red
///
public UInt32 nRed;
///
/// Green
///
public UInt32 nGreen;
///
/// Blue
///
public UInt32 nBlue;
///
/// 帧计数器
///
public UInt32 nFrameCounter;
///
/// 触发计数
///
public UInt32 nTriggerIndex;
//Line 输入/输出
///
/// 输入
///
public UInt32 nInput;
///
/// 输出
///
public UInt32 nOutput;
// ROI区域
///
/// 水平偏移量
///
public UInt16 nOffsetX;
///
/// 垂直偏移量
///
public UInt16 nOffsetY;
///
/// Chunk宽度
///
public UInt16 nChunkWidth;
///
/// Chunk高度
///
public UInt16 nChunkHeight;
///
/// 丢包数
///
public UInt32 nLostPacket;
///
/// 为解析的Chunk数量
///
public UInt32 nUnparsedChunkNum;
///
/// 为解析的Chunk列表
///
[StructLayout(LayoutKind.Explicit)]
public struct UNPARSED_CHUNK_LIST
{
///
/// 为解析的Chunk内容
///
[FieldOffset(0)]
public IntPtr pUnparsedChunkContent;
///
/// 对齐结构体,无实际用途
///
[FieldOffset(0)]
public Int64 nAligning;
}
///
/// 为解析的Chunk列表
///
public UNPARSED_CHUNK_LIST UnparsedChunkList;
///
/// 图像宽扩展
///
public UInt32 nExtendWidth;
///
/// 图像高扩展
///
public UInt32 nExtendHeight;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 34)]
public UInt32[] nReserved;
};
///
/// 输出帧信息
///
public struct MV_FRAME_OUT
{
///
/// 帧数据地址
///
public IntPtr pBufAddr;
///
/// 帧信息
///
public MV_FRAME_OUT_INFO_EX stFrameInfo;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public UInt32[] nReserved;
};
///
/// 取流策略
///
public enum MV_GRAB_STRATEGY
{
///
/// 从旧到新一帧一帧的获取图像(默认为该策略)
///
MV_GrabStrategy_OneByOne = 0,
///
/// 获取列表中最新的一帧图像(同时清除列表中的其余图像)
///
MV_GrabStrategy_LatestImagesOnly = 1,
///
/// 获取列表中最新的图像,个数由OutputQueueSize决定,范围为1-ImageNodeNum,设置成1等同于LatestImagesOnly,设置成ImageNodeNum等同于OneByOne
///
MV_GrabStrategy_LatestImages = 2,
///
/// 等待下一帧图像
///
MV_GrabStrategy_UpcomingImage = 3,
};
///
/// 显示帧信息
///
public struct MV_DISPLAY_FRAME_INFO
{
///
/// 显示窗口的句柄
///
public IntPtr hWnd;
///
/// 显示的帧数据
///
public IntPtr pData;
///
/// 显示的帧数据大小
///
public UInt32 nDataLen;
///
/// 图像宽
///
public UInt16 nWidth;
///
/// 图像高
///
public UInt16 nHeight;
///
/// 像素格式
///
public MvGvspPixelType enPixelType;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
};
///
/// 显示帧信息
///
public struct MV_DISPLAY_FRAME_INFO_EX
{
///
/// 图像宽
///
public UInt32 nWidth;
///
/// 图像高
///
public UInt32 nHeight;
///
/// 像素格式
///
public MvGvspPixelType enPixelType;
///
/// 显示的帧数据
///
public IntPtr pData;
///
/// 显示的帧数据大小
///
public UInt32 nDataLen;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
};
///
/// ch:保存3D数据格式 | en:Save 3D file
///
public enum MV_SAVE_POINT_CLOUD_FILE_TYPE
{
///
/// 未定义数据格式
///
MV_PointCloudFile_Undefined = 0,
///
/// PLY数据格式
///
MV_PointCloudFile_PLY = 1,
///
/// CSV数据格式
///
MV_PointCloudFile_CSV = 2,
///
/// OBJ数据格式
///
MV_PointCloudFile_OBJ = 3,
};
///
/// 保存的点阵参数
///
public struct MV_SAVE_POINT_CLOUD_PARAM
{
///
/// [IN] 每一行点的数量
///
public UInt32 nLinePntNum;
///
/// [IN] 行数
///
public UInt32 nLineNum;
///
/// [IN] 输入数据的像素格式
///
public MvGvspPixelType enSrcPixelType;
///
/// [IN] 输入数据缓存
///
public IntPtr pSrcData;
///
/// [IN] 输入数据大小
///
public UInt32 nSrcDataLen;
///
/// [OUT] 输出像素数据缓存
///
public IntPtr pDstBuf;
///
/// [IN] 提供的输出缓冲区大小(nLinePntNum * nLineNum * (16*3 + 4) + 2048)
///
public UInt32 nDstBufSize;
///
/// [OUT] 输出像素数据缓存长度
///
public UInt32 nDstBufLen;
///
/// 保存的点阵文件类型
///
public MV_SAVE_POINT_CLOUD_FILE_TYPE enPointCloudFileType;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 保存的图像格式
///
public enum MV_SAVE_IAMGE_TYPE
{
///
/// 未定义类型
///
MV_Image_Undefined = 0,
///
/// Bmp图像格式
///
MV_Image_Bmp = 1,
///
/// Jpeg图像格式
///
MV_Image_Jpeg = 2,
///
/// Png图像格式
///
MV_Image_Png = 3,
///
/// Tif图像格式
///
MV_Image_Tif = 4,
};
///
/// 保存的图像参数
///
public struct MV_SAVE_IMAGE_PARAM
{
///
/// [IN] 输入数据缓存
///
public IntPtr pData;
///
/// [IN] 输入数据大小
///
public UInt32 nDataLen;
///
/// [IN] 输入数据的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 图像宽
///
public UInt16 nWidth;
///
/// [IN] 图像高
///
public UInt16 nHeight;
///
/// [OUT] 输出图片缓存
///
public IntPtr pImageBuffer;
///
/// [OUT] 输出图片大小
///
public UInt32 nImageLen;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nBufferSize;
///
/// [IN] 输出图片格式
///
public MV_SAVE_IAMGE_TYPE enImageType;
};
///
/// 保存的图像参数
///
public struct MV_SAVE_IMAGE_PARAM_EX2
{
///
/// [IN] 输入数据缓存
///
public IntPtr pData;
///
/// [IN] 输入数据大小
///
public UInt32 nDataLen;
///
/// [IN] 输入数据的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 图像宽
///
public UInt16 nWidth;
///
/// [IN] 图像高
///
public UInt16 nHeight;
///
/// [OUT] 输出图片缓存
///
public IntPtr pImageBuffer;
///
/// [OUT] 输出图片大小
///
public UInt32 nImageLen;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nBufferSize;
///
/// [IN] 输出图片格式
///
public MV_SAVE_IAMGE_TYPE enImageType;
///
/// [IN] 编码质量, (50-99]
///
public UInt32 nJpgQuality;
///
/// [IN] Bayer的插值方法 0-快速 1-均衡 2-最优(如果传入其它值则默认为最优)
///
public UInt32 iMethodValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public UInt32[] nReserved;
};
///
/// 保存的图像信息扩展
///
public struct MV_SAVE_IMAGE_PARAM_EX3
{
///
/// [IN] 输入数据缓存
///
public IntPtr pData;
///
/// [IN] 输入数据大小
///
public UInt32 nDataLen;
///
/// [IN] 输入数据的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 图像宽
///
public UInt32 nWidth;
///
/// [IN] 图像高
///
public UInt32 nHeight;
///
/// [OUT] 输出图片缓存
///
public IntPtr pImageBuffer;
///
/// [OUT] 输出图片大小
///
public UInt32 nImageLen;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nBufferSize;
///
/// [IN] 输出图片格式
///
public MV_SAVE_IAMGE_TYPE enImageType;
///
/// [IN] 编码质量, (50-99]
///
public UInt32 nJpgQuality;
///
/// [IN] Bayer的插值方法 0-快速 1-均衡 2-最优(如果传入其它值则默认为最优)
///
public UInt32 iMethodValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public UInt32[] nReserved;
}
///
/// 保存图像到文件的参数
///
public struct MV_SAVE_IMG_TO_FILE_PARAM
{
///
/// [IN] 输入数据的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 输入数据缓存
///
public IntPtr pData;
///
/// [IN] 输入数据大小
///
public UInt32 nDataLen;
///
/// [IN] 图像宽
///
public UInt16 nWidth;
///
/// [IN] 图像高
///
public UInt16 nHeight;
///
/// [IN] 输入图片格式
///
public MV_SAVE_IAMGE_TYPE enImageType;
///
/// [IN] 编码质量, (0-100]
///
public UInt32 nQuality;
///
/// [IN] 输入文件路径
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string pImagePath;
///
/// [IN] Bayer的插值方法 0-快速 1-均衡 2-最优(如果传入其它值则默认为最优)
///
public UInt32 iMethodValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 保存图像到文件信息扩展
///
public struct MV_SAVE_IMG_TO_FILE_PARAM_EX
{
///
/// [IN] 图像宽
///
public UInt32 nWidth;
///
/// [IN] 图像高
///
public UInt32 nHeight;
///
/// [IN] 输入数据的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 输入数据缓存
///
public IntPtr pData;
///
/// [IN] 输入数据大小
///
public UInt32 nDataLen;
///
/// [IN] 输入图片格式
///
public MV_SAVE_IAMGE_TYPE enImageType;
///
/// [IN] 输入文件路径
///
public string pImagePath;
///
/// [IN] 编码质量, (0-100]
///
public UInt32 nQuality;
///
/// [IN] Bayer的插值方法 0-快速 1-均衡 2-最优(如果传入其它值则默认为最优)
///
public UInt32 iMethodValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 旋转角度
///
public enum MV_IMG_ROTATION_ANGLE
{
///
/// 旋转90度
///
MV_IMAGE_ROTATE_90 = 1,
///
/// 旋转180度
///
MV_IMAGE_ROTATE_180 = 2,
///
/// 旋转270度
///
MV_IMAGE_ROTATE_270 = 3,
}
///
/// 旋转图像参数
///
public struct MV_CC_ROTATE_IMAGE_PARAM
{
///
/// [IN] 像素格式(仅支持Mono8/RGB24/BGR24)
///
public MvGvspPixelType enPixelType;
///
/// [IN][OUT] 图像宽
///
public UInt32 nWidth;
///
/// [IN][OUT] 图像高
///
public UInt32 nHeight;
///
/// [IN] 输入数据缓存
///
public IntPtr pSrcData;
///
/// [IN] 输入数据大小
///
public UInt32 nSrcDataLen;
///
/// [OUT] 输出图片缓存
///
public IntPtr pDstBuf;
///
/// [OUT] 输出图片大小
///
public UInt32 nDstBufLen;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [IN] 旋转角度
///
public MV_IMG_ROTATION_ANGLE enRotationAngle;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 图像翻转类型
///
public enum MV_IMG_FLIP_TYPE
{
///
/// 垂直方向翻转
///
MV_FLIP_VERTICAL = 1,
///
/// 水平方向翻转
///
MV_FLIP_HORIZONTAL = 2,
}
///
/// 翻转图像参数
///
public struct MV_CC_FLIP_IMAGE_PARAM
{
///
/// [IN] 像素格式(仅支持Mono8/RGB24/BGR24)
///
public MvGvspPixelType enPixelType;
///
/// [IN] 图像宽
///
public UInt32 nWidth;
///
/// [IN] 图像高
///
public UInt32 nHeight;
///
/// [IN] 输入数据缓存
///
public IntPtr pSrcData;
///
/// [IN] 输入数据大小
///
public UInt32 nSrcDataLen;
///
/// [OUT] 输出图片缓存
///
public IntPtr pDstBuf;
///
/// [OUT] 输出图片大小
///
public UInt32 nDstBufLen;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [IN] 翻转类型
///
public MV_IMG_FLIP_TYPE enFlipType;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 像素转换参数
///
public struct MV_PIXEL_CONVERT_PARAM
{
///
/// [IN] 图像宽
///
public UInt16 nWidth;
///
/// [IN] 图像高
///
public UInt16 nHeight;
///
/// [IN] 源像素格式
///
public MvGvspPixelType enSrcPixelType;
///
/// [IN] 输入数据缓存
///
public IntPtr pSrcData;
///
/// [IN] 输入数据大小
///
public UInt32 nSrcDataLen;
///
/// [IN] 目标像素格式
///
public MvGvspPixelType enDstPixelType;
///
/// [OUT] 输出数据缓存
///
public IntPtr pDstBuffer;
///
/// [OUT] 输出数据大小
///
public UInt32 nDstLen;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufferSize;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nRes;
}
///
/// 图像像素转换信息扩展
///
public struct MV_CC_PIXEL_CONVERT_PARAM_EX
{
///
/// [IN] 图像宽
///
public UInt32 nWidth;
///
/// [IN] 图像高
///
public UInt32 nHeight;
///
/// [IN] 源像素格式
///
public MvGvspPixelType enSrcPixelType;
///
/// [IN] 输入数据缓存
///
public IntPtr pSrcData;
///
/// [IN] 输入数据大小
///
public UInt32 nSrcDataLen;
///
/// [IN] 目标像素格式
///
public MvGvspPixelType enDstPixelType;
///
/// [OUT] 输出数据缓存
///
public IntPtr pDstBuffer;
///
/// [OUT] 输出数据大小
///
public UInt32 nDstLen;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufferSize;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nRes;
}
///
/// Gamma类型
///
public enum MV_CC_GAMMA_TYPE
{
///
/// 不启用
///
MV_CC_GAMMA_TYPE_NONE = 0,
///
/// GAMMA值
///
MV_CC_GAMMA_TYPE_VALUE = 1,
///
/// GAMMA曲线,8位需要的长度:256*sizeof(unsigned char)
/// 10位需要的长度:1024*sizeof(unsigned short)
/// 12位需要的长度:4096*sizeof(unsigned short)
/// 16位需要的长度:65536*sizeof(unsigned short)
///
MV_CC_GAMMA_TYPE_USER_CURVE = 2,
///
/// 线性RGB转非线性RGB
///
MV_CC_GAMMA_TYPE_LRGB2SRGB = 3,
///
/// 非线性RGB转线性RGB
///
MV_CC_GAMMA_TYPE_SRGB2LRGB = 4,
}
///
/// Gamma参数
///
public struct MV_CC_GAMMA_PARAM
{
///
/// [IN] Gamma类型
///
public MV_CC_GAMMA_TYPE enGammaType;
///
/// [IN] Gamma值
///
public Single fGammaValue;
///
/// [IN] Gamma曲线缓存
///
public IntPtr pGammaCurveBuf;
///
/// [IN] Gamma曲线长度
///
public UInt32 nGammaCurveBufLen;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// CCM参数
///
public struct MV_CC_CCM_PARAM
{
///
/// [IN] 是否启用CCM
///
public Boolean bCCMEnable;
///
/// [IN] CCM矩阵(-8192~8192)
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
public Int32[] nCCMat;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// CCM参数
///
public struct MV_CC_CCM_PARAM_EX
{
///
/// [IN] 是否启用CCM
///
public Boolean bCCMEnable;
///
/// [IN] 量化3x3矩阵
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
public Int32[] nCCMat;
///
/// [IN] 量化系数(2的整数幂)
///
public UInt32 nCCMScale;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// CLUT参数
///
public struct MV_CC_CLUT_PARAM
{
///
/// [IN] 是否启用CLUT
///
public Boolean bCLUTEnable;
///
/// [IN] 量化系数(2的整数幂)
///
public UInt32 nCLUTScale;
///
/// [IN] CLUT大小,建议值17
///
public UInt32 nCLUTSize;
///
/// [OUT] 量化CLUT
///
public IntPtr pCLUTBuf;
///
/// [IN] 量化CLUT缓存大小(nCLUTSize*nCLUTSize*nCLUTSize*sizeof(int)*3)
///
public UInt32 nCLUTBufLen;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 对比度调节参数
///
public struct MV_CC_CONTRAST_PARAM
{
///
/// [IN] 图像宽度(最小8)
///
public UInt32 nWidth;
///
/// [IN] 图像高度(最小8)
///
public UInt32 nHeight;
///
/// [IN] 输入图像缓存
///
public IntPtr pSrcBuf;
///
/// [IN] 输入图像缓存长度
///
public UInt32 nSrcBufLen;
///
/// [IN] 输入的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [OUT] 输出像素数据缓存
///
public IntPtr pDstBuf;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [OUT] 输出像素数据缓存长度
///
public UInt32 nDstBufLen;
///
/// [IN] 对比度值,范围:[1, 10000]
///
public UInt32 nContrastFactor;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 锐化参数
///
public struct MV_CC_SHARPEN_PARAM
{
///
/// [IN] 图像宽度(最小8)
///
public UInt32 nWidth;
///
/// [IN] 图像高度(最小8)
///
public UInt32 nHeight;
///
/// [IN] 输入图像缓存
///
public IntPtr pSrcBuf;
///
/// [IN] 输入图像缓存长度
///
public UInt32 nSrcBufLen;
///
/// [IN] 输入的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [OUT] 输出像素数据缓存
///
public IntPtr pDstBuf;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [OUT] 输出像素数据缓存长度
///
public UInt32 nDstBufLen;
///
/// [IN] 锐度调节强度,范围:[0, 500]
///
public UInt32 nSharpenAmount;
///
/// [IN] 锐度调节半径(半径越大,耗时越长),范围:[1, 21]
///
public UInt32 nSharpenRadius;
///
/// [IN] 锐度调节阈值,范围:[0, 255]
///
public UInt32 nSharpenThreshold;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 色彩校正参数(包括CCM和CLUT)
///
public struct MV_CC_COLOR_CORRECT_PARAM
{
///
/// [IN] 图像宽度
///
public UInt32 nWidth;
///
/// [IN] 图像高度
///
public UInt32 nHeight;
///
/// [IN] 输入图像缓存
///
public IntPtr pSrcBuf;
///
/// [IN] 输入图像缓存长度
///
public UInt32 nSrcBufLen;
///
/// [IN] 输入的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [OUT] 输出像素数据缓存
///
public IntPtr pDstBuf;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [OUT] 输出像素数据缓存长度
///
public UInt32 nDstBufLen;
///
/// [IN] 输入有效图像位数,8 or 10 or 12 or 16
///
public UInt32 nImageBit;
///
/// [IN] 输入Gamma信息
///
public MV_CC_GAMMA_PARAM stGammaParam;
///
/// [IN] 输入CCM信息
///
public MV_CC_CCM_PARAM_EX stCCMParam;
///
/// [IN] 输入CLUT信息
///
public MV_CC_CLUT_PARAM stCLUTParam;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 矩形ROI参数
///
public struct MV_CC_RECT_I
{
///
/// [IN] 矩形左上角X轴坐标
///
public UInt32 nX;
///
/// [IN] 矩形左上角Y轴坐标
///
public UInt32 nY;
///
/// [IN] 矩形宽度
///
public UInt32 nWidth;
///
/// [IN] 矩形高度
///
public UInt32 nHeight;
};
///
/// 噪声估计参数
///
public struct MV_CC_NOISE_ESTIMATE_PARAM
{
///
/// [IN] 图像宽度
///
public UInt32 nWidth;
///
/// [IN] 图像高度
///
public UInt32 nHeight;
///
/// [IN] 输入的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 输入图像缓存
///
public IntPtr pSrcBuf;
///
/// [IN] 输入图像缓存长度
///
public UInt32 nSrcBufLen;
///
/// [IN] 图像ROI
///
public IntPtr pstROIRect;
///
/// [IN] ROI个数
///
public UInt32 nROINum;
//Bayer域噪声估计参数,Mono8/RGB域无效
///
/// [IN] 噪声阈值[0-4095]
///
public UInt32 nNoiseThreshold;
///
/// [OUT] 输出噪声特性
///
public IntPtr pNoiseProfile;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nNoiseProfileSize;
///
/// [OUT] 输出噪声特性长度
///
public UInt32 nNoiseProfileLen;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 空域降噪参数
///
public struct MV_CC_SPATIAL_DENOISE_PARAM
{
///
/// [IN] 图像宽度
///
public UInt32 nWidth;
///
/// [IN] 图像高度
///
public UInt32 nHeight;
///
/// [IN] 输入的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 输入图像缓存
///
public IntPtr pSrcBuf;
///
/// [IN] 输入图像缓存长度
///
public UInt32 nSrcBufLen;
///
/// [OUT] 输出降噪后的数据
///
public IntPtr pDstBuf;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [OUT] 输出降噪后的数据长度
///
public UInt32 nDstBufLen;
///
/// [IN] 输入噪声特性
///
public IntPtr pNoiseProfile;
///
/// [IN] 输入噪声特性长度
///
public UInt32 nNoiseProfileLen;
//Bayer域空域降噪算法参数,Mono8/RGB域无效
///
/// [IN] 降噪强度(0-100)
///
public UInt32 nBayerDenoiseStrength;
///
/// [IN] 锐化强度(0-32)
///
public UInt32 nBayerSharpenStrength;
///
/// [IN] 噪声校正系数(0-1280)
///
public UInt32 nBayerNoiseCorrect;
//Mono8/RGB域空域降噪算法参数,Bayer域无效
///
/// [IN] 亮度校正系数(1-2000)
///
public UInt32 nNoiseCorrectLum;
///
/// [IN] 色调校正系数(1-2000)
///
public UInt32 nNoiseCorrectChrom;
///
/// [IN] 亮度降噪强度(0-100)
///
public UInt32 nStrengthLum;
///
/// [IN] 色调降噪强度(0-100)
///
public UInt32 nStrengthChrom;
///
/// [IN] 锐化强度(1-1000)
///
public UInt32 nStrengthSharpen;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// LSC标定参数
///
public struct MV_CC_LSC_CALIB_PARAM
{
///
/// [IN] 图像宽度(16~65536)
///
public UInt32 nWidth;
///
/// [IN] 图像高度(16~65536)
///
public UInt32 nHeight;
///
/// [IN] 输入的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 输入图像缓存
///
public IntPtr pSrcBuf;
///
/// [IN] 输入图像缓存长度
///
public UInt32 nSrcBufLen;
///
/// [OUT] 输出标定表缓存
///
public IntPtr pCalibBuf;
///
/// [IN] 提供的标定表缓冲大小(nWidth*nHeight*sizeof(unsigned short))
///
public UInt32 nCalibBufSize;
///
/// [OUT] 输出标定表缓存长度
///
public UInt32 nCalibBufLen;
///
/// [IN] 宽度分块数
///
public UInt32 nSecNumW;
///
/// [IN] 高度分块数
///
public UInt32 nSecNumH;
///
/// [IN] 边缘填充系数,范围1~5
///
public UInt32 nPadCoef;
///
/// [IN] 标定方式,0-中心为基准
/// 1-最亮区域为基准
/// 2-目标亮度
///
public UInt32 nCalibMethod;
///
/// [IN] 目标亮度(8bits,[0,255])
/// (10bits,[0,1023])
/// (12bits,[0,4095])
/// (16bits,[0,65535])
///
public UInt32 nTargetGray;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// LSC校正参数
///
public struct MV_CC_LSC_CORRECT_PARAM
{
///
/// [IN] 图像宽度(16~65536)
///
public UInt32 nWidth;
///
/// [IN] 图像高度(16~65536)
///
public UInt32 nHeight;
///
/// [IN] 输入的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 输入图像缓存
///
public IntPtr pSrcBuf;
///
/// [IN] 输入图像缓存长度
///
public UInt32 nSrcBufLen;
///
/// [OUT] 输出像素数据缓存
///
public IntPtr pDstBuf;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [OUT] 输出像素数据缓存长度
///
public UInt32 nDstBufLen;
///
/// [IN] 输入校正表缓存
///
public IntPtr pCalibBuf;
///
/// [IN] 输入校正表缓存长度
///
public UInt32 nCalibBufLen;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 噪声特性类型
///
public enum MV_CC_BAYER_NOISE_FEATURE_TYPE
{
///
/// 无效
///
MV_CC_BAYER_NOISE_FEATURE_TYPE_INVALID = 0,
///
/// 噪声曲线
///
MV_CC_BAYER_NOISE_FEATURE_TYPE_PROFILE = 1,
///
/// 噪声水平
///
MV_CC_BAYER_NOISE_FEATURE_TYPE_LEVEL = 2,
///
/// 默认值
///
MV_CC_BAYER_NOISE_FEATURE_TYPE_DEFAULT = 2,
};
///
/// 噪声基本信息
///
public struct MV_CC_BAYER_NOISE_PROFILE_INFO
{
///
/// 版本
///
public UInt32 nVersion;
///
/// 噪声特性类型
///
public MV_CC_BAYER_NOISE_FEATURE_TYPE enNoiseFeatureType;
///
/// 图像格式
///
public MvGvspPixelType enPixelType;
///
/// 平均噪声水平
///
public Int32 nNoiseLevel;
///
/// 曲线点数
///
public UInt32 nCurvePointNum;
///
/// 噪声曲线
///
public IntPtr nNoiseCurve;
///
/// 亮度曲线
///
public IntPtr nLumCurve;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 噪声估计参数
///
public struct MV_CC_BAYER_NOISE_ESTIMATE_PARAM
{
///
/// [IN] 图像宽(大于等于8)
///
public UInt32 nWidth;
///
/// [IN] 图像高(大于等于8)
///
public UInt32 nHeight;
///
/// [IN] 像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 输入数据缓存
///
public IntPtr pSrcData;
///
/// [IN] 输入数据大小
///
public UInt32 nSrcDataLen;
///
/// [IN] 噪声阈值(0-4095)
///
public UInt32 nNoiseThreshold;
///
/// [IN] 用于存储噪声曲线和亮度曲线(需要外部分配,缓存大小:4096 * sizeof(int) * 2)
///
public IntPtr pCurveBuf;
///
/// [OUT] 降噪特性信息
///
public MV_CC_BAYER_NOISE_PROFILE_INFO stNoiseProfile;
///
/// [IN] 线程数量,0表示算法库根据硬件自适应;1表示单线程(默认);大于1表示线程数目
///
public UInt32 nThreadNum;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 降噪参数
///
public struct MV_CC_BAYER_SPATIAL_DENOISE_PARAM
{
///
/// [IN] 图像宽(大于等于8)
///
public UInt32 nWidth;
///
/// [IN] 图像高(大于等于8)
///
public UInt32 nHeight;
///
/// [IN] 像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 输入数据缓存
///
public IntPtr pSrcData;
///
/// [IN] 输入数据大小
///
public UInt32 nSrcDataLen;
///
/// [OUT] 输出降噪后的数据
///
public IntPtr pDstBuf;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [OUT] 输出降噪后的数据长度
///
public UInt32 nDstBufLen;
///
/// [IN] 降噪特性信息(来源于噪声估计)
///
public MV_CC_BAYER_NOISE_PROFILE_INFO stNoiseProfile;
///
/// [IN] 降噪强度(0-100)
///
public UInt32 nDenoiseStrength;
///
/// [IN] 锐化强度(0-32)
///
public UInt32 nSharpenStrength;
///
/// [IN] 噪声校正系数(0-1280)
///
public UInt32 nNoiseCorrect;
///
/// [IN] 线程数量,0表示算法库根据硬件自适应;1表示单线程(默认);大于1表示线程数目
///
public UInt32 nThreadNum;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 帧特殊信息
///
public struct MV_CC_FRAME_SPEC_INFO
{
//设备水印时标
///
/// [OUT] 秒数
///
public UInt32 nSecondCount;
///
/// [OUT] 周期数
///
public UInt32 nCycleCount;
///
/// [OUT] 周期偏移量
///
public UInt32 nCycleOffset;
///
/// [OUT] 增益
///
public Single fGain;
///
/// [OUT] 曝光时间
///
public Single fExposureTime;
///
/// [OUT] 平均亮度
///
public UInt32 nAverageBrightness;
//白平衡相关
///
/// [OUT] 红色
///
public UInt32 nRed;
///
/// [OUT] 绿色
///
public UInt32 nGreen;
///
/// [OUT] 蓝色
///
public UInt32 nBlue;
///
/// [OUT] 总帧数
///
public UInt32 nFrameCounter;
///
/// [OUT] 触发计数
///
public UInt32 nTriggerIndex;
///
/// [OUT] 输入
///
public UInt32 nInput;
///
/// [OUT] 输出
///
public UInt32 nOutput;
///
/// [OUT] 水平偏移量
///
public UInt16 nOffsetX;
///
/// [OUT] 垂直偏移量
///
public UInt16 nOffsetY;
///
/// [OUT] 水印宽
///
public UInt16 nFrameWidth;
///
/// [OUT] 水印高
///
public UInt16 nFrameHeight;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public UInt32[] nRes;
};
///
/// HB解码参数
///
public struct MV_CC_HB_DECODE_PARAM
{
///
/// [IN] 输入数据缓存
///
public IntPtr pSrcBuf;
///
/// [IN] 输入数据大小
///
public UInt32 nSrcLen;
///
/// [OUT] 图像宽
///
public UInt32 nWidth;
///
/// [OUT] 图像高
///
public UInt32 nHeight;
///
/// [OUT] 输出数据缓存
///
public IntPtr pDstBuf;
///
/// [IN] 提供的输出缓冲区大小
///
public UInt32 nDstBufSize;
///
/// [OUT] 输出数据大小
///
public UInt32 nDstBufLen;
///
/// [OUT] 输出的像素格式
///
public MvGvspPixelType enDstPixelType;
///
/// [OUT] 水印信息
///
public MV_CC_FRAME_SPEC_INFO stFrameSpecInfo;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 录像格式定义
///
public enum MV_RECORD_FORMAT_TYPE
{
///
/// 未定义格式
///
MV_FormatType_Undefined = 0,
///
/// AVI格式
///
MV_FormatType_AVI = 1,
}
///
/// 录像参数
///
public struct MV_CC_RECORD_PARAM
{
///
/// [IN] 输入数据的像素格式
///
public MvGvspPixelType enPixelType;
///
/// [IN] 图像宽(指定目标参数时需为8的倍数)
///
public UInt16 nWidth;
///
/// [IN] 图像高(指定目标参数时需为8的倍数)
///
public UInt16 nHeight;
///
/// [IN] 帧率fps(大于1/16)
///
public Single fFrameRate;
///
/// [IN] 码率kbps(128kbps-16Mbps)
///
public UInt32 nBitRate;
///
/// [IN] 录像格式
///
public MV_RECORD_FORMAT_TYPE enRecordFmtType;
///
/// [IN] 录像文件存放路径
///
public String strFilePath;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 输入帧信息
///
public struct MV_CC_INPUT_FRAME_INFO
{
///
/// [IN] 图像数据指针
///
public IntPtr pData;
///
/// [IN] 图像大小
///
public UInt32 nDataLen;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nRes;
};
///
/// 采集模式
///
public enum MV_CAM_ACQUISITION_MODE
{
///
/// 单帧模式
///
MV_ACQ_MODE_SINGLE = 0,
///
/// 多帧模式
///
MV_ACQ_MODE_MUTLI = 1,
///
/// 持续采集模式
///
MV_ACQ_MODE_CONTINUOUS = 2,
};
///
/// 增益模式
///
public enum MV_CAM_GAIN_MODE
{
///
/// 关闭
///
MV_GAIN_MODE_OFF = 0,
///
/// 一次
///
MV_GAIN_MODE_ONCE = 1,
///
/// 连续
///
MV_GAIN_MODE_CONTINUOUS = 2,
};
///
/// 曝光模式
///
public enum MV_CAM_EXPOSURE_MODE
{
///
/// Timed
///
MV_EXPOSURE_MODE_TIMED = 0,
///
/// TriggerWidth
///
MV_EXPOSURE_MODE_TRIGGER_WIDTH = 1,
};
///
/// 自动曝光模式
///
public enum MV_CAM_EXPOSURE_AUTO_MODE
{
///
/// 关闭
///
MV_EXPOSURE_AUTO_MODE_OFF = 0,
///
/// 一次
///
MV_EXPOSURE_AUTO_MODE_ONCE = 1,
///
/// 连续
///
MV_EXPOSURE_AUTO_MODE_CONTINUOUS = 2,
};
///
/// 相机触发模式
///
public enum MV_CAM_TRIGGER_MODE
{
///
/// 关闭
///
MV_TRIGGER_MODE_OFF = 0,
///
/// 打开
///
MV_TRIGGER_MODE_ON = 1,
};
///
/// Gamma选择器
///
public enum MV_CAM_GAMMA_SELECTOR
{
///
/// USER
///
MV_GAMMA_SELECTOR_USER = 1,
///
/// SRGB
///
MV_GAMMA_SELECTOR_SRGB = 2,
};
///
/// 自动白平衡
///
public enum MV_CAM_BALANCEWHITE_AUTO
{
///
/// 关闭自动白平衡
///
MV_BALANCEWHITE_AUTO_OFF = 0,
///
/// 一次自动白平衡
///
MV_BALANCEWHITE_AUTO_ONCE = 2,
///
/// 连续自动白平衡
///
MV_BALANCEWHITE_AUTO_CONTINUOUS = 1,
}
///
/// 触发源
///
public enum MV_CAM_TRIGGER_SOURCE
{
///
/// LINE0
///
MV_TRIGGER_SOURCE_LINE0 = 0,
///
/// LINE1
///
MV_TRIGGER_SOURCE_LINE1 = 1,
///
/// LINE2
///
MV_TRIGGER_SOURCE_LINE2 = 2,
///
/// LINE3
///
MV_TRIGGER_SOURCE_LINE3 = 3,
///
/// COUNTER0
///
MV_TRIGGER_SOURCE_COUNTER0 = 4,
///
/// SOFTWARE
///
MV_TRIGGER_SOURCE_SOFTWARE = 7,
///
/// FrequencyConverter
///
MV_TRIGGER_SOURCE_FrequencyConverter = 8,
}
///
/// ALL MATHCH INFO
///
public struct MV_ALL_MATCH_INFO
{
///
/// 需要输出的信息类型,e.g. MV_MATCH_TYPE_NET_DETECT
///
public UInt32 nType;
///
/// 输出的信息缓存,由调用者分配
///
public IntPtr pInfo;
///
/// 信息缓存的大小
///
public UInt32 nInfoSize;
}
///
///
///
public struct MV_MATCH_INFO_NET_DETECT
{
///
/// 已接收数据大小 [统计StartGrabbing和StopGrabbing之间的数据量]
///
public Int64 nReviceDataSize;
///
/// 丢失的包数量
///
public Int64 nLostPacketCount;
///
/// 丢帧数量
///
public UInt32 nLostFrameCount;
///
/// 帧数
///
public UInt32 nNetRecvFrameCount;
///
/// 请求重发包数
///
public Int64 nRequestResendPacketCount;
///
/// 重发包数
///
public Int64 nResendPacketCount;
}
///
/// USB
///
public struct MV_MATCH_INFO_USB_DETECT
{
///
/// 已接收数据大小 [统计OpenDevicce和CloseDevice之间的数据量]
///
public Int64 nReviceDataSize;
///
/// 已收到的帧数
///
public UInt32 nRevicedFrameCount;
///
/// 错误帧数
///
public UInt32 nErrorFrameCount;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public UInt32[] nReserved;
}
///
/// 图像的基本信息
///
public struct MV_IMAGE_BASIC_INFO
{
///
/// 宽度值
///
public UInt16 nWidthValue;
///
/// 宽度最小值
///
public UInt16 nWidthMin;
///
/// 宽度最大值
///
public UInt32 nWidthMax;
///
/// Width Inc
///
public UInt32 nWidthInc;
///
/// 高度值
///
public UInt32 nHeightValue;
///
/// 高度最小值
///
public UInt32 nHeightMin;
///
/// 高度最大值
///
public UInt32 nHeightMax;
///
/// Height Inc
///
public UInt32 nHeightInc;
///
/// 帧率
///
public Single fFrameRateValue;
///
/// 最小帧率
///
public Single fFrameRateMin;
///
/// 最大帧率
///
public Single fFrameRateMax;
///
/// 当前的像素格式
///
public UInt32 enPixelType;
///
/// 支持的像素格式种类
///
public UInt32 nSupportedPixelFmtNum;
///
/// 像素列表
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_XML_SYMBOLIC_NUM)]
public UInt32[] enPixelList;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nReserved;
}
///
/// 节点是否可见的权限等级
///
public enum MV_XML_Visibility
{
///
/// Always visible
///
V_Beginner = 0,
///
/// Visible for experts or Gurus
///
V_Expert = 1,
///
/// Visible for Gurus
///
V_Guru = 2,
///
/// Not Visible
///
V_Invisible = 3,
///
/// Object is not yet initialized
///
V_Undefined = 99
}
///
/// 事件信息
///
public struct MV_EVENT_OUT_INFO
{
///
/// 事件名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_EVENT_NAME_SIZE)]
public string EventName;
///
/// Event号
///
public UInt16 nEventID;
///
/// 流通到序号
///
public UInt16 nStreamChannel;
///
/// 帧号高位
///
public UInt32 nBlockIdHigh;
///
/// 帧号低位
///
public UInt32 nBlockIdLow;
///
/// 时间戳高位
///
public UInt32 nTimestampHigh;
///
/// 时间戳低位
///
public UInt32 nTimestampLow;
///
/// Event数据
///
public IntPtr pEventData;
///
/// Event数据长度
///
public UInt32 nEventDataSize;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public UInt32[] nReserved;
}
///
/// 文件存取
///
public struct MV_CC_FILE_ACCESS
{
///
/// 用户文件名
///
public String pUserFileName;
///
/// 设备文件名
///
public String pDevFileName;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public UInt32[] nReserved;
}
///
/// 文件存取
///
public struct MV_CC_FILE_ACCESS_EX
{
///
/// 用户文件数据缓存空间
///
public IntPtr pUserFileBuf;
///
/// 用户数据缓存大小
///
public UInt32 nFileBufSize;
///
/// 文件实际缓存大小
///
public UInt32 nFileBufLen;
///
/// 设备文件名
///
public String pDevFileName;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public UInt32[] nReserved;
}
///
/// 文件存取进度
///
public struct MV_CC_FILE_ACCESS_PROGRESS
{
///
/// 已完成的长度
///
public Int64 nCompleted;
///
/// 总长度
///
public Int64 nTotal;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nReserved;
}
///
/// GigE传输类型
///
public enum MV_GIGE_TRANSMISSION_TYPE
{
///
/// 表示单播(默认)
///
MV_GIGE_TRANSTYPE_UNICAST = 0x0,
///
/// 表示组播
///
MV_GIGE_TRANSTYPE_MULTICAST = 0x1,
///
/// 表示局域网内广播,暂不支持
///
MV_GIGE_TRANSTYPE_LIMITEDBROADCAST = 0x2,
///
/// 表示子网内广播,暂不支持
///
MV_GIGE_TRANSTYPE_SUBNETBROADCAST = 0x3,
///
/// 表示从相机获取,暂不支持
///
MV_GIGE_TRANSTYPE_CAMERADEFINED = 0x4,
///
/// 表示用户自定义应用端接收图像数据Port号
///
MV_GIGE_TRANSTYPE_UNICAST_DEFINED_PORT = 0x5,
///
/// 表示设置了单播,但本实例不接收图像数据
///
MV_GIGE_TRANSTYPE_UNICAST_WITHOUT_RECV = 0x00010000,
///
/// 表示组播模式,但本实例不接收图像数据
///
MV_GIGE_TRANSTYPE_MULTICAST_WITHOUT_RECV = 0x00010001,
}
///
/// 传输模式,可以为单播模式、组播模式等
///
public struct MV_CC_TRANSMISSION_TYPE
{
///
/// 传输模式
///
public MV_GIGE_TRANSMISSION_TYPE enTransmissionType;
///
/// 目标IP,组播模式下有意义
///
public UInt32 nDestIp;
///
/// 目标Port,组播模式下有意义
///
public UInt16 nDestPort;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public UInt32[] nReserved;
}
///
/// 动作命令信息
///
public struct MV_ACTION_CMD_INFO
{
///
/// 设备密钥
///
public UInt32 nDeviceKey;
///
/// 组键
///
public UInt32 nGroupKey;
///
/// 组掩码
///
public UInt32 nGroupMask;
///
/// 只有设置成1时Action Time才有效,非1时无效
///
public UInt32 bActionTimeEnable;
///
/// 预定的时间,和主频有关
///
public Int64 nActionTime;
///
/// 广播包地址
///
public String pBroadcastAddress;
///
/// 等待ACK的超时时间,如果为0表示不需要ACK
///
public UInt32 nTimeOut;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public UInt32[] nReserved;
}
///
/// 动作命令结果
///
public struct MV_ACTION_CMD_RESULT
{
///
/// IP address of the device
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public String strDeviceAddress;
///
/// status code returned by the device
///
public Int32 nStatus;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 动作命令结果列表
///
public struct MV_ACTION_CMD_RESULT_LIST
{
///
/// 返回值个数
///
public UInt32 nNumResults;
///
/// 返回的结果
///
public IntPtr pResults;
}
///
/// 每个节点对应的接口类型
///
public enum MV_XML_InterfaceType
{
///
/// IValue接口类型
///
IFT_IValue,
///
/// IBase接口类型
///
IFT_IBase,
///
/// IInteger接口类型
///
IFT_IInteger,
///
/// IBoolean接口类型
///
IFT_IBoolean,
///
/// ICommand接口类型
///
IFT_ICommand,
///
/// IFloat接口类型
///
IFT_IFloat,
///
/// IString接口类型
///
IFT_IString,
///
/// IRegister接口类型
///
IFT_IRegister,
///
/// ICategory接口类型
///
IFT_ICategory,
///
/// IEnumeration接口类型
///
IFT_IEnumeration,
///
/// IEnumEntry接口类型
///
IFT_IEnumEntry,
///
/// IPort接口类型
///
IFT_IPort,
}
///
/// XML节点特点
///
public struct MV_XML_NODE_FEATURE
{
///
/// 节点类型
///
public MV_XML_InterfaceType enType;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// XML节点列表
///
public struct MV_XML_NODES_LIST
{
///
/// 节点个数
///
public UInt32 nNodeNum;
///
/// 节点列表
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_XML_NODE_NUM_C)]
public MV_XML_NODE_FEATURE[] stNodes;
}
///
/// 整型节点值
///
public struct MVCC_INTVALUE
{
///
/// 当前值
///
public UInt32 nCurValue;
///
/// 最大值
///
public UInt32 nMax;
///
/// 最小值
///
public UInt32 nMin;
///
/// Inc
///
public UInt32 nInc;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 整型节点值
///
public struct MVCC_INTVALUE_EX
{
///
/// 当前值
///
public Int64 nCurValue;
///
/// 最大值
///
public Int64 nMax;
///
/// 最小值
///
public Int64 nMin;
///
/// Inc
///
public Int64 nInc;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public UInt32[] nReserved;
}
///
/// 浮点型节点值
///
public struct MVCC_FLOATVALUE
{
///
/// 当前值
///
public Single fCurValue;
///
/// 最大值
///
public Single fMax;
///
/// 最小值
///
public Single fMin;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 枚举型节点值
///
public struct MVCC_ENUMVALUE
{
///
/// 当前值
///
public UInt32 nCurValue;
///
/// 有效数据个数
///
public UInt32 nSupportedNum;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_XML_SYMBOLIC_NUM)]
public UInt32[] nSupportValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 字符串型节点值
///
public struct MVCC_STRINGVALUE
{
///
/// 当前值
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string chCurValue;
///
/// 节点值的最大长度
///
public Int64 nMaxLength;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public UInt32[] nReserved;
}
///
/// 节点的读写性
///
public enum MV_XML_AccessMode
{
///
/// 未实现
///
AM_NI,
///
/// 不可获取
///
AM_NA,
///
/// 只写
///
AM_WO,
///
/// 只读
///
AM_RO,
///
/// 可读可写
///
AM_RW,
///
/// 未定义
///
AM_Undefined,
///
/// 内部用于AccessMode循环检测
///
AM_CycleDetect
}
///
/// 整型节点
///
public struct MV_XML_FEATURE_Integer
{
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 当前值
///
public Int64 nValue;
///
/// 最小值
///
public Int64 nMinValue;
///
/// 最大值
///
public Int64 nMaxValue;
///
/// 增量
///
public Int64 nIncrement;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 布尔型节点
///
public struct MV_XML_FEATURE_Boolean
{
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 当前值
///
public bool bValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 命令型节点
///
public struct MV_XML_FEATURE_Command
{
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 浮点型节点
///
public struct MV_XML_FEATURE_Float
{
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 当前值
///
public Double dfValue;
///
/// 最小值
///
public Double dfMinValue;
///
/// 最大值
///
public Double dfMaxValue;
///
/// 增量
///
public Double dfIncrement;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 字符串类型节点
///
public struct MV_XML_FEATURE_String
{
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 当前值
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_STRVALUE_STRLEN_C)]
public string strValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 寄存器型节点
///
public struct MV_XML_FEATURE_Register
{
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 当前值
///
public Int64 nAddrValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// 类别属性
///
public struct MV_XML_FEATURE_Category
{
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// EnumEntry属性节点
///
public struct MV_XML_FEATURE_EnumEntry
{
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
///
///
public Int32 bIsImplemented;
///
/// 父节点数
///
public Int32 nParentsNum;
///
/// 父节点列表
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_XML_PARENTS_NUM)]
public MV_XML_NODE_FEATURE[] stParentsList;
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 当前值
///
public Int64 nValue;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nReserved;
}
///
/// 节点描述
///
[StructLayout(LayoutKind.Sequential)]
public struct StrSymbolic
{
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_SYMBOLIC_STRLEN_C)]
public string str;
}
///
/// Enumeration属性节点
///
public struct MV_XML_FEATURE_Enumeration
{
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// Symbolic数
///
public Int32 nSymbolicNum;
///
/// 当前Symbolic索引
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_SYMBOLIC_STRLEN_C)]
public string strCurrentSymbolic;
///
/// Symbolic索引
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_XML_SYMBOLIC_NUM)]
public StrSymbolic[] strSymbolic;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 当前值
///
public Int64 nValue;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
///
/// Port属性节点
///
public struct MV_XML_FEATURE_Port
{
///
/// 是否可见
///
public MV_XML_Visibility enVisivility;
///
/// 节点描述
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strDescription;
///
/// 显示名称
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strDisplayName;
///
/// 节点名
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_NODE_STRLEN_C)]
public string strName;
///
/// 提示
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MV_MAX_XML_DISC_STRLEN_C)]
public string strToolTip;
///
/// 访问模式
///
public MV_XML_AccessMode enAccessMode;
///
/// 是否锁定。0-否;1-是
///
public Int32 bIsLocked;
///
/// 保留字节
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
/// 辅助线颜色
public struct MVCC_COLORF
{
/// [0.0 , 1.0]
public float fR;
/// [0.0 , 1.0]
public float fG;
/// [0.0 , 1.0]
public float fB;
/// [0.0 , 1.0]
public float fAlpha;
/// 预留字节
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
/// 自定义点坐标
public struct MVCC_POINTF
{
/// [0.0 , 1.0]
public float fX;
/// [0.0 , 1.0]
public float fY;
/// 预留字节
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
/// 矩形框区域信息
public struct MVCC_RECT_INFO
{
/// [0.0 , 1.0]
public float fTop;
/// [0.0 , 1.0]
public float fBottom;
/// [0.0 , 1.0]
public float fLeft;
/// [0.0 , 1.0]
public float fRight;
/// 辅助线颜色
public MVCC_COLORF stColor;
/// 辅助线宽度
public UInt32 nLineWidth;
/// 预留字节
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
/// 圆形框区域信息
public struct MVCC_CIRCLE_INFO
{
/// 圆心信息
public MVCC_POINTF stCenterPoint;
/// 宽向半径,根据图像的相对位置[0, 1.0]
public float fR1;
/// 高向半径,根据图像的相对位置[0, 1.0]
public float fR2;
/// 辅助线颜色信息
public MVCC_COLORF stColor;
/// 辅助线宽度
public UInt32 nLineWidth;
/// 预留字节
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
/// 线条辅助线信息
public struct MVCC_LINES_INFO
{
/// 线条辅助线的起始点坐标
public MVCC_POINTF stStartPoint;
/// 线条辅助线的终点坐标
public MVCC_POINTF stEndPoint;
/// 辅助线颜色信息
public MVCC_COLORF stColor;
/// 辅助线宽度
public UInt32 nLineWidth;
/// 预留字节
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
/// 枚举类型指定条目信息
public struct MVCC_ENUMENTRY
{
/// 指定值
public UInt32 nValue;
/// 指定值对应的符号
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_SYMBOLIC_LEN)]
public Byte[] chSymbolic;
/// 预留字节
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
/// U3V流异常类型
public enum MV_CC_STREAM_EXCEPTION_TYPE
{
/// 异常的图像,该帧被丢弃
MV_CC_STREAM_EXCEPTION_ABNORMAL_IMAGE = 0x4001,
/// 缓存列表溢出,清除最旧的一帧
MV_CC_STREAM_EXCEPTION_LIST_OVERFLOW = 0x4002,
/// 缓存列表为空,该帧被丢弃
MV_CC_STREAM_EXCEPTION_LIST_EMPTY = 0x4003,
/// 断流恢复
MV_CC_STREAM_EXCEPTION_RECONNECTION = 0x4004,
/// 断流,恢复失败,取流被中止
MV_CC_STREAM_EXCEPTION_DISCONNECTED = 0x4005,
/// 设备异常,取流被中止
MV_CC_STREAM_EXCEPTION_DEVICE = 0x4006,
}
/// 重构后的图像列表
public struct MV_OUTPUT_IMAGE_INFO
{
/// 源图像宽
public UInt32 nWidth;
/// 源图像高
public UInt32 nHeight;
/// 像素格式
public MvGvspPixelType enPixelType;
/// 输出数据缓存
public IntPtr pBuf;
/// 输出数据长度
public UInt32 nBufLen;
/// 提供的输出缓冲区大小
public UInt32 nBufSize;
/// 预留字节
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public UInt32[] nReserved;
}
///
/// 分时曝光的图像处理方式
///
public enum MV_IMAGE_RECONSTRUCTION_METHOD
{
///
/// 源图像按行拆分成多张图像
///
MV_SPLIT_BY_LINE = 1,
}
/// 重构图像参数信息
public struct MV_RECONSTRUCT_IMAGE_PARAM
{
/// 源图像宽
public UInt32 nWidth;
/// 源图像高
public UInt32 nHeight;
/// 像素格式
public MvGvspPixelType enPixelType;
/// 输入数据缓存
public IntPtr pSrcData;
/// 输入数据长度
public UInt32 nSrcDataLen;
/// 曝光个数(1-8]
public UInt32 nExposureNum;
/// 图像重构方式
public MV_IMAGE_RECONSTRUCTION_METHOD enReconstructMethod;
///
/// 输出数据缓存信息
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MV_MAX_SPLIT_NUM)]
public MV_OUTPUT_IMAGE_INFO[] stDstBufList;
/// 预留字节
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public UInt32[] nReserved;
}
#endregion
#region 像素格式定义
///
/// 像素格式定义
///
public enum MvGvspPixelType
{
///
/// 未定义像素格式
///
PixelType_Gvsp_Undefined = -1,
///
/// Mono1p
///
PixelType_Gvsp_Mono1p = 0x01010037,
///
/// Mono2p
///
PixelType_Gvsp_Mono2p = 0x01020038,
///
/// Mono4p
///
PixelType_Gvsp_Mono4p = 0x01040039,
///
/// Mono8
///
PixelType_Gvsp_Mono8 = 0x01080001,
///
/// Mono8_Signed
///
PixelType_Gvsp_Mono8_Signed = 0x01080002,
///
/// Mono10
///
PixelType_Gvsp_Mono10 = 0x01100003,
///
/// Mono10_Packed
///
PixelType_Gvsp_Mono10_Packed = 0x010c0004,
///
/// Mono12
///
PixelType_Gvsp_Mono12 = 0x01100005,
///
/// Mono12_Packed
///
PixelType_Gvsp_Mono12_Packed = 0x010c0006,
///
/// Mono14
///
PixelType_Gvsp_Mono14 = 0x01100025,
///
/// Mono16
///
PixelType_Gvsp_Mono16 = 0x01100007,
///
/// BayerGR8
///
PixelType_Gvsp_BayerGR8 = 0x01080008,
///
/// BayerRG8
///
PixelType_Gvsp_BayerRG8 = 0x01080009,
///
/// BayerGB8
///
PixelType_Gvsp_BayerGB8 = 0x0108000a,
///
/// BayerBG8
///
PixelType_Gvsp_BayerBG8 = 0x0108000b,
///
/// BayerRBGG8
///
PixelType_Gvsp_BayerRBGG8 = 0x01080046,
///
/// BayerGR10
///
PixelType_Gvsp_BayerGR10 = 0x0110000c,
///
/// BayerRG10
///
PixelType_Gvsp_BayerRG10 = 0x0110000d,
///
/// BayerGB10
///
PixelType_Gvsp_BayerGB10 = 0x0110000e,
///
/// BayerBG10
///
PixelType_Gvsp_BayerBG10 = 0x0110000f,
///
/// BayerGR12
///
PixelType_Gvsp_BayerGR12 = 0x01100010,
///
/// BayerRG12
///
PixelType_Gvsp_BayerRG12 = 0x01100011,
///
/// BayerGB12
///
PixelType_Gvsp_BayerGB12 = 0x01100012,
///
/// BayerBG12
///
PixelType_Gvsp_BayerBG12 = 0x01100013,
///
/// BayerGR10_Packed
///
PixelType_Gvsp_BayerGR10_Packed = 0x010c0026,
///
/// BayerRG10_Packed
///
PixelType_Gvsp_BayerRG10_Packed = 0x010c0027,
///
/// BayerGB10_Packed
///
PixelType_Gvsp_BayerGB10_Packed = 0x010c0028,
///
/// BayerBG10_Packed
///
PixelType_Gvsp_BayerBG10_Packed = 0x010c0029,
///
/// BayerGR12_Packed
///
PixelType_Gvsp_BayerGR12_Packed = 0x010c002a,
/// BayerRG12_Packed
PixelType_Gvsp_BayerRG12_Packed = 0x010c002b,
/// BayerGB12_Packed
PixelType_Gvsp_BayerGB12_Packed = 0x010c002c,
/// BayerBG12_Packed
PixelType_Gvsp_BayerBG12_Packed = 0x010c002d,
/// BayerGR16
PixelType_Gvsp_BayerGR16 = 0x0110002e,
/// BayerRG16
PixelType_Gvsp_BayerRG16 = 0x0110002f,
/// BayerGB16
PixelType_Gvsp_BayerGB16 = 0x01100030,
/// BayerBG16
PixelType_Gvsp_BayerBG16 = 0x01100031,
/// RGB8_Packed
PixelType_Gvsp_RGB8_Packed = 0x02180014,
/// BGR8_Packed
PixelType_Gvsp_BGR8_Packed = 0x02180015,
/// RGBA8_Packed
PixelType_Gvsp_RGBA8_Packed = 0x02200016,
/// BGRA8_Packed
PixelType_Gvsp_BGRA8_Packed = 0x02200017,
/// RGB10_Packed
PixelType_Gvsp_RGB10_Packed = 0x02300018,
/// BGR10_Packed
PixelType_Gvsp_BGR10_Packed = 0x02300019,
/// RGB12_Packed
PixelType_Gvsp_RGB12_Packed = 0x0230001a,
/// BGR12_Packed
PixelType_Gvsp_BGR12_Packed = 0x0230001b,
/// RGB16_Packed
PixelType_Gvsp_RGB16_Packed = 0x02300033,
/// BGR16_Packed///
PixelType_Gvsp_BGR16_Packed = 0x0230004b,
/// RGBA16_Packed
PixelType_Gvsp_RGBA16_Packed = 0x02400040,
/// BGRA16_Packed
PixelType_Gvsp_BGRA16_Packed = 0x02400051,
/// RGB10V1_Packe
PixelType_Gvsp_RGB10V1_Packed = 0x0220001c,
/// RGB10V2_Packed
PixelType_Gvsp_RGB10V2_Packed = 0x0220001d,
/// RGB12V1_Packed
PixelType_Gvsp_RGB12V1_Packed = 0x02240034,
/// RGB565_Packed
PixelType_Gvsp_RGB565_Packed = 0x02100035,
/// BGR565_Packed
PixelType_Gvsp_BGR565_Packed = 0x02100036,
/// YUV411_Packed
PixelType_Gvsp_YUV411_Packed = 0x020c001e,
/// YUV422_Packed
PixelType_Gvsp_YUV422_Packed = 0x0210001f,
/// YUV422_YUYV_Packed
PixelType_Gvsp_YUV422_YUYV_Packed = 0x02100032,
/// YUV444_Packed
PixelType_Gvsp_YUV444_Packed = 0x02180020,
/// YCBCR8_CBYCR
PixelType_Gvsp_YCBCR8_CBYCR = 0x0218003a,
/// YCBCR422_8
PixelType_Gvsp_YCBCR422_8 = 0x0210003b,
/// YCBCR422_8_CBYCRY
PixelType_Gvsp_YCBCR422_8_CBYCRY = 0x02100043,
/// YCBCR411_8_CBYYCRYY
PixelType_Gvsp_YCBCR411_8_CBYYCRYY = 0x020c003c,
/// YCBCR601_8_CBYCR
PixelType_Gvsp_YCBCR601_8_CBYCR = 0x0218003d,
/// YCBCR601_422_8
PixelType_Gvsp_YCBCR601_422_8 = 0x0210003e,
/// YCBCR601_422_8_CBYCRY
PixelType_Gvsp_YCBCR601_422_8_CBYCRY = 0x02100044,
/// YCBCR601_411_8_CBYYCRYY
PixelType_Gvsp_YCBCR601_411_8_CBYYCRYY = 0x020c003f,
/// YCBCR709_8_CBYCR
PixelType_Gvsp_YCBCR709_8_CBYCR = 0x02180040,
/// YCBCR709_422_8
PixelType_Gvsp_YCBCR709_422_8 = 0x02100041,
/// YCBCR709_422_8_CBYCRY
PixelType_Gvsp_YCBCR709_422_8_CBYCRY = 0x02100045,
/// YCBCR709_411_8_CBYYCRYY
PixelType_Gvsp_YCBCR709_411_8_CBYYCRYY = 0x020c0042,
/// YUV420SP_NV12
PixelType_Gvsp_YUV420SP_NV12 = 0X020c8001,
/// YUV420SP_NV21
PixelType_Gvsp_YUV420SP_NV21 = 0X020c8002,
/// RGB8_Planar
PixelType_Gvsp_RGB8_Planar = 0x02180021,
/// RGB10_Planar
PixelType_Gvsp_RGB10_Planar = 0x02300022,
/// RGB12_Planar
PixelType_Gvsp_RGB12_Planar = 0x02300023,
/// RGB16_Planar
PixelType_Gvsp_RGB16_Planar = 0x02300024,
/// Jpeg
PixelType_Gvsp_Jpeg = unchecked((Int32)0x80180001),
/// Coord3D_ABC32f
PixelType_Gvsp_Coord3D_ABC32f = 0x026000C0,
/// Coord3D_ABC32f_Planar
PixelType_Gvsp_Coord3D_ABC32f_Planar = 0x026000C1,
/// Coord3D_AC32f
PixelType_Gvsp_Coord3D_AC32f = 0x024000C2,//3D coordinate A-C 32-bit floating point
/// COORD3D_DEPTH_PLUS_MASK
PixelType_Gvsp_COORD3D_DEPTH_PLUS_MASK = unchecked((Int32)0x821c0001),
/// Coord3D_ABC32
PixelType_Gvsp_Coord3D_ABC32 = unchecked((Int32)0x82603001),
/// Coord3D_AB32f
PixelType_Gvsp_Coord3D_AB32f = unchecked((Int32)0x82403002),
/// Coord3D_AB32
PixelType_Gvsp_Coord3D_AB32 = unchecked((Int32)0x82403003),
/// Coord3D_AC32f_64
PixelType_Gvsp_Coord3D_AC32f_64 = unchecked((Int32)0x024000C2),
/// Coord3D_AC32f_Planar
PixelType_Gvsp_Coord3D_AC32f_Planar = 0x024000C3,
/// Coord3D_AC32
PixelType_Gvsp_Coord3D_AC32 = unchecked((Int32)0x82403004),
/// Coord3D_A32f
PixelType_Gvsp_Coord3D_A32f = 0x012000BD,
/// Coord3D_A32
PixelType_Gvsp_Coord3D_A32 = unchecked((Int32)0x81203005),
/// Coord3D_C32f
PixelType_Gvsp_Coord3D_C32f = 0x012000BF,
/// Coord3D_C32
PixelType_Gvsp_Coord3D_C32 = unchecked((Int32)0x81203006),
/// Coord3D_ABC16
PixelType_Gvsp_Coord3D_ABC16 = 0x023000b9,
/// Coord3D_C16
PixelType_Gvsp_Coord3D_C16 = 0x011000b8,
/// Float32
PixelType_Gvsp_Float32 = unchecked((Int32)0x81200001),
//无损压缩像素格式定义
/// HB_Mono8
PixelType_Gvsp_HB_Mono8 = unchecked((Int32)0x81080001),
/// HB_Mono10
PixelType_Gvsp_HB_Mono10 = unchecked((Int32)0x81100003),
/// HB_Mono10_Packed
PixelType_Gvsp_HB_Mono10_Packed = unchecked((Int32)0x810c0004),
/// HB_Mono12
PixelType_Gvsp_HB_Mono12 = unchecked((Int32)0x81100005),
/// HB_Mono12_Packed
PixelType_Gvsp_HB_Mono12_Packed = unchecked((Int32)0x810c0006),
/// HB_Mono16
PixelType_Gvsp_HB_Mono16 = unchecked((Int32)0x81100007),
/// HB_BayerGR8
PixelType_Gvsp_HB_BayerGR8 = unchecked((Int32)0x81080008),
/// HB_BayerRG8
PixelType_Gvsp_HB_BayerRG8 = unchecked((Int32)0x81080009),
/// HB_BayerGB8
PixelType_Gvsp_HB_BayerGB8 = unchecked((Int32)0x8108000a),
/// HB_BayerBG8
PixelType_Gvsp_HB_BayerBG8 = unchecked((Int32)0x8108000b),
/// HB_BayerRBGG8
PixelType_Gvsp_HB_BayerRBGG8 = unchecked((Int32)0x81080046),
/// HB_BayerGR10
PixelType_Gvsp_HB_BayerGR10 = unchecked((Int32)0x8110000c),
/// HB_BayerRG10
PixelType_Gvsp_HB_BayerRG10 = unchecked((Int32)0x8110000d),
/// HB_BayerGB10
PixelType_Gvsp_HB_BayerGB10 = unchecked((Int32)0x8110000e),
/// HB_BayerBG10
PixelType_Gvsp_HB_BayerBG10 = unchecked((Int32)0x8110000f),
/// HB_BayerGR12
PixelType_Gvsp_HB_BayerGR12 = unchecked((Int32)0x81100010),
/// HB_BayerRG12
PixelType_Gvsp_HB_BayerRG12 = unchecked((Int32)0x81100011),
/// HB_BayerGB12
PixelType_Gvsp_HB_BayerGB12 = unchecked((Int32)0x81100012),
/// HB_BayerBG12
PixelType_Gvsp_HB_BayerBG12 = unchecked((Int32)0x81100013),
/// HB_BayerGR10_Packed
PixelType_Gvsp_HB_BayerGR10_Packed = unchecked((Int32)0x810c0026),
/// HB_BayerRG10_Packed
PixelType_Gvsp_HB_BayerRG10_Packed = unchecked((Int32)0x810c0027),
/// HB_BayerGB10_Packed
PixelType_Gvsp_HB_BayerGB10_Packed = unchecked((Int32)0x810c0028),
/// HB_BayerBG10_Packed
PixelType_Gvsp_HB_BayerBG10_Packed = unchecked((Int32)0x810c0029),
/// HB_BayerGR12_Packed
PixelType_Gvsp_HB_BayerGR12_Packed = unchecked((Int32)0x810c002a),
/// HB_BayerRG12_Packed
PixelType_Gvsp_HB_BayerRG12_Packed = unchecked((Int32)0x810c002b),
/// HB_BayerGB12_Packed
PixelType_Gvsp_HB_BayerGB12_Packed = unchecked((Int32)0x810c002c),
/// HB_BayerBG12_Packed
PixelType_Gvsp_HB_BayerBG12_Packed = unchecked((Int32)0x810c002d),
/// HB_YUV422_Packed
PixelType_Gvsp_HB_YUV422_Packed = unchecked((Int32)0x8210001f),
/// HB_YUV422_YUYV_Packed
PixelType_Gvsp_HB_YUV422_YUYV_Packed = unchecked((Int32)0x82100032),
/// HB_RGB8_Packed
PixelType_Gvsp_HB_RGB8_Packed = unchecked((Int32)0x82180014),
/// HB_BGR8_Packed
PixelType_Gvsp_HB_BGR8_Packed = unchecked((Int32)0x82180015),
/// HB_RGBA8_Packed
PixelType_Gvsp_HB_RGBA8_Packed = unchecked((Int32)0x82200016),
/// HB_BGRA8_Packed
PixelType_Gvsp_HB_BGRA8_Packed = unchecked((Int32)0x82200017),
/// HB_RGB16_Packed
PixelType_Gvsp_HB_RGB16_Packed = unchecked((Int32)0x82300033),
/// HB_BGR16_Packed
PixelType_Gvsp_HB_BGR16_Packed = unchecked((Int32)0x8230004B),
/// HB_RGBA16_Packed
PixelType_Gvsp_HB_RGBA16_Packed = unchecked((Int32)0x82400064),
/// HB_BGRA16_Packed
PixelType_Gvsp_HB_BGRA16_Packed = unchecked((Int32)0x82400051),
}
#endregion
#region 设备错误码定义
/// 成功,无错误
public const Int32 MV_OK = unchecked((Int32)0x00000000);
// 通用错误码定义:范围0x80000000-0x800000FF
/// 错误或无效的句柄
public const Int32 MV_E_HANDLE = unchecked((Int32)0x80000000);
/// 不支持的功能
public const Int32 MV_E_SUPPORT = unchecked((Int32)0x80000001);
/// 缓存已满
public const Int32 MV_E_BUFOVER = unchecked((Int32)0x80000002);
/// 函数调用顺序错误
public const Int32 MV_E_CALLORDER = unchecked((Int32)0x80000003);
/// 错误的参数
public const Int32 MV_E_PARAMETER = unchecked((Int32)0x80000004);
/// 资源申请失败
public const Int32 MV_E_RESOURCE = unchecked((Int32)0x80000006);
/// 无数据
public const Int32 MV_E_NODATA = unchecked((Int32)0x80000007);
/// 前置条件有误,或运行环境已发生变化
public const Int32 MV_E_PRECONDITION = unchecked((Int32)0x80000008);
/// 版本不匹配
public const Int32 MV_E_VERSION = unchecked((Int32)0x80000009);
/// 传入的内存空间不足
public const Int32 MV_E_NOENOUGH_BUF = unchecked((Int32)0x8000000A);
/// 异常图像,可能是丢包导致图像不完整
public const Int32 MV_E_ABNORMAL_IMAGE = unchecked((Int32)0x8000000B);
/// 动态导入DLL失败
public const Int32 MV_E_LOAD_LIBRARY = unchecked((Int32)0x8000000C);
/// 没有可输出的缓存
public const Int32 MV_E_NOOUTBUF = unchecked((Int32)0x8000000D);
/// 加密错误
public const Int32 MV_E_ENCRYPT = unchecked((Int32)0x8000000E);
/// 打开文件出现错误
public const Int32 MV_E_OPENFILE = unchecked((Int32)0x8000000F);
/// 未知的错误
public const Int32 MV_E_UNKNOW = unchecked((Int32)0x800000FF);
// GenICam系列错误:范围0x80000100-0x800001FF
/// 通用错误
public const Int32 MV_E_GC_GENERIC = unchecked((Int32)0x80000100);
/// 参数非法
public const Int32 MV_E_GC_ARGUMENT = unchecked((Int32)0x80000101);
/// 值超出范围
public const Int32 MV_E_GC_RANGE = unchecked((Int32)0x80000102);
/// 属性
public const Int32 MV_E_GC_PROPERTY = unchecked((Int32)0x80000103);
/// 运行环境有问题
public const Int32 MV_E_GC_RUNTIME = unchecked((Int32)0x80000104);
/// 逻辑错误
public const Int32 MV_E_GC_LOGICAL = unchecked((Int32)0x80000105);
/// 节点访问条件有误
public const Int32 MV_E_GC_ACCESS = unchecked((Int32)0x80000106);
/// 超时
public const Int32 MV_E_GC_TIMEOUT = unchecked((Int32)0x80000107);
/// 转换异常
public const Int32 MV_E_GC_DYNAMICCAST = unchecked((Int32)0x80000108);
/// GenICam未知错误
public const Int32 MV_E_GC_UNKNOW = unchecked((Int32)0x800001FF);
// GigE_STATUS对应的错误码:范围0x80000200-0x800002FF
/// 命令不被设备支持
public const Int32 MV_E_NOT_IMPLEMENTED = unchecked((Int32)0x80000200);
/// 访问的目标地址不存在
public const Int32 MV_E_INVALID_ADDRESS = unchecked((Int32)0x80000201);
/// 目标地址不可写
public const Int32 MV_E_WRITE_PROTECT = unchecked((Int32)0x80000202);
/// 设备无访问权限
public const Int32 MV_E_ACCESS_DENIED = unchecked((Int32)0x80000203);
/// 设备忙,或网络断开
public const Int32 MV_E_BUSY = unchecked((Int32)0x80000204);
/// 网络包数据错误
public const Int32 MV_E_PACKET = unchecked((Int32)0x80000205);
/// 网络相关错误
public const Int32 MV_E_NETER = unchecked((Int32)0x80000206);
/// 设备IP冲突
public const Int32 MV_E_IP_CONFLICT = unchecked((Int32)0x80000221);
// USB_STATUS对应的错误码:范围0x80000300-0x800003FF
/// 读usb出错
public const Int32 MV_E_USB_READ = unchecked((Int32)0x80000300);
/// 写usb出错
public const Int32 MV_E_USB_WRITE = unchecked((Int32)0x80000301);
/// 设备异常
public const Int32 MV_E_USB_DEVICE = unchecked((Int32)0x80000302);
/// GenICam相关错误
public const Int32 MV_E_USB_GENICAM = unchecked((Int32)0x80000303);
/// 带宽不足
public const Int32 MV_E_USB_BANDWIDTH = unchecked((Int32)0x80000304);
/// 驱动不匹配或者未装驱动
public const Int32 MV_E_USB_DRIVER = unchecked((Int32)0x80000305);
/// USB未知的错误
public const Int32 MV_E_USB_UNKNOW = unchecked((Int32)0x800003FF);
// 升级时对应的错误码:范围0x80000400-0x800004FF
/// 升级固件不匹配
public const Int32 MV_E_UPG_FILE_MISMATCH = unchecked((Int32)0x80000400);
/// 升级固件语言不匹配
public const Int32 MV_E_UPG_LANGUSGE_MISMATCH = unchecked((Int32)0x80000401);
/// 升级冲突(设备已经在升级了再次请求升级即返回此错误)
public const Int32 MV_E_UPG_CONFLICT = unchecked((Int32)0x80000402);
/// 升级时设备内部出现错误
public const Int32 MV_E_UPG_INNER_ERR = unchecked((Int32)0x80000403);
/// 升级时未知错误
public const Int32 MV_E_UPG_UNKNOW = unchecked((Int32)0x800004FF);
#endregion
#region 来自ISP算法库的错误码
// 通用类型
/// 处理正确
public const Int32 MV_ALG_OK = unchecked((Int32)0x00000000);
/// 不确定类型错误
public const Int32 MV_ALG_ERR = unchecked((Int32)0x10000000);
// 能力检查
/// 能力集中存在无效参数
public const Int32 MV_ALG_E_ABILITY_ARG = unchecked((Int32)0x10000001);
// 内存检查
/// 内存地址为空
public const Int32 MV_ALG_E_MEM_NULL = unchecked((Int32)0x10000002);
/// 内存对齐不满足要求
public const Int32 MV_ALG_E_MEM_ALIGN = unchecked((Int32)0x10000003);
/// 内存空间大小不够
public const Int32 MV_ALG_E_MEM_LACK = unchecked((Int32)0x10000004);
/// 内存空间大小不满足对齐要求
public const Int32 MV_ALG_E_MEM_SIZE_ALIGN = unchecked((Int32)0x10000005);
/// 内存地址不满足对齐要求
public const Int32 MV_ALG_E_MEM_ADDR_ALIGN = unchecked((Int32)0x10000006);
// 图像检查
/// 图像格式不正确或者不支持
public const Int32 MV_ALG_E_IMG_FORMAT = unchecked((Int32)0x10000007);
/// 图像宽高不正确或者超出范围
public const Int32 MV_ALG_E_IMG_SIZE = unchecked((Int32)0x10000008);
/// 图像宽高与step参数不匹配
public const Int32 MV_ALG_E_IMG_STEP = unchecked((Int32)0x10000009);
/// 图像数据存储地址为空
public const Int32 MV_ALG_E_IMG_DATA_NULL = unchecked((Int32)0x1000000A);
// 输入输出参数检查
/// 设置或者获取参数类型不正确
public const Int32 MV_ALG_E_CFG_TYPE = unchecked((Int32)0x1000000B);
/// 设置或者获取参数的输入、输出结构体大小不正确
public const Int32 MV_ALG_E_CFG_SIZE = unchecked((Int32)0x1000000C);
/// 处理类型不正确
public const Int32 MV_ALG_E_PRC_TYPE = unchecked((Int32)0x1000000D);
/// 处理时输入、输出参数大小不正确
public const Int32 MV_ALG_E_PRC_SIZE = unchecked((Int32)0x1000000E);
/// 子处理类型不正确
public const Int32 MV_ALG_E_FUNC_TYPE = unchecked((Int32)0x1000000F);
/// 子处理时输入、输出参数大小不正确
public const Int32 MV_ALG_E_FUNC_SIZE = unchecked((Int32)0x10000010);
// 运行参数检查
/// index参数不正确
public const Int32 MV_ALG_E_PARAM_INDEX = unchecked((Int32)0x10000011);
/// value参数不正确或者超出范围
public const Int32 MV_ALG_E_PARAM_VALUE = unchecked((Int32)0x10000012);
/// param_num参数不正确
public const Int32 MV_ALG_E_PARAM_NUM = unchecked((Int32)0x10000013);
// 接口调用检查
/// 函数参数指针为空
public const Int32 MV_ALG_E_NULL_PTR = unchecked((Int32)0x10000014);
/// 超过限定的最大内存
public const Int32 MV_ALG_E_OVER_MAX_MEM = unchecked((Int32)0x10000015);
/// 回调函数出错
public const Int32 MV_ALG_E_CALL_BACK = unchecked((Int32)0x10000016);
// 算法库加密相关检查
/// 加密错误
public const Int32 MV_ALG_E_ENCRYPT = unchecked((Int32)0x10000017);
/// 算法库使用期限错误
public const Int32 MV_ALG_E_EXPIRE = unchecked((Int32)0x10000018);
// 内部模块返回的基本错误类型
/// 参数范围不正确
public const Int32 MV_ALG_E_BAD_ARG = unchecked((Int32)0x10000019);
/// 数据大小不正确
public const Int32 MV_ALG_E_DATA_SIZE = unchecked((Int32)0x1000001A);
/// 数据step不正确
public const Int32 MV_ALG_E_STEP = unchecked((Int32)0x1000001B);
// cpu指令集支持错误码
/// cpu不支持优化代码中的指令集
public const Int32 MV_ALG_E_CPUID = unchecked((Int32)0x1000001C);
/// 警告
public const Int32 MV_ALG_WARNING = unchecked((Int32)0x1000001D);
/// 算法库超时
public const Int32 MV_ALG_E_TIME_OUT = unchecked((Int32)0x1000001E);
/// 算法版本号出错
public const Int32 MV_ALG_E_LIB_VERSION = unchecked((Int32)0x1000001F);
/// 模型版本号出错
public const Int32 MV_ALG_E_MODEL_VERSION = unchecked((Int32)0x10000020);
/// GPU内存分配错误
public const Int32 MV_ALG_E_GPU_MEM_ALLOC = unchecked((Int32)0x10000021);
/// 文件不存在
public const Int32 MV_ALG_E_FILE_NON_EXIST = unchecked((Int32)0x10000022);
/// 字符串为空
public const Int32 MV_ALG_E_NONE_STRING = unchecked((Int32)0x10000023);
/// 图像解码器错误
public const Int32 MV_ALG_E_IMAGE_CODEC = unchecked((Int32)0x10000024);
/// 打开文件错误
public const Int32 MV_ALG_E_FILE_OPEN = unchecked((Int32)0x10000025);
/// 文件读取错误
public const Int32 MV_ALG_E_FILE_READ = unchecked((Int32)0x10000026);
/// 文件写错误
public const Int32 MV_ALG_E_FILE_WRITE = unchecked((Int32)0x10000027);
/// 文件读取大小错误
public const Int32 MV_ALG_E_FILE_READ_SIZE = unchecked((Int32)0x10000028);
/// 文件类型错误
public const Int32 MV_ALG_E_FILE_TYPE = unchecked((Int32)0x10000029);
/// 模型类型错误
public const Int32 MV_ALG_E_MODEL_TYPE = unchecked((Int32)0x1000002A);
/// 分配内存错误
public const Int32 MV_ALG_E_MALLOC_MEM = unchecked((Int32)0x1000002B);
/// 线程绑核失败
public const Int32 MV_ALG_E_BIND_CORE_FAILED = unchecked((Int32)0x1000002C);
// 降噪特有错误码
/// 噪声特性图像格式错误
public const Int32 MV_ALG_E_DENOISE_NE_IMG_FORMAT = unchecked((Int32)0x10402001);
/// 噪声特性类型错误
public const Int32 MV_ALG_E_DENOISE_NE_FEATURE_TYPE = unchecked((Int32)0x10402002);
/// 噪声特性个数错误
public const Int32 MV_ALG_E_DENOISE_NE_PROFILE_NUM = unchecked((Int32)0x10402003);
/// 噪声特性增益个数错误
public const Int32 MV_ALG_E_DENOISE_NE_GAIN_NUM = unchecked((Int32)0x10402004);
/// 噪声曲线增益值输入错误
public const Int32 MV_ALG_E_DENOISE_NE_GAIN_VAL = unchecked((Int32)0x10402005);
/// 噪声曲线柱数错误
public const Int32 MV_ALG_E_DENOISE_NE_BIN_NUM = unchecked((Int32)0x10402006);
/// 噪声估计初始化增益设置错误
public const Int32 MV_ALG_E_DENOISE_NE_INIT_GAIN = unchecked((Int32)0x10402007);
/// 噪声估计未初始化
public const Int32 MV_ALG_E_DENOISE_NE_NOT_INIT = unchecked((Int32)0x10402008);
/// 颜色空间模式错误
public const Int32 MV_ALG_E_DENOISE_COLOR_MODE = unchecked((Int32)0x10402009);
/// 图像ROI个数错误
public const Int32 MV_ALG_E_DENOISE_ROI_NUM = unchecked((Int32)0x1040200a);
/// 图像ROI原点错误
public const Int32 MV_ALG_E_DENOISE_ROI_ORI_PT = unchecked((Int32)0x1040200b);
/// 图像ROI大小错误
public const Int32 MV_ALG_E_DENOISE_ROI_SIZE = unchecked((Int32)0x1040200c);
/// 输入的相机增益不存在(增益个数已达上限)
public const Int32 MV_ALG_E_DENOISE_GAIN_NOT_EXIST = unchecked((Int32)0x1040200d);
/// 输入的相机增益不在范围内
public const Int32 MV_ALG_E_DENOISE_GAIN_BEYOND_RANGE = unchecked((Int32)0x1040200e);
/// 输入的噪声特性内存大小错误
public const Int32 MV_ALG_E_DENOISE_NP_BUF_SIZE = unchecked((Int32)0x1040200f);
#endregion
#endregion
#region ch: 从C/C++接口库导出的函数 | en: C/C++ Load Function
[DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
private static extern void OutputDebugString(string message);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_EnumInterfaces")]
private static extern Int32 MV_CC_EnumInterfaces(UInt32 nTLayerType, ref MV_INTERFACE_INFO_LIST pInterfaceInfoList);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_CreateInterface")]
private static extern Int32 MV_CC_CreateInterface(ref IntPtr handle, ref MV_INTERFACE_INFO pInterfaceInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_CreateInterfaceByID")]
private static extern Int32 MV_CC_CreateInterfaceByID(ref IntPtr handle, String pInterfaceID);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_OpenInterface")]
private static extern Int32 MV_CC_OpenInterface(IntPtr handle, String pConfigFile);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_CloseInterface")]
private static extern Int32 MV_CC_CloseInterface(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_DestroyInterface")]
private static extern Int32 MV_CC_DestroyInterface(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_Initialize")]
private static extern Int32 MV_CC_Initialize();
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_Finalize")]
private static extern Int32 MV_CC_Finalize();
#region 相机的基本指令和操作函数
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetSDKVersion")]
private static extern UInt32 MV_CC_GetSDKVersion();
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_EnumerateTls")]
private static extern Int32 MV_CC_EnumerateTls();
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_EnumDevices")]
private static extern Int32 MV_CC_EnumDevices(UInt32 nTLayerType, ref MV_CC_DEVICE_INFO_LIST stDevList);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_EnumDevicesEx")]
private static extern Int32 MV_CC_EnumDevicesEx(UInt32 nTLayerType, ref MV_CC_DEVICE_INFO_LIST stDevList, String pManufacturerName);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_EnumDevicesEx2")]
private static extern Int32 MV_CC_EnumDevicesEx2(UInt32 nTLayerType, ref MV_CC_DEVICE_INFO_LIST stDevList, String pManufacturerName, MV_SORT_METHOD enSortMethod);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_IsDeviceAccessible")]
private static extern Byte MV_CC_IsDeviceAccessible(ref MV_CC_DEVICE_INFO stDevInfo, UInt32 nAccessMode);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetSDKLogPath")]
private static extern Int32 MV_CC_SetSDKLogPath(String pSDKLogPath);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_CreateHandle")]
private static extern Int32 MV_CC_CreateHandle(ref IntPtr handle, ref MV_CC_DEVICE_INFO stDevInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_CreateHandleWithoutLog")]
private static extern Int32 MV_CC_CreateHandleWithoutLog(ref IntPtr handle, ref MV_CC_DEVICE_INFO stDevInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_DestroyHandle")]
private static extern Int32 MV_CC_DestroyHandle(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_OpenDevice")]
private static extern Int32 MV_CC_OpenDevice(IntPtr handle, UInt32 nAccessMode, UInt16 nSwitchoverKey);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_CloseDevice")]
private static extern Int32 MV_CC_CloseDevice(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_IsDeviceConnected")]
private static extern Byte MV_CC_IsDeviceConnected(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RegisterImageCallBackEx")]
private static extern Int32 MV_CC_RegisterImageCallBackEx(IntPtr handle, cbOutputExdelegate cbOutput, IntPtr pUser);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RegisterImageCallBackForRGB")]
private static extern Int32 MV_CC_RegisterImageCallBackForRGB(IntPtr handle, cbOutputExdelegate cbOutput, IntPtr pUser);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RegisterImageCallBackForBGR")]
private static extern Int32 MV_CC_RegisterImageCallBackForBGR(IntPtr handle, cbOutputExdelegate cbOutput, IntPtr pUser);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_StartGrabbing")]
private static extern Int32 MV_CC_StartGrabbing(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_StopGrabbing")]
private static extern Int32 MV_CC_StopGrabbing(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetImageForRGB")]
private static extern Int32 MV_CC_GetImageForRGB(IntPtr handle, IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO_EX pFrameInfo, Int32 nMsec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetImageForBGR")]
private static extern Int32 MV_CC_GetImageForBGR(IntPtr handle, IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO_EX pFrameInfo, Int32 nMsec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetImageBuffer")]
private static extern Int32 MV_CC_GetImageBuffer(IntPtr handle, ref MV_FRAME_OUT pFrame, Int32 nMsec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_FreeImageBuffer")]
private static extern Int32 MV_CC_FreeImageBuffer(IntPtr handle, ref MV_FRAME_OUT pFrame);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetOneFrameTimeout")]
private static extern Int32 MV_CC_GetOneFrameTimeout(IntPtr handle, IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO_EX pFrameInfo, Int32 nMsec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_ClearImageBuffer")]
private static extern Int32 MV_CC_ClearImageBuffer(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetValidImageNum")]
private static extern Int32 MV_CC_GetValidImageNum(IntPtr handle, ref UInt32 pnValidImageNum);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_DisplayOneFrame")]
private static extern Int32 MV_CC_DisplayOneFrame(IntPtr handle, ref MV_DISPLAY_FRAME_INFO pDisplayInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_DisplayOneFrameEx")]
private static extern Int32 MV_CC_DisplayOneFrameEx(IntPtr handle, IntPtr hWnd, ref MV_DISPLAY_FRAME_INFO_EX pDisplayInfoEx);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetImageNodeNum")]
private static extern Int32 MV_CC_SetImageNodeNum(IntPtr handle, UInt32 nNum);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetGrabStrategy")]
private static extern Int32 MV_CC_SetGrabStrategy(IntPtr handle, MV_GRAB_STRATEGY enGrabStrategy);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetOutputQueueSize")]
private static extern Int32 MV_CC_SetOutputQueueSize(IntPtr handle, UInt32 nOutputQueueSize);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetDeviceInfo")]
private static extern Int32 MV_CC_GetDeviceInfo(IntPtr handle, ref MV_CC_DEVICE_INFO pstDevInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetAllMatchInfo")]
private static extern Int32 MV_CC_GetAllMatchInfo(IntPtr handle, ref MV_ALL_MATCH_INFO pstInfo);
#endregion
#region 设置和获取相机参数的万能接口
/************************************************************************/
/* 设置和获取相机参数的万能接口 */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetIntValueEx")]
private static extern Int32 MV_CC_GetIntValueEx(IntPtr handle, String strValue, ref MVCC_INTVALUE_EX pIntValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetIntValueEx")]
private static extern Int32 MV_CC_SetIntValueEx(IntPtr handle, String strValue, Int64 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetEnumValue")]
private static extern Int32 MV_CC_GetEnumValue(IntPtr handle, String strValue, ref MVCC_ENUMVALUE pEnumValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetEnumValue")]
private static extern Int32 MV_CC_SetEnumValue(IntPtr handle, String strValue, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetEnumEntrySymbolic")]
private static extern Int32 MV_CC_GetEnumEntrySymbolic(IntPtr handle, string strKey, ref MVCC_ENUMENTRY pstEnumEntry);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetEnumValueByString")]
private static extern Int32 MV_CC_SetEnumValueByString(IntPtr handle, String strValue, String sValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetFloatValue")]
private static extern Int32 MV_CC_GetFloatValue(IntPtr handle, String strValue, ref MVCC_FLOATVALUE pFloatValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetFloatValue")]
private static extern Int32 MV_CC_SetFloatValue(IntPtr handle, String strValue, Single fValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetBoolValue")]
private static extern Int32 MV_CC_GetBoolValue(IntPtr handle, String strValue, ref Boolean pBoolValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBoolValue")]
private static extern Int32 MV_CC_SetBoolValue(IntPtr handle, String strValue, Boolean bValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetStringValue")]
private static extern Int32 MV_CC_GetStringValue(IntPtr handle, String strKey, ref MVCC_STRINGVALUE pStringValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetStringValue")]
private static extern Int32 MV_CC_SetStringValue(IntPtr handle, String strKey, String sValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetCommandValue")]
private static extern Int32 MV_CC_SetCommandValue(IntPtr handle, String strValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_InvalidateNodes")]
private static extern Int32 MV_CC_InvalidateNodes(IntPtr handle);
#endregion
#region 设备升级 和 寄存器读写 和异常、事件回调
/************************************************************************/
/* 设备升级 和 寄存器读写 和异常、事件回调 */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_LocalUpgrade")]
private static extern Int32 MV_CC_LocalUpgrade(IntPtr handle, String pFilePathName);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetUpgradeProcess")]
private static extern Int32 MV_CC_GetUpgradeProcess(IntPtr handle, ref UInt32 pnProcess);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_ReadMemory")]
private static extern Int32 MV_CC_ReadMemory(IntPtr handle, IntPtr pBuffer, Int64 nAddress, Int64 nLength);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_WriteMemory")]
private static extern Int32 MV_CC_WriteMemory(IntPtr handle, IntPtr pBuffer, Int64 nAddress, Int64 nLength);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RegisterExceptionCallBack")]
private static extern Int32 MV_CC_RegisterExceptionCallBack(IntPtr handle, cbExceptiondelegate cbException, IntPtr pUser);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RegisterEventCallBack")]
private static extern Int32 MV_CC_RegisterEventCallBack(IntPtr handle, cbEventdelegate cbEvent, IntPtr pUser);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RegisterAllEventCallBack")]
private static extern Int32 MV_CC_RegisterAllEventCallBack(IntPtr handle, cbEventdelegateEx cbEvent, IntPtr pUser);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RegisterEventCallBackEx")]
private static extern Int32 MV_CC_RegisterEventCallBackEx(IntPtr handle, String pEventName, cbEventdelegateEx cbEvent, IntPtr pUser);
#endregion
#region GigEVision 设备独有的接口
/************************************************************************/
/* GigEVision 设备独有的接口 */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetEnumDevTimeout")]
private static extern Int32 MV_GIGE_SetEnumDevTimeout(UInt32 nMilTimeout);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_ForceIpEx")]
private static extern Int32 MV_GIGE_ForceIpEx(IntPtr handle, UInt32 nIP, UInt32 nSubNetMask, UInt32 nDefaultGateWay);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetIpConfig")]
private static extern Int32 MV_GIGE_SetIpConfig(IntPtr handle, UInt32 nType);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetNetTransMode")]
private static extern Int32 MV_GIGE_SetNetTransMode(IntPtr handle, UInt32 nType);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetNetTransInfo")]
private static extern Int32 MV_GIGE_GetNetTransInfo(IntPtr handle, ref MV_NETTRANS_INFO pstInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetDiscoveryMode")]
private static extern Int32 MV_GIGE_SetDiscoveryMode(UInt32 nMode);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetGvspTimeout")]
private static extern Int32 MV_GIGE_SetGvspTimeout(IntPtr handle, UInt32 nMillisec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetGvspTimeout")]
private static extern Int32 MV_GIGE_GetGvspTimeout(IntPtr handle, ref UInt32 pMillisec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetGvcpTimeout")]
private static extern Int32 MV_GIGE_SetGvcpTimeout(IntPtr handle, UInt32 nMillisec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetGvcpTimeout")]
private static extern Int32 MV_GIGE_GetGvcpTimeout(IntPtr handle, ref UInt32 pMillisec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetRetryGvcpTimes")]
private static extern Int32 MV_GIGE_SetRetryGvcpTimes(IntPtr handle, UInt32 nRetryGvcpTimes);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetRetryGvcpTimes")]
private static extern Int32 MV_GIGE_GetRetryGvcpTimes(IntPtr handle, ref UInt32 pRetryGvcpTimes);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetOptimalPacketSize")]
private static extern Int32 MV_CC_GetOptimalPacketSize(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetResend")]
private static extern Int32 MV_GIGE_SetResend(IntPtr handle, UInt32 bEnable, UInt32 nMaxResendPercent, UInt32 nResendTimeout);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetResendMaxRetryTimes")]
private static extern Int32 MV_GIGE_SetResendMaxRetryTimes(IntPtr handle, UInt32 nRetryTimes);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetResendMaxRetryTimes")]
private static extern Int32 MV_GIGE_GetResendMaxRetryTimes(IntPtr handle, ref UInt32 pnRetryTimes);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetResendTimeInterval")]
private static extern Int32 MV_GIGE_SetResendTimeInterval(IntPtr handle, UInt32 nMillisec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetResendTimeInterval")]
private static extern Int32 MV_GIGE_GetResendTimeInterval(IntPtr handle, ref UInt32 pnMillisec);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetTransmissionType")]
private static extern Int32 MV_GIGE_SetTransmissionType(IntPtr handle, ref MV_CC_TRANSMISSION_TYPE pstTransmissionType);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_IssueActionCommand")]
private static extern Int32 MV_GIGE_IssueActionCommand(ref MV_ACTION_CMD_INFO pstActionCmdInfo, ref MV_ACTION_CMD_RESULT_LIST pstActionCmdResults);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetMulticastStatus")]
private static extern Int32 MV_GIGE_GetMulticastStatus(ref MV_CC_DEVICE_INFO pstDevInfo, ref Boolean pStatus);
#endregion
#region CameraLink独有的接口
//CameraLink独有的接口
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CAML_SetDeviceBauderate")]
private static extern Int32 MV_CAML_SetDeviceBaudrate(IntPtr handle, UInt32 nBaudrate);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CAML_GetDeviceBauderate")]
private static extern Int32 MV_CAML_GetDeviceBaudrate(IntPtr handle, ref UInt32 pnCurrentBaudrate);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CAML_GetSupportBauderates")]
private static extern Int32 MV_CAML_GetSupportBaudrates(IntPtr handle, ref UInt32 pnBaudrateAblity);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CAML_SetGenCPTimeOut")]
private static extern Int32 MV_CAML_SetGenCPTimeOut(IntPtr handle, UInt32 nMillisec);
#endregion
#region U3V 设备独有的接口
/************************************************************************/
/* U3V 设备独有的接口 */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_USB_SetTransferSize")]
private static extern Int32 MV_USB_SetTransferSize(IntPtr handle, UInt32 nTransferSize);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_USB_GetTransferSize")]
private static extern Int32 MV_USB_GetTransferSize(IntPtr handle, ref UInt32 pTransferSize);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_USB_SetTransferWays")]
private static extern Int32 MV_USB_SetTransferWays(IntPtr handle, UInt32 nTransferWays);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_USB_GetTransferWays")]
private static extern Int32 MV_USB_GetTransferWays(IntPtr handle, ref UInt32 pTransferWays);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_USB_RegisterStreamExceptionCallBack")]
private static extern Int32 MV_USB_RegisterStreamExceptionCallBack(IntPtr handle, cbStreamException cbException, IntPtr pUser);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_USB_SetEventNodeNum")]
private static extern Int32 MV_USB_SetEventNodeNum(IntPtr handle, UInt32 nEventNodeNum);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_USB_SetSyncTimeOut")]
private static extern Int32 MV_USB_SetSyncTimeOut(IntPtr handle, UInt32 nMills);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_USB_GetSyncTimeOut")]
private static extern Int32 MV_USB_GetSyncTimeOut(IntPtr handle, ref UInt32 pnMills);
#endregion
#region GenTL相关接口,其它接口可以复用(部分接口不支持)
/************************************************************************/
/* GenTL相关接口,其它接口可以复用(部分接口不支持) */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_EnumInterfacesByGenTL")]
private static extern Int32 MV_CC_EnumInterfacesByGenTL(ref MV_GENTL_IF_INFO_LIST pstIFInfoList, String sGenTLPath);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_EnumDevicesByGenTL")]
private static extern Int32 MV_CC_EnumDevicesByGenTL(ref MV_GENTL_IF_INFO stIFInfo, ref MV_GENTL_DEV_INFO_LIST pstDevList);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_UnloadGenTLLibrary")]
private static extern Int32 MV_CC_UnloadGenTLLibrary(String strGenTLPath);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_CreateHandleByGenTL")]
private static extern Int32 MV_CC_CreateHandleByGenTL(ref IntPtr handle, ref MV_GENTL_DEV_INFO stDevInfo);
#endregion
#region XML解析树的生成
/************************************************************************/
/* XML解析树的生成 */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_GetGenICamXML")]
private static extern Int32 MV_XML_GetGenICamXML(IntPtr handle, IntPtr pData, UInt32 nDataSize, ref UInt32 pnDataLen);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_GetNodeAccessMode")]
private static extern Int32 MV_XML_GetNodeAccessMode(IntPtr handle, String pstrName, ref MV_XML_AccessMode pAccessMode);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_GetNodeInterfaceType")]
private static extern Int32 MV_XML_GetNodeInterfaceType(IntPtr handle, String pstrName, ref MV_XML_InterfaceType pInterfaceType);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_GetRootNode")]
private static extern Int32 MV_XML_GetRootNode(IntPtr handle, ref MV_XML_NODE_FEATURE pstNode);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_GetChildren")]
private static extern Int32 MV_XML_GetChildren(IntPtr handle, ref MV_XML_NODE_FEATURE pstNode, IntPtr pstNodesList);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_GetChildren")]
private static extern Int32 MV_XML_GetChildren(IntPtr handle, ref MV_XML_NODE_FEATURE pstNode, ref MV_XML_NODES_LIST pstNodesList);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_GetNodeFeature")]
private static extern Int32 MV_XML_GetNodeFeature(IntPtr handle, ref MV_XML_NODE_FEATURE pstNode, IntPtr pstFeature);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_UpdateNodeFeature")]
private static extern Int32 MV_XML_UpdateNodeFeature(IntPtr handle, MV_XML_InterfaceType enType, IntPtr pstFeature);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_XML_RegisterUpdateCallBack")]
private static extern Int32 MV_XML_RegisterUpdateCallBack(IntPtr handle, cbXmlUpdatedelegate cbXmlUpdate, IntPtr pUser);
#endregion
#region 附加接口
/************************************************************************/
/* 附加接口 */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SaveImageEx3")]
private static extern Int32 MV_CC_SaveImageEx3(IntPtr handle, ref MV_SAVE_IMAGE_PARAM_EX3 stSaveParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SaveImageToFileEx")]
private static extern Int32 MV_CC_SaveImageToFileEx(IntPtr handle, ref MV_SAVE_IMG_TO_FILE_PARAM_EX pstSaveFileParamEx);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SavePointCloudData")]
private static extern Int32 MV_CC_SavePointCloudData(IntPtr handle, ref MV_SAVE_POINT_CLOUD_PARAM pstPointDataParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RotateImage")]
private static extern Int32 MV_CC_RotateImage(IntPtr handle, ref MV_CC_ROTATE_IMAGE_PARAM pstRotateParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_FlipImage")]
private static extern Int32 MV_CC_FlipImage(IntPtr handle, ref MV_CC_FLIP_IMAGE_PARAM pstFlipParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_ConvertPixelTypeEx")]
private static extern Int32 MV_CC_ConvertPixelTypeEx(IntPtr handle, ref MV_CC_PIXEL_CONVERT_PARAM_EX pstCvtParamEx);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetGammaValue")]
private static extern Int32 MV_CC_SetGammaValue(IntPtr handle, MvGvspPixelType enSrcPixelType, Single fGammaValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBayerCvtQuality")]
private static extern Int32 MV_CC_SetBayerCvtQuality(IntPtr handle, UInt32 BayerCvtQuality);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBayerFilterEnable")]
private static extern Int32 MV_CC_SetBayerFilterEnable(IntPtr handle, Boolean bFilterEnable);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBayerGammaParam")]
private static extern Int32 MV_CC_SetBayerGammaParam(IntPtr handle, ref MV_CC_GAMMA_PARAM pstGammaParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBayerCCMParam")]
private static extern Int32 MV_CC_SetBayerCCMParam(IntPtr handle, ref MV_CC_CCM_PARAM pstCCMParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBayerCCMParamEx")]
private static extern Int32 MV_CC_SetBayerCCMParamEx(IntPtr handle, ref MV_CC_CCM_PARAM_EX pstCCMParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_ImageContrast")]
private static extern Int32 MV_CC_ImageContrast(IntPtr handle, ref MV_CC_CONTRAST_PARAM pstContrastParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_HB_Decode")]
private static extern Int32 MV_CC_HB_Decode(IntPtr handle, ref MV_CC_HB_DECODE_PARAM pstDecodeParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_DrawRect")]
private static extern Int32 MV_CC_DrawRect(IntPtr handle, ref MVCC_RECT_INFO pRectInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_DrawCircle")]
private static extern Int32 MV_CC_DrawCircle(IntPtr handle, ref MVCC_CIRCLE_INFO pCircleInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_DrawLines")]
private static extern Int32 MV_CC_DrawLines(IntPtr handle, ref MVCC_LINES_INFO pLinesInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_FeatureSave")]
private static extern Int32 MV_CC_FeatureSave(IntPtr handle, String pFileName);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_FeatureLoad")]
private static extern Int32 MV_CC_FeatureLoad(IntPtr handle, String pFileName);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_FileAccessRead")]
private static extern Int32 MV_CC_FileAccessRead(IntPtr handle, ref MV_CC_FILE_ACCESS pstFileAccess);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_FileAccessReadEx")]
private static extern Int32 MV_CC_FileAccessReadEx(IntPtr handle, ref MV_CC_FILE_ACCESS_EX pstFileAccessEx);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_FileAccessWrite")]
private static extern Int32 MV_CC_FileAccessWrite(IntPtr handle, ref MV_CC_FILE_ACCESS pstFileAccess);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_FileAccessWriteEx")]
private static extern Int32 MV_CC_FileAccessWriteEx(IntPtr handle, ref MV_CC_FILE_ACCESS_EX pstFileAccessEx);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetFileAccessProgress")]
private static extern Int32 MV_CC_GetFileAccessProgress(IntPtr handle, ref MV_CC_FILE_ACCESS_PROGRESS pstFileAccessProgress);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_StartRecord")]
private static extern Int32 MV_CC_StartRecord(IntPtr handle, ref MV_CC_RECORD_PARAM pstRecordParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_InputOneFrame")]
private static extern Int32 MV_CC_InputOneFrame(IntPtr handle, ref MV_CC_INPUT_FRAME_INFO pstInputFrameInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_StopRecord")]
private static extern Int32 MV_CC_StopRecord(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_OpenParamsGUI")]
private static extern Int32 MV_CC_OpenParamsGUI(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_ReconstructImage")]
private static extern Int32 MV_CC_ReconstructImage(IntPtr handle, ref MV_RECONSTRUCT_IMAGE_PARAM pstReconstructParam);
#endregion
#region 弃用的接口
/************************************************************************/
/* 弃用的接口 */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SaveImageEx2")]
private static extern Int32 MV_CC_SaveImageEx2(IntPtr handle, ref MV_SAVE_IMAGE_PARAM_EX2 stSaveParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SaveImageToFile")]
private static extern Int32 MV_CC_SaveImageToFile(IntPtr handle, ref MV_SAVE_IMG_TO_FILE_PARAM pstSaveFileParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_ConvertPixelType")]
private static extern Int32 MV_CC_ConvertPixelType(IntPtr handle, ref MV_PIXEL_CONVERT_PARAM pstCvtParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetOneFrame")]
private static extern Int32 MV_CC_GetOneFrame(IntPtr handle, IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO pFrameInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetOneFrameEx")]
private static extern Int32 MV_CC_GetOneFrameEx(IntPtr handle, IntPtr pData, UInt32 nDataSize, ref MV_FRAME_OUT_INFO_EX pFrameInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_RegisterImageCallBack")]
private static extern Int32 MV_CC_RegisterImageCallBack(IntPtr handle, cbOutputdelegate cbOutput, IntPtr pUser);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SaveImage")]
private static extern Int32 MV_CC_SaveImage(ref MV_SAVE_IMAGE_PARAM stSaveParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_ForceIp")]
private static extern Int32 MV_GIGE_ForceIp(IntPtr handle, UInt32 nIP);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_BayerNoiseEstimate")]
private static extern Int32 MV_CC_BayerNoiseEstimate(IntPtr handle, ref MV_CC_BAYER_NOISE_ESTIMATE_PARAM pstNoiseEstimateParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_BayerSpatialDenoise")]
private static extern Int32 MV_CC_BayerSpatialDenoise(IntPtr handle, ref MV_CC_BAYER_SPATIAL_DENOISE_PARAM pstSpatialDenoiseParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_Display")]
private static extern Int32 MV_CC_Display(IntPtr handle, IntPtr hWnd);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetImageInfo")]
private static extern Int32 MV_CC_GetImageInfo(IntPtr handle, ref MV_IMAGE_BASIC_INFO pstInfo);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetGevSCPSPacketSize")]
private static extern Int32 MV_GIGE_GetGevSCPSPacketSize(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetGevSCPSPacketSize")]
private static extern Int32 MV_GIGE_SetGevSCPSPacketSize(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetGevSCPD")]
private static extern Int32 MV_GIGE_GetGevSCPD(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetGevSCPD")]
private static extern Int32 MV_GIGE_SetGevSCPD(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetGevSCDA")]
private static extern Int32 MV_GIGE_GetGevSCDA(IntPtr handle, ref UInt32 pnIP);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetGevSCDA")]
private static extern Int32 MV_GIGE_SetGevSCDA(IntPtr handle, UInt32 nIP);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_GetGevSCSP")]
private static extern Int32 MV_GIGE_GetGevSCSP(IntPtr handle, ref UInt32 pnPort);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_GIGE_SetGevSCSP")]
private static extern Int32 MV_GIGE_SetGevSCSP(IntPtr handle, UInt32 nPort);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBayerCLUTParam")]
private static extern Int32 MV_CC_SetBayerCLUTParam(IntPtr handle, ref MV_CC_CLUT_PARAM pstCLUTParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_ImageSharpen")]
private static extern Int32 MV_CC_ImageSharpen(IntPtr handle, ref MV_CC_SHARPEN_PARAM pstSharpenParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_ColorCorrect")]
private static extern Int32 MV_CC_ColorCorrect(IntPtr handle, ref MV_CC_COLOR_CORRECT_PARAM pstColorCorrectParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_NoiseEstimate")]
private static extern Int32 MV_CC_NoiseEstimate(IntPtr handle, ref MV_CC_NOISE_ESTIMATE_PARAM pstNoiseEstimateParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SpatialDenoise")]
private static extern Int32 MV_CC_SpatialDenoise(IntPtr handle, ref MV_CC_SPATIAL_DENOISE_PARAM pstSpatialDenoiseParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_LSCCalib")]
private static extern Int32 MV_CC_LSCCalib(IntPtr handle, ref MV_CC_LSC_CALIB_PARAM pstLSCCalibParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_LSCCorrect")]
private static extern Int32 MV_CC_LSCCorrect(IntPtr handle, ref MV_CC_LSC_CORRECT_PARAM pstLSCCorrectParam);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetTlProxy")]
private static extern IntPtr MV_CC_GetTlProxy(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_WriteLog")]
private static extern Int32 MV_CC_WriteLog(string strLog);
/************************************************************************/
/* 相机参数获取和设置,此模块的所有接口,将逐步废弃,建议用上面的万能接口代替 */
/************************************************************************/
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetIntValue")]
private static extern Int32 MV_CC_GetIntValue(IntPtr handle, String strValue, ref MVCC_INTVALUE pIntValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetIntValue")]
private static extern Int32 MV_CC_SetIntValue(IntPtr handle, String strValue, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetWidth")]
private static extern Int32 MV_CC_GetWidth(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetWidth")]
private static extern Int32 MV_CC_SetWidth(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetHeight")]
private static extern Int32 MV_CC_GetHeight(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetHeight")]
private static extern Int32 MV_CC_SetHeight(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetAOIoffsetX")]
private static extern Int32 MV_CC_GetAOIoffsetX(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetAOIoffsetX")]
private static extern Int32 MV_CC_SetAOIoffsetX(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetAOIoffsetY")]
private static extern Int32 MV_CC_GetAOIoffsetY(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetAOIoffsetY")]
private static extern Int32 MV_CC_SetAOIoffsetY(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetAutoExposureTimeLower")]
private static extern Int32 MV_CC_GetAutoExposureTimeLower(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetAutoExposureTimeLower")]
private static extern Int32 MV_CC_SetAutoExposureTimeLower(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetAutoExposureTimeUpper")]
private static extern Int32 MV_CC_GetAutoExposureTimeUpper(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetAutoExposureTimeUpper")]
private static extern Int32 MV_CC_SetAutoExposureTimeUpper(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetBrightness")]
private static extern Int32 MV_CC_GetBrightness(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBrightness")]
private static extern Int32 MV_CC_SetBrightness(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetFrameRate")]
private static extern Int32 MV_CC_GetFrameRate(IntPtr handle, ref MVCC_FLOATVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetFrameRate")]
private static extern Int32 MV_CC_SetFrameRate(IntPtr handle, Single fValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetGain")]
private static extern Int32 MV_CC_GetGain(IntPtr handle, ref MVCC_FLOATVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetGain")]
private static extern Int32 MV_CC_SetGain(IntPtr handle, Single fValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetExposureTime")]
private static extern Int32 MV_CC_GetExposureTime(IntPtr handle, ref MVCC_FLOATVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetExposureTime")]
private static extern Int32 MV_CC_SetExposureTime(IntPtr handle, Single fValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetPixelFormat")]
private static extern Int32 MV_CC_GetPixelFormat(IntPtr handle, ref MVCC_ENUMVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetPixelFormat")]
private static extern Int32 MV_CC_SetPixelFormat(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetAcquisitionMode")]
private static extern Int32 MV_CC_GetAcquisitionMode(IntPtr handle, ref MVCC_ENUMVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetAcquisitionMode")]
private static extern Int32 MV_CC_SetAcquisitionMode(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetGainMode")]
private static extern Int32 MV_CC_GetGainMode(IntPtr handle, ref MVCC_ENUMVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetGainMode")]
private static extern Int32 MV_CC_SetGainMode(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetExposureAutoMode")]
private static extern Int32 MV_CC_GetExposureAutoMode(IntPtr handle, ref MVCC_ENUMVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetExposureAutoMode")]
private static extern Int32 MV_CC_SetExposureAutoMode(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetTriggerMode")]
private static extern Int32 MV_CC_GetTriggerMode(IntPtr handle, ref MVCC_ENUMVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetTriggerMode")]
private static extern Int32 MV_CC_SetTriggerMode(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetTriggerDelay")]
private static extern Int32 MV_CC_GetTriggerDelay(IntPtr handle, ref MVCC_FLOATVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetTriggerDelay")]
private static extern Int32 MV_CC_SetTriggerDelay(IntPtr handle, Single fValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetTriggerSource")]
private static extern Int32 MV_CC_GetTriggerSource(IntPtr handle, ref MVCC_ENUMVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetTriggerSource")]
private static extern Int32 MV_CC_SetTriggerSource(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_TriggerSoftwareExecute")]
private static extern Int32 MV_CC_TriggerSoftwareExecute(IntPtr handle);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetGammaSelector")]
private static extern Int32 MV_CC_GetGammaSelector(IntPtr handle, ref MVCC_ENUMVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetGammaSelector")]
private static extern Int32 MV_CC_SetGammaSelector(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetGamma")]
private static extern Int32 MV_CC_GetGamma(IntPtr handle, ref MVCC_FLOATVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetGamma")]
private static extern Int32 MV_CC_SetGamma(IntPtr handle, Single fValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetSharpness")]
private static extern Int32 MV_CC_GetSharpness(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetSharpness")]
private static extern Int32 MV_CC_SetSharpness(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetHue")]
private static extern Int32 MV_CC_GetHue(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetHue")]
private static extern Int32 MV_CC_SetHue(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetSaturation")]
private static extern Int32 MV_CC_GetSaturation(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetSaturation")]
private static extern Int32 MV_CC_SetSaturation(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetBalanceWhiteAuto")]
private static extern Int32 MV_CC_GetBalanceWhiteAuto(IntPtr handle, ref MVCC_ENUMVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBalanceWhiteAuto")]
private static extern Int32 MV_CC_SetBalanceWhiteAuto(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetBalanceRatioRed")]
private static extern Int32 MV_CC_GetBalanceRatioRed(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBalanceRatioRed")]
private static extern Int32 MV_CC_SetBalanceRatioRed(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetBalanceRatioGreen")]
private static extern Int32 MV_CC_GetBalanceRatioGreen(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBalanceRatioGreen")]
private static extern Int32 MV_CC_SetBalanceRatioGreen(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetBalanceRatioBlue")]
private static extern Int32 MV_CC_GetBalanceRatioBlue(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBalanceRatioBlue")]
private static extern Int32 MV_CC_SetBalanceRatioBlue(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetDeviceUserID")]
private static extern Int32 MV_CC_GetDeviceUserID(IntPtr handle, ref MVCC_STRINGVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetDeviceUserID")]
private static extern Int32 MV_CC_SetDeviceUserID(IntPtr handle, string chValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetBurstFrameCount")]
private static extern Int32 MV_CC_GetBurstFrameCount(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBurstFrameCount")]
private static extern Int32 MV_CC_SetBurstFrameCount(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetAcquisitionLineRate")]
private static extern Int32 MV_CC_GetAcquisitionLineRate(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetAcquisitionLineRate")]
private static extern Int32 MV_CC_SetAcquisitionLineRate(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_GetHeartBeatTimeout")]
private static extern Int32 MV_CC_GetHeartBeatTimeout(IntPtr handle, ref MVCC_INTVALUE pstValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetHeartBeatTimeout")]
private static extern Int32 MV_CC_SetHeartBeatTimeout(IntPtr handle, UInt32 nValue);
[DllImport("MvCameraControl.dll", EntryPoint = "MV_CC_SetBayerGammaValue")]
private static extern Int32 MV_CC_SetBayerGammaValue(IntPtr handle, Single fBayerGammaValue);
#endregion
#endregion
}
}