commit 81e4ff45ec525d33b0abcce104561820159f6462 Author: qiupeng-linux Date: Thu Apr 9 16:17:13 2026 +0800 feat:测试连接海康摄像头 diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..daa2c02 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.16) +project(MvsTest LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# 头文件目录 +set(HIK_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/third_party/hikrobot/include) + +# 你封装的 cpp 文件目录 +set(HIK_SRC_DIR ${CMAKE_SOURCE_DIR}/third_party/hikrobot/src) + +# 海康 MVS 动态库目录 +set(HIK_LIB_DIR /opt/MVS/lib/aarch64) + +add_executable(MvsTest + src/main.cpp + ${HIK_SRC_DIR}/MvCamera.cpp +) + +target_include_directories(MvsTest PRIVATE + ${HIK_INCLUDE_DIR} +) + +find_library(HIK_MV_CAMERA_CONTROL + NAMES MvCameraControl + PATHS ${HIK_LIB_DIR} + NO_DEFAULT_PATH +) + +if(NOT HIK_MV_CAMERA_CONTROL) + message(FATAL_ERROR "Cannot find libMvCameraControl.so in ${HIK_LIB_DIR}") +endif() + +message(STATUS "HIK_MV_CAMERA_CONTROL = ${HIK_MV_CAMERA_CONTROL}") + +target_link_libraries(MvsTest PRIVATE + ${HIK_MV_CAMERA_CONTROL} + pthread + dl +) + +set_target_properties(MvsTest PROPERTIES + BUILD_RPATH "${HIK_LIB_DIR}" + INSTALL_RPATH "${HIK_LIB_DIR}" +) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..3cd7886 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,248 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "MvCamera.h" + +static std::string ToHex(int v) +{ + std::ostringstream oss; + oss << "0x" << std::hex << std::uppercase << v; + return oss.str(); +} + +static void PrintRawBytes(const void* data, size_t size, const char* name) +{ + const auto* p = static_cast(data); + + std::printf("%s.Length = %zu\n", name, size); + + for (size_t i = 0; i < size; ++i) + { + std::printf("%02X", p[i]); + if (i + 1 < size) + { + std::printf("-"); + } + } + std::printf("\n"); +} + +static void PrintFrameStructInfo() +{ + std::cout << "sizeof(MV_FRAME_OUT) = " << sizeof(MV_FRAME_OUT) << std::endl; + std::cout << "sizeof(MV_FRAME_OUT_INFO_EX) = " << sizeof(MV_FRAME_OUT_INFO_EX) << std::endl; +} + +static void PrintDeviceInfo(const MV_CC_DEVICE_INFO* pInfo, unsigned int index) +{ + if (pInfo == nullptr) + { + return; + } + + std::cout << "[" << index << "] "; + + if (pInfo->nTLayerType == MV_GIGE_DEVICE) + { + std::cout << "GigE"; + const auto& s = pInfo->SpecialInfo.stGigEInfo; + std::cout << " model=" << s.chModelName + << " ip=" + << ((s.nCurrentIp & 0xFF000000) >> 24) << "." + << ((s.nCurrentIp & 0x00FF0000) >> 16) << "." + << ((s.nCurrentIp & 0x0000FF00) >> 8) << "." + << ((s.nCurrentIp & 0x000000FF)); + } + else if (pInfo->nTLayerType == MV_USB_DEVICE) + { + std::cout << "USB"; + const auto& s = pInfo->SpecialInfo.stUsb3VInfo; + std::cout << " model=" << s.chModelName + << " serial=" << s.chSerialNumber; + } + else + { + std::cout << "Other device"; + } + + std::cout << std::endl; +} + +int main() +{ + + int nRet = CMvCamera::InitSDK(); + if (MV_OK != nRet) + { + std::cerr << "InitSDK failed: " << ToHex(nRet) << std::endl; + return 1; + } + + MV_CC_DEVICE_INFO_LIST stDeviceList; + std::memset(&stDeviceList, 0, sizeof(stDeviceList)); + + nRet = CMvCamera::EnumDevices(MV_GIGE_DEVICE | MV_USB_DEVICE, &stDeviceList); + if (MV_OK != nRet) + { + std::cerr << "EnumDevices failed: " << ToHex(nRet) << std::endl; + CMvCamera::FinalizeSDK(); + return 1; + } + + if (stDeviceList.nDeviceNum == 0) + { + std::cerr << "No camera found." << std::endl; + CMvCamera::FinalizeSDK(); + return 1; + } + + std::cout << "Found " << stDeviceList.nDeviceNum << " device(s)" << std::endl; + for (unsigned int i = 0; i < stDeviceList.nDeviceNum; ++i) + { + PrintDeviceInfo(stDeviceList.pDeviceInfo[i], i); + } + + MV_CC_DEVICE_INFO* pDeviceInfo = stDeviceList.pDeviceInfo[0]; + if (pDeviceInfo == nullptr) + { + std::cerr << "First device info is null." << std::endl; + CMvCamera::FinalizeSDK(); + return 1; + } + + CMvCamera camera; + + nRet = camera.Open(pDeviceInfo); + if (MV_OK != nRet) + { + std::cerr << "Open failed: " << ToHex(nRet) << std::endl; + CMvCamera::FinalizeSDK(); + return 1; + } + + // GigE 建议设置最佳包大小 + if (pDeviceInfo->nTLayerType == MV_GIGE_DEVICE) + { + unsigned int optimalPacketSize = 0; + int retPacket = camera.GetOptimalPacketSize(&optimalPacketSize); + if (MV_OK == retPacket && optimalPacketSize > 0) + { + int retSet = camera.SetIntValue("GevSCPSPacketSize", optimalPacketSize); + if (MV_OK != retSet) + { + std::cerr << "Warning: Set GevSCPSPacketSize failed: " << ToHex(retSet) << std::endl; + } + } + } + + // 连续采集模式 + nRet = camera.SetEnumValueByString("TriggerMode", "Off"); + if (MV_OK != nRet) + { + std::cerr << "Set TriggerMode Off failed: " << ToHex(nRet) << std::endl; + camera.Close(); + CMvCamera::FinalizeSDK(); + return 1; + } + + nRet = camera.StartGrabbing(); + if (MV_OK != nRet) + { + std::cerr << "StartGrabbing failed: " << ToHex(nRet) << std::endl; + camera.Close(); + CMvCamera::FinalizeSDK(); + return 1; + } + + // 稍等一会儿,让流稳定一点 + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + + MV_FRAME_OUT stFrame = {}; + nRet = camera.GetImageBuffer(&stFrame, 3000); + if (MV_OK != nRet) + { + std::cerr << "GetImageBuffer failed: " << ToHex(nRet) << std::endl; + camera.StopGrabbing(); + camera.Close(); + CMvCamera::FinalizeSDK(); + return 1; + } + + PrintFrameStructInfo(); + PrintRawBytes(&stFrame, sizeof(MV_FRAME_OUT), "stFrame"); + + std::cout << "Grab success:" + << " width=" << stFrame.stFrameInfo.nWidth + << " height=" << stFrame.stFrameInfo.nHeight + << " frameLen=" << stFrame.stFrameInfo.nFrameLen + << " pixelType=0x" << std::hex << std::uppercase + << static_cast(stFrame.stFrameInfo.enPixelType) + << std::dec << std::endl; + + // 保存为 bmp/jpg 都可以 + MV_SAVE_IMAGE_PARAM_EX3 stSaveParam; + std::memset(&stSaveParam, 0, sizeof(stSaveParam)); + + stSaveParam.enImageType = MV_Image_Bmp; // 也可改为 MV_Image_Jpeg + stSaveParam.enPixelType = stFrame.stFrameInfo.enPixelType; + stSaveParam.nWidth = stFrame.stFrameInfo.nWidth; + stSaveParam.nHeight = stFrame.stFrameInfo.nHeight; + stSaveParam.nDataLen = stFrame.stFrameInfo.nFrameLen; + stSaveParam.pData = stFrame.pBufAddr; + stSaveParam.iMethodValue = 0; + stSaveParam.nJpgQuality = 90; + + const unsigned int maxImageLen = + stFrame.stFrameInfo.nWidth * stFrame.stFrameInfo.nHeight * 4 + 2048; + + unsigned char* pImageBuffer = new unsigned char[maxImageLen]; + std::memset(pImageBuffer, 0, maxImageLen); + + stSaveParam.pImageBuffer = pImageBuffer; + stSaveParam.nBufferSize = maxImageLen; + + nRet = camera.SaveImage(&stSaveParam); + if (MV_OK != nRet) + { + std::cerr << "SaveImage failed: " << ToHex(nRet) << std::endl; + delete[] pImageBuffer; + camera.FreeImageBuffer(&stFrame); + camera.StopGrabbing(); + camera.Close(); + CMvCamera::FinalizeSDK(); + return 1; + } + + const std::string outFile = "grab_result.bmp"; + FILE* fp = std::fopen(outFile.c_str(), "wb"); + if (fp == nullptr) + { + std::cerr << "Open output file failed: " << outFile << std::endl; + delete[] pImageBuffer; + camera.FreeImageBuffer(&stFrame); + camera.StopGrabbing(); + camera.Close(); + CMvCamera::FinalizeSDK(); + return 1; + } + + std::fwrite(pImageBuffer, 1, stSaveParam.nImageLen, fp); + std::fclose(fp); + + std::cout << "Image saved: " << outFile + << ", bytes=" << stSaveParam.nImageLen << std::endl; + + delete[] pImageBuffer; + + camera.FreeImageBuffer(&stFrame); + camera.StopGrabbing(); + camera.Close(); + CMvCamera::FinalizeSDK(); + + return 0; +} \ No newline at end of file diff --git a/third_party/hikrobot/include/CameraParams.h b/third_party/hikrobot/include/CameraParams.h new file mode 100644 index 0000000..470304c --- /dev/null +++ b/third_party/hikrobot/include/CameraParams.h @@ -0,0 +1,1441 @@ + +#ifndef _MV_CAMERA_PARAMS_H_ +#define _MV_CAMERA_PARAMS_H_ + +#include "PixelType.h" + +#ifndef __cplusplus +typedef char bool; +#define true 1 +#define false 0 +#endif + +/// \~chinese 排序方式 \~english The Method of Sorting +typedef enum _MV_SORT_METHOD_ +{ + SortMethod_SerialNumber = 0, ///< \~chinese 按序列号排序 \~english Sorting by SerialNumber + SortMethod_UserID = 1, ///< \~chinese 按用户自定义名字排序 \~english Sorting by UserID + SortMethod_CurrentIP_ASC = 2, ///< \~chinese 按当前IP地址排序(升序,只对GEV相机有效,其它类型相机按默认排序) \~english Sorting by current IP(Ascending, Available for GEV cameras only. Other types of cameras are sorted by default) + SortMethod_CurrentIP_DESC = 3, ///< \~chinese 按当前IP地址排序(降序,只对GEV相机有效,其它类型相机按默认排序) \~english Sorting by current IP(Descending, Available for GEV cameras only. Other types of cameras are sorted by default) + +}MV_SORT_METHOD; + + +/// \~chinese GigE设备信息 \~english GigE device info +typedef struct _MV_GIGE_DEVICE_INFO_ +{ + unsigned int nIpCfgOption; ///< [OUT] \~chinese IP配置选项 \~english IP Configuration Options + unsigned int nIpCfgCurrent; ///< [OUT] \~chinese 当前IP配置 \~english IP Configuration + unsigned int nCurrentIp; ///< [OUT] \~chinese 当前IP地址 \~english Current Ip + unsigned int nCurrentSubNetMask; ///< [OUT] \~chinese 当前子网掩码 \~english Curtent Subnet Mask + unsigned int nDefultGateWay; ///< [OUT] \~chinese 当前网关 \~english Current Gateway + unsigned char chManufacturerName[32]; ///< [OUT] \~chinese 制造商名称 \~english Manufacturer Name + unsigned char chModelName[32]; ///< [OUT] \~chinese 型号名称 \~english Model Name + unsigned char chDeviceVersion[32]; ///< [OUT] \~chinese 设备版本 \~english Device Version + unsigned char chManufacturerSpecificInfo[48]; ///< [OUT] \~chinese 制造商的具体信息 \~english Manufacturer Specific Information + unsigned char chSerialNumber[16]; ///< [OUT] \~chinese 序列号 \~english Serial Number + unsigned char chUserDefinedName[16]; ///< [OUT] \~chinese 用户自定义名称 \~english User Defined Name + unsigned int nNetExport; ///< [OUT] \~chinese 网口IP地址 \~english NetWork IP Address + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MV_GIGE_DEVICE_INFO; + +///< \~chinese 最大的数据信息大小 \~english Maximum data information size +#define INFO_MAX_BUFFER_SIZE 64 + +/// \~chinese USB设备信息 \~english USB device info +typedef struct _MV_USB3_DEVICE_INFO_ +{ + unsigned char CrtlInEndPoint; ///< [OUT] \~chinese 控制输入端点 \~english Control input endpoint + unsigned char CrtlOutEndPoint; ///< [OUT] \~chinese 控制输出端点 \~english Control output endpoint + unsigned char StreamEndPoint; ///< [OUT] \~chinese 流端点 \~english Flow endpoint + unsigned char EventEndPoint; ///< [OUT] \~chinese 事件端点 \~english Event endpoint + unsigned short idVendor; ///< [OUT] \~chinese 供应商ID号 \~english Vendor ID Number + unsigned short idProduct; ///< [OUT] \~chinese 产品ID号 \~english Device ID Number + unsigned int nDeviceNumber; ///< [OUT] \~chinese 设备索引号 \~english Device Number + unsigned char chDeviceGUID[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 设备GUID号 \~english Device GUID Number + unsigned char chVendorName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 供应商名字 \~english Vendor Name + unsigned char chModelName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 型号名字 \~english Model Name + unsigned char chFamilyName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 家族名字 \~english Family Name + unsigned char chDeviceVersion[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 设备版本 \~english Device Version + unsigned char chManufacturerName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 制造商名字 \~english Manufacturer Name + unsigned char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 序列号 \~english Serial Number + unsigned char chUserDefinedName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 用户自定义名字 \~english User Defined Name + unsigned int nbcdUSB; ///< [OUT] \~chinese 支持的USB协议 \~english Support USB Protocol + unsigned int nDeviceAddress; ///< [OUT] \~chinese 设备地址 \~english Device Address + unsigned int nReserved[2]; ///< \~chinese 预留 \~english Reserved + +}MV_USB3_DEVICE_INFO; + +/// \~chinese CameraLink设备信息 \~english CameraLink device info +typedef struct _MV_CamL_DEV_INFO_ +{ + unsigned char chPortID[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 串口号 \~english Port ID + unsigned char chModelName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 型号名字 \~english Model Name + unsigned char chFamilyName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 名称 \~english Family Name + unsigned char chDeviceVersion[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 设备版本 \~english Device Version + unsigned char chManufacturerName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 制造商名字 \~english Manufacturer Name + unsigned char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 序列号 \~english Serial Number + + unsigned int nReserved[38]; ///< \~chinese 预留 \~english Reserved + +}MV_CamL_DEV_INFO; + +///< \~chinese CoaXPress相机信息 \~english CoaXPress device information +typedef struct _MV_CXP_DEVICE_INFO_ +{ + unsigned char chInterfaceID[INFO_MAX_BUFFER_SIZE]; /// \~chinese 采集卡ID \~english Interface ID of Frame Grabber + unsigned char chVendorName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 供应商名字 \~english Vendor name + unsigned char chModelName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 型号名字 \~english Model name + unsigned char chManufacturerInfo[INFO_MAX_BUFFER_SIZE];///< \~chinese 厂商信息 \~english Manufacturer information + unsigned char chDeviceVersion[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 相机版本 \~english Device version + unsigned char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 序列号 \~english Serial number + unsigned char chUserDefinedName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 用户自定义名字 \~english User defined name + unsigned char chDeviceID[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 相机ID \~english Device ID + unsigned int nReserved[7]; ///< \~chinese 保留字段 \~english Reserved +}MV_CXP_DEVICE_INFO; + +///< \~chinese 采集卡Camera Link相机信息 \~english Camera Link device information on frame grabber +typedef struct _MV_CML_DEVICE_INFO_ +{ + unsigned char chInterfaceID[INFO_MAX_BUFFER_SIZE]; /// \~chinese 采集卡ID \~english Interface ID of Frame Grabber + unsigned char chVendorName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 供应商名字 \~english Vendor name + unsigned char chModelName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 型号名字 \~english Model name + unsigned char chManufacturerInfo[INFO_MAX_BUFFER_SIZE];///< \~chinese 厂商信息 \~english Manufacturer information + unsigned char chDeviceVersion[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 相机版本 \~english Device version + unsigned char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 序列号 \~english Serial number + unsigned char chUserDefinedName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 用户自定义名字 \~english User defined name + unsigned char chDeviceID[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 相机ID \~english Device ID + unsigned int nReserved[7]; ///< \~chinese 保留字段 \~english Reserved +}MV_CML_DEVICE_INFO; + +///< \~chinese XoFLink相机信息 \~english XoFLink device information +typedef struct _MV_XOF_DEVICE_INFO_ +{ + unsigned char chInterfaceID[INFO_MAX_BUFFER_SIZE]; /// \~chinese 采集卡ID \~english Interface ID of Frame Grabber + unsigned char chVendorName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 供应商名字 \~english Vendor name + unsigned char chModelName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 型号名字 \~english Model name + unsigned char chManufacturerInfo[INFO_MAX_BUFFER_SIZE];///< \~chinese 厂商信息 \~english Manufacturer information + unsigned char chDeviceVersion[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 相机版本 \~english Device version + unsigned char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 序列号 \~english Serial number + unsigned char chUserDefinedName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 用户自定义名字 \~english User defined name + unsigned char chDeviceID[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 相机ID \~english Device ID + unsigned int nReserved[7]; ///< \~chinese 保留字段 \~english Reserved +}MV_XOF_DEVICE_INFO; + +///< \~chinese 虚拟相机信息 \~english Virtual device information +typedef struct _MV_GENTL_VIR_DEVICE_INFO_ +{ + unsigned char chInterfaceID[INFO_MAX_BUFFER_SIZE]; /// \~chinese 采集卡ID \~english Interface ID of Frame Grabber + unsigned char chVendorName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 供应商名字 \~english Vendor name + unsigned char chModelName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 型号名字 \~english Model name + unsigned char chManufacturerInfo[INFO_MAX_BUFFER_SIZE];///< \~chinese 厂商信息 \~english Manufacturer information + unsigned char chDeviceVersion[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 相机版本 \~english Device version + unsigned char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 序列号 \~english Serial number + unsigned char chUserDefinedName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 用户自定义名字 \~english User defined name + unsigned char chDeviceID[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 相机ID \~english Device ID + unsigned char chTLType[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 传输层类型 \~english GenTL Type + unsigned int nReserved[7]; ///< \~chinese 保留字段 \~english Reserved +}MV_GENTL_VIR_DEVICE_INFO; + +///< \~chinese 设备传输层协议类型 \~english Device Transport Layer Protocol Type +#define MV_UNKNOW_DEVICE 0x00000000 ///< \~chinese 未知设备类型,保留意义 \~english Unknown Device Type, Reserved +#define MV_GIGE_DEVICE 0x00000001 ///< \~chinese GigE设备 \~english GigE Device +#define MV_1394_DEVICE 0x00000002 ///< \~chinese 1394-a/b 设备 \~english 1394-a/b Device +#define MV_USB_DEVICE 0x00000004 ///< \~chinese USB 设备 \~english USB Device +#define MV_CAMERALINK_DEVICE 0x00000008 ///< \~chinese CameraLink设备 \~english CameraLink Device +#define MV_VIR_GIGE_DEVICE 0x00000010 ///< \~chinese 虚拟GigE设备,包含虚拟GEV采集卡下的设备 \~english Virtual GigE Device,include GenTL virtual device +#define MV_VIR_USB_DEVICE 0x00000020 ///< \~chinese 虚拟USB设备,不支持虚拟采集卡下的设备 \~english Virtual USB Device,not supports GenTL virtual device +#define MV_GENTL_GIGE_DEVICE 0x00000040 ///< \~chinese 自研网卡下GigE设备,某些卡不支持此协议,如GE1104 \~english GenTL GigE Device +#define MV_GENTL_CAMERALINK_DEVICE 0x00000080 ///< \~chinese CameraLink相机设备 \~english GenTL CameraLink Camera Device +#define MV_GENTL_CXP_DEVICE 0x00000100 ///< \~chinese CoaXPress设备 \~english GenTL CoaXPress Device +#define MV_GENTL_XOF_DEVICE 0x00000200 ///< \~chinese XoF设备 \~english GenTL XoF Device +#define MV_GENTL_VIR_DEVICE 0x00000800 ///< \~chinese 虚拟采集卡下的设备,不支持虚拟GEV采集卡下的设备 \~english GenTL Virtual Device,not supports GenTL virtual GigE device + +/// \~chinese 设备信息 \~english Device info +typedef struct _MV_CC_DEVICE_INFO_ +{ + unsigned short nMajorVer; ///< [OUT] \~chinese 主要版本 \~english Major Version + unsigned short nMinorVer; ///< [OUT] \~chinese 次要版本 \~english Minor Version + unsigned int nMacAddrHigh; ///< [OUT] \~chinese 高MAC地址 \~english High MAC Address + unsigned int nMacAddrLow; ///< [OUT] \~chinese 低MAC地址 \~english Low MAC Address + unsigned int nTLayerType; ///< [OUT] \~chinese 设备传输层协议类型 \~english Device Transport Layer Protocol Type + + unsigned int nDevTypeInfo; ///< [OUT] \~chinese 设备类型信息 \~english Device Type Info + ///< \~chinese 设备类型规则 \~english Device Type Rules + ///< 7 - 0 bit: \~chinese 预留 \~english Reserved + ///< 15 - 8 bit: \~chinese 产品子类别 \~english Product subtype + ///< 23 - 16 bit: \~chinese 产品类型 \~english product type + ///< 31 - 24bit: \~chinese 产品线 \~english Product Line 产品线 //eg: 0x01 标准产品/2D Produces; 0x02 3D产品/3D Produces ; 0x03 智能ID产品/Intelligent ID products + unsigned int nReserved[3]; ///< \~chinese 预留 \~english Reserved + + union + { + MV_GIGE_DEVICE_INFO stGigEInfo; ///< [OUT] \~chinese GigE设备信息 \~english GigE Device Info + MV_USB3_DEVICE_INFO stUsb3VInfo; ///< [OUT] \~chinese USB设备信息 \~english USB Device Info + MV_CamL_DEV_INFO stCamLInfo; ///< [OUT] \~chinese CameraLink设备信息 \~english CameraLink Device Info + MV_CML_DEVICE_INFO stCMLInfo; ///< [OUT] \~chinese 采集卡CameraLink设备信息 \~english CameraLink Device Info On Frame Grabber + MV_CXP_DEVICE_INFO stCXPInfo; ///< [OUT] \~chinese 采集卡CoaXPress设备信息 \~english CoaXPress Device Info On Frame Grabber + MV_XOF_DEVICE_INFO stXoFInfo; ///< [OUT] \~chinese 采集卡XoF设备信息 \~english XoF Device Info On Frame Grabber + MV_GENTL_VIR_DEVICE_INFO stVirInfo; ///< [OUT] \~chinese 采集卡虚拟设备信息, 仅支持协议MV_GENTL_VIR_DEVICE \~english Virtual Device Info On Frame Grabber,device transport layer protocol type is MV_GENTL_VIR_DEVICE + }SpecialInfo; + +}MV_CC_DEVICE_INFO; + +///< \~chinese 最多支持的传输层实例个数 \~english The maximum number of supported transport layer instances +#define MV_MAX_TLS_NUM 8 +///< \~chinese 最大支持的设备个数 \~english The maximum number of supported devices +#define MV_MAX_DEVICE_NUM 256 + +/// \~chinese 设备信息列表 \~english Device Information List +typedef struct _MV_CC_DEVICE_INFO_LIST_ +{ + unsigned int nDeviceNum; ///< [OUT] \~chinese 在线设备数量 \~english Online Device Number + MV_CC_DEVICE_INFO* pDeviceInfo[MV_MAX_DEVICE_NUM]; ///< [OUT] \~chinese 支持最多256个设备 \~english Support up to 256 devices + +}MV_CC_DEVICE_INFO_LIST; + + +///< \~chinese 采集卡类型 \~english Interface type +#define MV_GIGE_INTERFACE 0x00000001 ///< \~chinese GigE Vision采集卡 \~english GigE Vision interface +#define MV_CAMERALINK_INTERFACE 0x00000004 ///< \~chinese Camera Link采集卡 \~english Camera Link interface +#define MV_CXP_INTERFACE 0x00000008 ///< \~chinese CoaXPress采集卡 \~english CoaXPress interface +#define MV_XOF_INTERFACE 0x00000010 ///< \~chinese XoFLink采集卡 \~english XoFLink interface +#define MV_VIR_INTERFACE 0x00000020 ///< \~chinese 虚拟采集卡 \~english Virtual interface +#define MV_LC_INTERFACE 0x00000040 ///< \~chinese 光源控制卡 \~english Light Controller interface + + +///< \~chinese 最大支持的采集卡数量 \~english The maximum number of Frame Grabber interface supported +#define MV_MAX_INTERFACE_NUM 64 + +///< \~chinese 采集卡信息 \~english Interface information +typedef struct _MV_INTERFACE_INFO_ +{ + unsigned int nTLayerType; ///< \~chinese 采集卡类型 \~english Interface type + // 低16位有效: bits(0~2)代表功能, bits(3~7)代表相机, bits(8-15)代表总线 + // The lower 16 bits are valid: bits (0~2) represents the function, bits (3~7) represents the device, and bits (8~15) represents the bus + // |15 14 13 12 11 10 9 8 | 7 6 5 4 3 | 2 1 0 | + // +-----------------------------+---------------+---------+ + // | bus | device | func | + unsigned int nPCIEInfo; ///< \~chinese 采集卡的PCIE插槽信息 \~english PCIe slot information of interface + unsigned char chInterfaceID[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 采集卡ID \~english Interface ID + unsigned char chDisplayName[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 显示名称 \~english Display name + unsigned char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< \~chinese 序列号 \~english Serial number + unsigned char chModelName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 型号 \~english model name + unsigned char chManufacturer[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 厂商 \~english manufacturer name + unsigned char chDeviceVersion[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 版本号 \~english device version + unsigned char chUserDefinedName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 自定义名称 \~english user defined name + unsigned int nReserved[64]; ///< \~chinese 保留字段 \~english Reserved +}MV_INTERFACE_INFO; + +///< \~chinese 采集卡信息列表 \~english Interface Information List +typedef struct _MV_INTERFACE_INFO_LIST_ +{ + unsigned int nInterfaceNum; ///< [OUT] \~chinese 采集卡数量 \~english Interface Number + MV_INTERFACE_INFO* pInterfaceInfos[MV_MAX_INTERFACE_NUM]; ///< [OUT] \~chinese 采集卡信息, 支持最多64个设备 \~english Information of interfaces, support up to 64 interfaces +}MV_INTERFACE_INFO_LIST; + + + +/// \~chinese 通过GenTL枚举到的接口信息 \~english Interface Information with GenTL +typedef struct _MV_GENTL_IF_INFO_ +{ + unsigned char chInterfaceID[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese GenTL接口ID \~english Interface ID + unsigned char chTLType[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 传输层类型 \~english GenTL Type + unsigned char chDisplayName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese Interface显示名称 \~english Display Name + unsigned int nCtiIndex; ///< [OUT] \~chinese GenTL的cti文件索引 \~english The Index of Cti Files + + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved + +}MV_GENTL_IF_INFO; + +///< \~chinese 最大支持的GenTL接口数量 \~english The maximum number of GenTL interface supported +#define MV_MAX_GENTL_IF_NUM 256 + +/// \~chinese 通过GenTL枚举到的接口信息列表 \~english Inferface Information List with GenTL +typedef struct _MV_GENTL_IF_INFO_LIST_ +{ + unsigned int nInterfaceNum; ///< [OUT] \~chinese 在线接口数量 \~english Online Inferface Number + MV_GENTL_IF_INFO* pIFInfo[MV_MAX_GENTL_IF_NUM]; ///< [OUT] \~chinese 支持最多256个接口 \~english Support up to 256 inferfaces + +}MV_GENTL_IF_INFO_LIST; + +/// \~chinese 通过GenTL枚举到的设备信息 \~english Device Information with GenTL +typedef struct _MV_GENTL_DEV_INFO_ +{ + unsigned char chInterfaceID[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese GenTL接口ID \~english Interface ID + unsigned char chDeviceID[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 设备ID \~english Device ID + unsigned char chVendorName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 供应商名字 \~english Vendor Name + unsigned char chModelName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 型号名字 \~english Model Name + unsigned char chTLType[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 传输层类型 \~english GenTL Type + unsigned char chDisplayName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 设备显示名称 \~english Display Name + unsigned char chUserDefinedName[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 用户自定义名字 \~english User Defined Name + unsigned char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 序列号 \~english Serial Number + unsigned char chDeviceVersion[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 设备版本号 \~english Device Version + unsigned int nCtiIndex; ///< [OUT] \~chinese GenTL的cti文件索引 \~english The Index of Cti Files + + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved + +}MV_GENTL_DEV_INFO; + +///< \~chinese 最大支持的GenTL设备数量 \~english The maximum number of GenTL devices supported +#define MV_MAX_GENTL_DEV_NUM 256 + +/// \~chinese 通过GenTL枚举到的设备信息列表 \~english Device Information List with GenTL +typedef struct _MV_GENTL_DEV_INFO_LIST_ +{ + unsigned int nDeviceNum; ///< [OUT] \~chinese 在线设备数量 \~english Online Device Number + MV_GENTL_DEV_INFO* pDeviceInfo[MV_MAX_GENTL_DEV_NUM]; ///< [OUT] \~chinese 支持最多256个设备 \~english Support up to 256 devices + +}MV_GENTL_DEV_INFO_LIST; + +/// \~chinese 设备的访问模式 \~english Device Access Mode +#define MV_ACCESS_Exclusive 1 /// \~chinese 独占权限,其他APP只允许读CCP寄存器 \~english Exclusive authority, other APP is only allowed to read the CCP register +#define MV_ACCESS_ExclusiveWithSwitch 2 /// \~chinese 可以从5模式下抢占权限,然后以独占权限打开 \~english You can seize the authority from the 5 mode, and then open with exclusive authority +#define MV_ACCESS_Control 3 /// \~chinese 控制权限,其他APP允许读所有寄存器 \~english Control authority, allows other APP reading all registers +#define MV_ACCESS_ControlWithSwitch 4 /// \~chinese 可以从5的模式下抢占权限,然后以控制权限打开 \~english You can seize the authority from the 5 mode, and then open with control authority +#define MV_ACCESS_ControlSwitchEnable 5 /// \~chinese 以可被抢占的控制权限打开 \~english Open with seized control authority +#define MV_ACCESS_ControlSwitchEnableWithKey 6 /// \~chinese 可以从5的模式下抢占权限,然后以可被抢占的控制权限打开 \~english You can seize the authority from the 5 mode, and then open with seized control authority +#define MV_ACCESS_Monitor 7 /// \~chinese 读模式打开设备,适用于控制权限下 \~english Open with read mode and is available under control authority + +/// \~chinese Chunk内容 \~english The content of ChunkData +typedef struct _MV_CHUNK_DATA_CONTENT_ +{ + unsigned char* pChunkData; ///< [OUT] \~chinese Chunk数据 \~english Chunk Data + unsigned int nChunkID; ///< [OUT] \~chinese Chunk ID \~english Chunk ID + unsigned int nChunkLen; ///< [OUT] \~chinese Chunk的长度 \~english Chunk Length + + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CHUNK_DATA_CONTENT; + + +/// \~chinese 图像信息 \~english Image information +typedef struct _MV_CC_IMAGE_ +{ + unsigned int nWidth; ///< \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< \~chinese 图像高 \~english Height + enum MvGvspPixelType enPixelType; ///< ~chinese 像素格式 \~english Pixel type + + unsigned char* pImageBuf; ///< \~chinese 图像缓存 \~english Image buffer + uint64_t nImageBufSize; ///< \~chinese 图像缓存大小 \~english Image buffer size + uint64_t nImageLen; ///< \~chinese 图像长度 \~english Image length + + unsigned int nReserved[4]; ///< \~chinese 预留字段 \~english Reserved + +}MV_CC_IMAGE; + +typedef enum _MV_FRAME_EXTRA_INFO_TYPE_ +{ + MV_FRAME_EXTRA_NO_INFO = 0x0000, + MV_FRAME_EXTRA_SUBIMAGES = 0x0001, // 子图 + MV_FRAME_EXTRA_MULTIPARTS = 0x0002, // 多部分 +}MV_FRAME_EXTRA_INFO_TYPE; + +// ZONE方向(自上而下或者自下而上) +typedef enum _MV_GIGE_ZONE_DIRECTION_ +{ + MV_GIGE_PART_ZONE_TOP_DOWN = 0, + MV_GIGE_PART_ZONE_BOTTOM_UP = 1, +} MV_GIGE_ZONE_DIRECTION; + +typedef struct _MV_GIGE_ZONE_INFO_ +{ + MV_GIGE_ZONE_DIRECTION enDirection; // 解析方向 (0: 自上向下,1:自下向上) + union + { + unsigned char* pZoneAddr; // 起始地址 + uint64_t nAlign; // 对齐 + } stZone; + uint64_t nLength; // 数据长度 + + unsigned int nReserved[6]; // 保留 +} MV_GIGE_ZONE_INFO; + +typedef union _MV_GIGE_MULRI_PART_DATA_INFO_ +{ + // (data_type ≤ 0x0009) MV_MULTI_PART_DATA_TYPE + struct + { + unsigned int nSizeX; + unsigned int nSizeY; + unsigned int nOffsetX; + unsigned int nOffsetY; + unsigned short nPaddingX; + } stGeneral; + + // (data_type == 0x000B or data_type == 0x000C) MV_MULTI_PART_DATA_TYPE + struct + { + unsigned char nJpegFlag; + unsigned int nTimestampTickFrequencyHigh; + unsigned int nTimestampTickFrequencyLow; + unsigned int nJpegDataFormat; + } stJpeg; + + // 若是自定义类型则保留原始未解析数据,否则清空该字段 + unsigned char pDataTypeSpecific[24]; +} MV_GIGE_PART_DATA_INFO; + +// 枚举类型 +typedef enum _MV_GIGE_MULTI_PART_DATA_TYPE_ +{ + MV_GIGE_DT_2D_IMAGE_1_PLANAR = 0x0001, + MV_GIGE_DT_2D_IMAGE_2_PLANAR = 0x0002, + MV_GIGE_DT_2D_IMAGE_3_PLANAR = 0x0003, + MV_GIGE_DT_2D_IMAGE_4_PLANAR = 0x0004, + MV_GIGE_DT_3D_IMAGE_1_PLANAR = 0x0005, + MV_GIGE_DT_3D_IMAGE_2_PLANAR = 0x0006, + MV_GIGE_DT_3D_IMAGE_3_PLANAR = 0x0007, + MV_GIGE_DT_3D_IMAGE_4_PLANAR = 0x0008, + MV_GIGE_DT_CONFIDENCE_MAP = 0x0009, + MV_GIGE_DT_CHUNK_DATA = 0x000A, + MV_GIGE_DT_JPEG_IMAGE = 0x000B, + MV_GIGE_DT_JPEG2000_IMAGE = 0x000C, +}MV_GIGE_MULTI_PART_DATA_TYPE; + +// MULTI_PART传输方式的缓存图像节点信息 +typedef struct _MV_GIGE_MULTI_PART_INFO_ +{ + MV_GIGE_MULTI_PART_DATA_TYPE enDataType; // 数据类型 MV_MULTI_PART_DATA_TYPE + unsigned int nDataFormat; // 数据格式(例如像素格式) + unsigned int nSourceID; // 图像源ID + unsigned int nRegionID; // 区域ID + unsigned int nDataPurposeID; // 目的ID + unsigned int nZones; // 当前Part所包含的Zone区域数目 + MV_GIGE_ZONE_INFO* pZoneInfo; // Zone信息 + uint64_t nLength; // 数据长度 + unsigned char* pPartAddr; // 当前Part的起始数据地址 + MV_GIGE_PART_DATA_INFO stDataTypeSpecific; // 数据类型携带的特定数据 + + unsigned int nReserved[8]; // 保留 +}MV_GIGE_MULTI_PART_INFO; + +/// \~chinese 输出帧的信息 \~english Output Frame Information +typedef struct _MV_FRAME_OUT_INFO_EX_ +{ + unsigned short nWidth; ///< [OUT] \~chinese 图像宽(最大65535,超出请用nExtendWidth) \~english Image Width (over 65535, use nExtendWidth) + unsigned short nHeight; ///< [OUT] \~chinese 图像高(最大65535,超出请用nExtendHeight) \~english Image Height(over 65535, use nExtendHeight) + enum MvGvspPixelType enPixelType; ///< [OUT] \~chinese 像素格式 \~english Pixel Type + + unsigned int nFrameNum; ///< [OUT] \~chinese 帧号 \~english Frame Number + unsigned int nDevTimeStampHigh; ///< [OUT] \~chinese 时间戳高32位 \~english Timestamp high 32 bits + unsigned int nDevTimeStampLow; ///< [OUT] \~chinese 时间戳低32位 \~english Timestamp low 32 bits + unsigned int nReserved0; ///< [OUT] \~chinese 保留,8字节对齐 \~english Reserved, 8-byte aligned + int64_t nHostTimeStamp; ///< [OUT] \~chinese 主机生成的时间戳 \~english Host-generated timestamp + + unsigned int nFrameLen; ///< [OUT] \~chinese 帧的长度(4GB以上图像使用nFrameLenEx替代) \~english The Length of Frame + + /// \~chinese 设备水印时标 \~english Device frame-specific time scale + unsigned int nSecondCount; ///< [OUT] \~chinese 秒数 \~english The Seconds + unsigned int nCycleCount; ///< [OUT] \~chinese 周期数 \~english The Count of Cycle + unsigned int nCycleOffset; ///< [OUT] \~chinese 周期偏移量 \~english The Offset of Cycle + + float fGain; ///< [OUT] \~chinese 增益 \~english Gain + float fExposureTime; ///< [OUT] \~chinese 曝光时间 \~english Exposure Time + unsigned int nAverageBrightness; ///< [OUT] \~chinese 平均亮度 \~english Average brightness + + /// \~chinese 白平衡相关 \~english White balance + unsigned int nRed; ///< [OUT] \~chinese 红色 \~english Red + unsigned int nGreen; ///< [OUT] \~chinese 绿色 \~english Green + unsigned int nBlue; ///< [OUT] \~chinese 蓝色 \~english Blue + + unsigned int nFrameCounter; ///< [OUT] \~chinese 总帧数 \~english Frame Counter + unsigned int nTriggerIndex; ///< [OUT] \~chinese 触发计数 \~english Trigger Counting + + unsigned int nInput; ///< [OUT] \~chinese 输入 \~english Input + unsigned int nOutput; ///< [OUT] \~chinese 输出 \~english Output + + /// \~chinese ROI区域 \~english ROI Region + unsigned short nOffsetX; ///< [OUT] \~chinese 水平偏移量 \~english OffsetX + unsigned short nOffsetY; ///< [OUT] \~chinese 垂直偏移量 \~english OffsetY + unsigned short nChunkWidth; ///< [OUT] \~chinese Chunk宽 \~english The Width of Chunk + unsigned short nChunkHeight; ///< [OUT] \~chinese Chunk高 \~english The Height of Chunk + + unsigned int nLostPacket; ///< [OUT] \~chinese 本帧丢包数 \~english Lost Packet Number In This Frame + + unsigned int nUnparsedChunkNum; ///< [OUT] \~chinese 未解析的Chunkdata个数 \~english Unparsed Chunk Number + union + { + MV_CHUNK_DATA_CONTENT* pUnparsedChunkContent; ///< [OUT] \~chinese 未解析的Chunk \~english Unparsed Chunk Content + int64_t nAligning; ///< [OUT] \~chinese 校准 \~english Aligning + }UnparsedChunkList; + + unsigned int nExtendWidth; ///< [OUT] \~chinese 图像宽(扩展变量) \~english Image Width + unsigned int nExtendHeight; ///< [OUT] \~chinese 图像高(扩展变量) \~english Image Height + + uint64_t nFrameLenEx; ///< [OUT] \~chinese 帧的长度 \~english The Length of Frame + + unsigned int nExtraType; ///< [OUT] \~chinese 判断携带的额外信息的类型:子图(SubImageList)还是多图(MultiPartArray) MV_FRAME_EXTRA_INFO_TYPE类型 + + unsigned int nSubImageNum; ///< [OUT] \~chinese 图像缓存中的子图(多图)个数 \~english Sub Image(MulitiPart) Number + + union + { + MV_CC_IMAGE* pstSubImage; ///< [OUT] \~chinese 子图信息 \~english Sub image info + MV_GIGE_MULTI_PART_INFO* pstPartInfo; ///< [OUT] \~chinese 图像部分信息 \~english Image Parts Information + int64_t nAligning; ///< [OUT] \~chinese 校准 \~english Aligning + } SubImageList; + + union + { + void* pUser; ///< [OUT] \~chinese 自定义指针(外部注册缓存时,内存地址对应的用户自定义指针) \~english Custom pointer (user-defined pointer corresponding to memory address when registering external cache) + int64_t nAligning; ///< [OUT] \~chinese 校准 \~english Aligning + }UserPtr; + + unsigned int nFirstLineEncoderCount; ///< [OUT] \~chinese 首行编码器计数 \~english First line encoder count + unsigned int nLastLineEncoderCount; ///< [OUT] \~chinese 尾行编码器计数 \~english Last line encoder count + + unsigned int nReserved[24]; ///< \~chinese 预留 \~english Reserved + +}MV_FRAME_OUT_INFO_EX; + +/// \~chinese 图像结构体,输出图像地址及图像信息 \~english Image Struct, output the pointer of Image and the information of the specific image +typedef struct _MV_FRAME_OUT_ +{ + unsigned char* pBufAddr; ///< [OUT] \~chinese 图像指针地址 \~english pointer of image + MV_FRAME_OUT_INFO_EX stFrameInfo; ///< [OUT] \~chinese 图像信息 \~english information of the specific image + + unsigned int nRes[16]; ///< \~chinese 预留 \~english Reserved + +}MV_FRAME_OUT; + +/// \~chinese 取流策略 \~english The strategy of Grabbing +typedef enum _MV_GRAB_STRATEGY_ +{ + MV_GrabStrategy_OneByOne = 0, ///< \~chinese 从旧到新一帧一帧的获取图像 \~english Grab One By One + MV_GrabStrategy_LatestImagesOnly = 1, ///< \~chinese 获取列表中最新的一帧图像 \~english Grab The Latest Image + MV_GrabStrategy_LatestImages = 2, ///< \~chinese 获取列表中最新的图像 \~english Grab The Latest Images + MV_GrabStrategy_UpcomingImage = 3, ///< \~chinese 等待下一帧图像 \~english Grab The Upcoming Image + +}MV_GRAB_STRATEGY; + +/// \~chinese 网络传输的相关信息 \~english Network transmission information +typedef struct _MV_NETTRANS_INFO_ +{ + int64_t nReceiveDataSize; ///< [OUT] \~chinese 已接收数据大小[Start和Stop之间] \~english Received Data Size + int nThrowFrameCount; ///< [OUT] \~chinese 丢帧数量 \~english Throw frame number + unsigned int nNetRecvFrameCount; ///< [OUT] \~chinese 已接收的帧数 \~english Received Frame Count + int64_t nRequestResendPacketCount; ///< [OUT] \~chinese 请求重发包数 \~english Request Resend Packet Count + int64_t nResendPacketCount; ///< [OUT] \~chinese 重发包数 \~english Resend Packet Count + +}MV_NETTRANS_INFO; + +/// \~chinese 信息类型 \~english Information Type +#define MV_MATCH_TYPE_NET_DETECT 0x00000001 ///< \~chinese 网络流量和丢包信息 \~english Network traffic and packet loss information +#define MV_MATCH_TYPE_USB_DETECT 0x00000002 ///< \~chinese host接收到来自U3V设备的字节总数 \~english The total number of bytes host received from U3V device + +/// \~chinese 全匹配的一种信息结构体 \~english A fully matched information structure +typedef struct _MV_ALL_MATCH_INFO_ +{ + unsigned int nType; ///< [IN] \~chinese 需要输出的信息类型,e.g. MV_MATCH_TYPE_NET_DETECT、MV_MATCH_TYPE_USB_DETECT \~english Information type need to output ,e.g. MV_MATCH_TYPE_NET_DETECT、MV_MATCH_TYPE_USB_DETECT + void* pInfo; ///< [OUT] \~chinese 输出的信息缓存,由调用者分配 \~english Output information cache, which is allocated by the caller + unsigned int nInfoSize; ///< [IN] \~chinese 信息缓存的大小 \~english Information cache size + +}MV_ALL_MATCH_INFO; + +/// \~chinese 网络流量和丢包信息反馈结构体,对应类型为 MV_MATCH_TYPE_NET_DETECT \~english Network traffic and packet loss feedback structure, the corresponding type is MV_MATCH_TYPE_NET_DETECT +typedef struct _MV_MATCH_INFO_NET_DETECT_ +{ + int64_t nReceiveDataSize; ///< [OUT] \~chinese 已接收数据大小[Start和Stop之间] \~english Received data size + int64_t nLostPacketCount; ///< [OUT] \~chinese 丢失的包数量 \~english Number of packets lost + unsigned int nLostFrameCount; ///< [OUT] \~chinese 丢帧数量 \~english Number of frames lost + unsigned int nNetRecvFrameCount; ///< [OUT] \~chinese 接收到的图像帧数 \~english Received Frame Count + int64_t nRequestResendPacketCount; ///< [OUT] \~chinese 请求重发包数 \~english Request Resend Packet Count + int64_t nResendPacketCount; ///< [OUT] \~chinese 重发包数 \~english Resend Packet Count + +}MV_MATCH_INFO_NET_DETECT; + +/// \~chinese host收到从u3v设备端的总字节数,对应类型为 MV_MATCH_TYPE_USB_DETECT \~english The total number of bytes host received from the u3v device side, the corresponding type is MV_MATCH_TYPE_USB_DETECT +typedef struct _MV_MATCH_INFO_USB_DETECT_ +{ + int64_t nReceiveDataSize; ///< [OUT] \~chinese 已接收数据大小 [Open和Close之间] \~english Received data size + unsigned int nReceivedFrameCount; ///< [OUT] \~chinese 已收到的帧数 \~english Number of frames received + unsigned int nErrorFrameCount; ///< [OUT] \~chinese 错误帧数 \~english Number of error frames + + unsigned int nReserved[2]; ///< \~chinese 保留 \~english Reserved + +}MV_MATCH_INFO_USB_DETECT; + +/// \~chinese 显示帧信息 \~english Display frame information +typedef struct _MV_DISPLAY_FRAME_INFO_EX_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel type + + unsigned char* pImageBuf; ///< [IN] \~chinese 输入图像缓存 \~english Input image buffer + unsigned int nImageBufLen; ///< [IN] \~chinese 输入图像长度 \~english Input image length + + unsigned int enRenderMode; /// [IN] \~chinese 图像渲染方式 Windows:0-GDI(默认), 1-D3D, 2-OPENGL Linux: 0-OPENGL(默认) \~english Windows:0-GDI(default), 1-D3D, 2-OPENGL Linux: 0-OPENGL(default) + unsigned int nRes[3]; ///< \~chinese 保留 \~english Reserved + +}MV_DISPLAY_FRAME_INFO_EX; + + +/// \~chinese 保存图片格式 \~english Save image type +enum MV_SAVE_IAMGE_TYPE +{ + MV_Image_Undefined = 0, ///< \~chinese 未定义的图像格式 \~english Undefined Image Type + MV_Image_Bmp = 1, ///< \~chinese BMP图像格式 \~english BMP Image Type + MV_Image_Jpeg = 2, ///< \~chinese JPEG图像格式 \~english Jpeg Image Type + MV_Image_Png = 3, ///< \~chinese PNG图像格式 \~english Png Image Type + MV_Image_Tif = 4, ///< \~chinese TIFF图像格式 \~english TIFF Image Type + +}; + +/// \~chinese 图片保存参数 \~english Save Image Parameters +typedef struct _MV_SAVE_IMAGE_PARAM_EX3_ +{ + unsigned char* pData; ///< [IN] \~chinese 输入数据缓存 \~english Input Data Buffer + unsigned int nDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input Data length + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 输入数据的像素格式 \~english Input Data Pixel Format + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Image Height + + unsigned char* pImageBuffer; ///< [OUT] \~chinese 输出图片缓存 \~english Output Image Buffer + unsigned int nImageLen; ///< [OUT] \~chinese 输出图片长度 \~english Output Image length + unsigned int nBufferSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Output buffer size provided + enum MV_SAVE_IAMGE_TYPE enImageType; ///< [IN] \~chinese 输出图片格式 \~english Output Image Format + unsigned int nJpgQuality; ///< [IN] \~chinese JPG编码质量(50-99],其它格式无效 \~english Encoding quality(50-99],Other formats are invalid + + + unsigned int iMethodValue; ///< [IN] \~chinese 插值方法 0-快速 1-均衡(其它值默认为均衡) 2-最优 3-最优+ , RBGG/BRGG/GGRB/GGBR相关像素格式不支持0和3 \~english Bayer interpolation method 0-Fast 1-Equilibrium 2-Optimal 3-Optimal+, Pixels in RBGG/BRGG/GGRB/GGBR formats do not support 0 and 3. + + unsigned int nReserved[3]; ///< \~chinese 预留 \~english Reserved + +}MV_SAVE_IMAGE_PARAM_EX3; + + +// 保存图片到文件参数 +typedef struct _MV_SAVE_IMAGE_TO_FILE_PARAM_EX_ +{ + unsigned int nWidth; ///< [IN] 图像宽 + unsigned int nHeight; ///< [IN] 图像高 + enum MvGvspPixelType enPixelType; ///< [IN] 输入数据的像素格式 + unsigned char* pData; ///< [IN] 输入数据缓存 + unsigned int nDataLen; ///< [IN] 输入数据大小 + + enum MV_SAVE_IAMGE_TYPE enImageType; ///< [IN] 输入图片格式 + char* pcImagePath; ///< [IN] 输入文件路径, Windows平台路径长度不超过260字节,Linux平台不超过255字节 + + unsigned int nQuality; ///< [IN] JPG编码质量(50-99],其它格式无效 + int iMethodValue; ///< [IN] 插值方法 0-快速 1-均衡(其它值默认为均衡) 2-最优 3-最优+, RBGG/BRGG/GGRB/GGBR相关像素格式不支持0和3 + unsigned int nReserved[8]; + +}MV_SAVE_IMAGE_TO_FILE_PARAM_EX; + +// 保存图片所需参数 +typedef struct _MV_CC_SAVE_IMAGE_PARAM_ +{ + enum MV_SAVE_IAMGE_TYPE enImageType; ///< [IN] 输入图片格式 + unsigned int nQuality; ///< [IN] JPG编码质量(50-99],其它格式无效 + int iMethodValue; ///< [IN] 插值方法 0-快速 1-均衡(其它值默认为均衡) 2-最优 3-最优+, RBGG/BRGG/GGRB/GGBR相关像素格式不支持0和3 + + unsigned int nReserved[8]; + +}MV_CC_SAVE_IMAGE_PARAM; + +/// \~chinese 旋转角度 \~english Rotation angle +typedef enum _MV_IMG_ROTATION_ANGLE_ +{ + MV_IMAGE_ROTATE_90 = 1, + MV_IMAGE_ROTATE_180 = 2, + MV_IMAGE_ROTATE_270 = 3, + +}MV_IMG_ROTATION_ANGLE; + +/// \~chinese 图像旋转结构体 \~english Rotate image structure +typedef struct _MV_CC_ROTATE_IMAGE_PARAM_T_ +{ + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned int nWidth; ///< [IN][OUT] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN][OUT] \~chinese 图像高 \~english Height + + unsigned char* pSrcData; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input data length + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + + MV_IMG_ROTATION_ANGLE enRotationAngle; ///< [IN] \~chinese 旋转角度 \~english Rotation angle + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_ROTATE_IMAGE_PARAM; + +/// \~chinese 翻转类型 \~english Flip type +typedef enum _MV_IMG_FLIP_TYPE_ +{ + MV_FLIP_VERTICAL = 1, + MV_FLIP_HORIZONTAL = 2, + +}MV_IMG_FLIP_TYPE; + +/// \~chinese 图像翻转结构体 \~english Flip image structure +typedef struct _MV_CC_FLIP_IMAGE_PARAM_T_ +{ + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + + unsigned char* pSrcData; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input data length + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + + MV_IMG_FLIP_TYPE enFlipType; ///< [IN] \~chinese 翻转类型 \~english Flip type + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_FLIP_IMAGE_PARAM; + + +/// \~chinese 像素转换结构体 \~english Pixel convert structure +typedef struct _MV_CC_PIXEL_CONVERT_PARAM_EX_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + + enum MvGvspPixelType enSrcPixelType; ///< [IN] \~chinese 源像素格式 \~english Source pixel format + unsigned char* pSrcData; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input data length + + enum MvGvspPixelType enDstPixelType; ///< [IN] \~chinese 目标像素格式 \~english Destination pixel format + unsigned char* pDstBuffer; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nDstBufferSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + + unsigned int nRes[4]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_PIXEL_CONVERT_PARAM_EX; + + + + + +/// \~chinese Gamma类型 \~english Gamma type +typedef enum _MV_CC_GAMMA_TYPE_ +{ + MV_CC_GAMMA_TYPE_NONE = 0, ///< \~chinese 不启用 \~english Disable + MV_CC_GAMMA_TYPE_VALUE = 1, ///< \~chinese Gamma值 \~english Gamma value + MV_CC_GAMMA_TYPE_USER_CURVE = 2, ///< \~chinese Gamma曲线 \~english Gamma curve + ///< \~chinese 8位,长度:256*sizeof(unsigned char) \~english 8bit,length:256*sizeof(unsigned char) + ///< \~chinese 10位,长度:1024*sizeof(unsigned short) \~english 10bit,length:1024*sizeof(unsigned short) + ///< \~chinese 12位,长度:4096*sizeof(unsigned short) \~english 12bit,length:4096*sizeof(unsigned short) + ///< \~chinese 16位,长度:65536*sizeof(unsigned short) \~english 16bit,length:65536*sizeof(unsigned short) + MV_CC_GAMMA_TYPE_LRGB2SRGB = 3, ///< \~chinese linear RGB to sRGB \~english linear RGB to sRGB + MV_CC_GAMMA_TYPE_SRGB2LRGB = 4, ///< \~chinese sRGB to linear RGB(仅色彩插值时支持,色彩校正时无效) \~english sRGB to linear RGB + +}MV_CC_GAMMA_TYPE; + +// Gamma信息 +/// \~chinese Gamma信息结构体 \~english Gamma info structure +typedef struct _MV_CC_GAMMA_PARAM_T_ +{ + MV_CC_GAMMA_TYPE enGammaType; ///< [IN] \~chinese Gamma类型 \~english Gamma type + float fGammaValue; ///< [IN] \~chinese Gamma值:0.1 ~ 4.0 \~english Gamma value:0.1 ~ 4.0 + unsigned char* pGammaCurveBuf; ///< [IN] \~chinese Gamma曲线缓存 \~english Gamma curve buffer + unsigned int nGammaCurveBufLen; ///< [IN] \~chinese Gamma曲线缓存长度 \~english Gamma curve buffer size + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_GAMMA_PARAM; + +/// \~chinese CCM参数 \~english CCM param +typedef struct _MV_CC_CCM_PARAM_T_ +{ + bool bCCMEnable; ///< [IN] \~chinese 是否启用CCM \~english CCM enable + int nCCMat[9]; ///< [IN] \~chinese CCM矩阵[-8192~8192] \~english Color correction matrix[-8192~8192] + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_CCM_PARAM; + +/// \~chinese CCM参数 \~english CCM param +typedef struct _MV_CC_CCM_PARAM_EX_T_ +{ + bool bCCMEnable; ///< [IN] \~chinese 是否启用CCM \~english CCM enable + int nCCMat[9]; ///< [IN] \~chinese CCM矩阵[-65536~65536] \~english Color correction matrix[-65536~65536] + unsigned int nCCMScale; ///< [IN] \~chinese 量化系数(2的整数幂,最大65536) \~english Quantitative scale(Integer power of 2, <= 65536) + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_CCM_PARAM_EX; + +/// \~chinese 对比度调节结构体 \~english Contrast structure +typedef struct _MV_CC_CONTRAST_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽度(最小8) \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高度(最小8) \~english Image Height + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcBufLen; ///< [IN] \~chinese 输入数据大小 \~english Input data length + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + + unsigned int nContrastFactor; ///< [IN] \~chinese 对比度值,[1,10000] \~english Contrast factor,[1,10000] + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_CONTRAST_PARAM; + +/// \~chinese 水印信息 \~english Frame-specific information +typedef struct _MV_CC_FRAME_SPEC_INFO_ +{ + /// \~chinese 设备水印时标 \~english Device frame-specific time scale + unsigned int nSecondCount; ///< [OUT] \~chinese 秒数 \~english The Seconds + unsigned int nCycleCount; ///< [OUT] \~chinese 周期数 \~english The Count of Cycle + unsigned int nCycleOffset; ///< [OUT] \~chinese 周期偏移量 \~english The Offset of Cycle + + float fGain; ///< [OUT] \~chinese 增益 \~english Gain + float fExposureTime; ///< [OUT] \~chinese 曝光时间 \~english Exposure Time + unsigned int nAverageBrightness; ///< [OUT] \~chinese 平均亮度 \~english Average brightness + + /// \~chinese 白平衡相关 \~english White balance + unsigned int nRed; ///< [OUT] \~chinese 红色 \~english Red + unsigned int nGreen; ///< [OUT] \~chinese 绿色 \~english Green + unsigned int nBlue; ///< [OUT] \~chinese 蓝色 \~english Blue + + unsigned int nFrameCounter; ///< [OUT] \~chinese 总帧数 \~english Frame Counter + unsigned int nTriggerIndex; ///< [OUT] \~chinese 触发计数 \~english Trigger Counting + + unsigned int nInput; ///< [OUT] \~chinese 输入 \~english Input + unsigned int nOutput; ///< [OUT] \~chinese 输出 \~english Output + + /// \~chinese ROI区域 \~english ROI Region + unsigned short nOffsetX; ///< [OUT] \~chinese 水平偏移量 \~english OffsetX + unsigned short nOffsetY; ///< [OUT] \~chinese 垂直偏移量 \~english OffsetY + unsigned short nFrameWidth; ///< [OUT] \~chinese 水印宽 \~english The Width of Chunk + unsigned short nFrameHeight; ///< [OUT] \~chinese 水印高 \~english The Height of Chunk + + unsigned int nReserved[16]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_FRAME_SPEC_INFO; + +/// \~chinese 去紫边结构体 \~english PurpleFringing structure +typedef struct _MV_CC_PURPLE_FRINGING_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽度(最小4) \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高度(最小4) \~english Image Height + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcBufLen; ///< [IN] \~chinese 输入数据大小 \~english Input data length + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + + unsigned int nKernelSize; ///< [IN] \~chinese 滤波核尺寸,仅支持3,5,7,9 \~english Filter Kernel Size, only supports 3,5,7,9 + unsigned int nEdgeThreshold; ///< [IN] \~chinese 边缘阈值[0,2040] \~english EdgeThreshold + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_PURPLE_FRINGING_PARAM; + +/// \~chinese ISP配置结构体 \~english ISP configuration structure +typedef struct _MV_CC_ISP_CONFIG_PARAM_T_ +{ + char* pcConfigPath; ///< [IN] \~chinese 配置文件路径(路径修改后会重新创建算法句柄) \~english Config file path + + unsigned int nRes[16]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_ISP_CONFIG_PARAM; + +/// \~chinese 无损解码参数 \~english High Bandwidth decode structure +typedef struct _MV_CC_HB_DECODE_PARAM_T_ +{ + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcLen; ///< [IN] \~chinese 输入数据大小 \~english Input data size + + unsigned int nWidth; ///< [OUT] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [OUT] \~chinese 图像高 \~english Height + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出数据大小 \~english Output data size + enum MvGvspPixelType enDstPixelType; ///< [OUT] \~chinese 输出的像素格式 \~english Output pixel format + + MV_CC_FRAME_SPEC_INFO stFrameSpecInfo; ///< [OUT] \~chinese 水印信息 \~english Frame Spec Info + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_HB_DECODE_PARAM; + +/// \~chinese 录像格式定义 \~english Record Format Type +typedef enum _MV_RECORD_FORMAT_TYPE_ +{ + MV_FormatType_Undefined = 0, ///< \~chinese 未定义的录像格式 \~english Undefined Recode Format Type + MV_FormatType_AVI = 1, ///< \~chinese AVI录像格式 \~english AVI Recode Format Type + +}MV_RECORD_FORMAT_TYPE; + +/// \~chinese 录像参数 \~english Record Parameters +typedef struct _MV_CC_RECORD_PARAM_T_ +{ + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 输入数据的像素格式 \~english Pixel Type + + unsigned short nWidth; ///< [IN] \~chinese 图像宽(2的倍数) \~english Width + unsigned short nHeight; ///< [IN] \~chinese 图像高(2的倍数) \~english Height + + float fFrameRate; ///< [IN] \~chinese 帧率fps [1/16 -1000] \~english The Rate of Frame [1/16 -1000] + unsigned int nBitRate; ///< [IN] \~chinese 码率kbps [128-16*1024] \~english The Rate of Bitrate [128-16*1024] + + MV_RECORD_FORMAT_TYPE enRecordFmtType; ///< [IN] \~chinese 录像格式 \~english Recode Format Type + + char* strFilePath; ///< [IN] \~chinese 录像文件存放路径(如果路径中存在中文,需转成utf-8) \~english File Path + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_RECORD_PARAM; + +/// \~chinese 传入的图像数据 \~english Input Data +typedef struct _MV_CC_INPUT_FRAME_INFO_T_ +{ + unsigned char* pData; ///< [IN] \~chinese 图像数据指针 \~english Record Data + unsigned int nDataLen; ///< [IN] \~chinese 图像大小 \~english The Length of Record Data + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_INPUT_FRAME_INFO; + +/// \~chinese 采集模式 \~english Acquisition mode +typedef enum _MV_CAM_ACQUISITION_MODE_ +{ + MV_ACQ_MODE_SINGLE = 0, ///< \~chinese 单帧模式 \~english Single Mode + MV_ACQ_MODE_MUTLI = 1, ///< \~chinese 多帧模式 \~english Multi Mode + MV_ACQ_MODE_CONTINUOUS = 2, ///< \~chinese 持续采集模式 \~english Continuous Mode + +}MV_CAM_ACQUISITION_MODE; + +/// \~chinese 增益模式 \~english Gain Mode +typedef enum _MV_CAM_GAIN_MODE_ +{ + MV_GAIN_MODE_OFF = 0, ///< \~chinese 关闭 \~english Single Mode + MV_GAIN_MODE_ONCE = 1, ///< \~chinese 一次 \~english Multi Mode + MV_GAIN_MODE_CONTINUOUS = 2, ///< \~chinese 连续 \~english Continuous Mode + +}MV_CAM_GAIN_MODE; + +/// \~chinese 曝光模式 \~english Exposure Mode +typedef enum _MV_CAM_EXPOSURE_MODE_ +{ + MV_EXPOSURE_MODE_TIMED = 0, ///< \~chinese 时间 \~english Timed + MV_EXPOSURE_MODE_TRIGGER_WIDTH = 1, ///< \~chinese 触发脉冲宽度 \~english TriggerWidth +}MV_CAM_EXPOSURE_MODE; + +/// \~chinese 自动曝光模式 \~english Auto Exposure Mode +typedef enum _MV_CAM_EXPOSURE_AUTO_MODE_ +{ + MV_EXPOSURE_AUTO_MODE_OFF = 0, ///< \~chinese 关闭 \~english Off + MV_EXPOSURE_AUTO_MODE_ONCE = 1, ///< \~chinese 一次 \~english Once + MV_EXPOSURE_AUTO_MODE_CONTINUOUS = 2, ///< \~chinese 连续 \~english Continuous + +}MV_CAM_EXPOSURE_AUTO_MODE; + +/// \~chinese 触发模式 \~english Trigger Mode +typedef enum _MV_CAM_TRIGGER_MODE_ +{ + MV_TRIGGER_MODE_OFF = 0, ///< \~chinese 关闭 \~english Off + MV_TRIGGER_MODE_ON = 1, ///< \~chinese 打开 \~english ON + +}MV_CAM_TRIGGER_MODE; + +/// \~chinese Gamma选择器 \~english Gamma Selector +typedef enum _MV_CAM_GAMMA_SELECTOR_ +{ + MV_GAMMA_SELECTOR_USER = 1, ///< \~chinese 用户 \~english Gamma Selector User + MV_GAMMA_SELECTOR_SRGB = 2, ///< \~chinese sRGB \~english Gamma Selector sRGB + +}MV_CAM_GAMMA_SELECTOR; + +/// \~chinese 白平衡 \~english White Balance +typedef enum _MV_CAM_BALANCEWHITE_AUTO_ +{ + MV_BALANCEWHITE_AUTO_OFF = 0, ///< \~chinese 关闭 \~english Off + MV_BALANCEWHITE_AUTO_ONCE = 2, ///< \~chinese 一次 \~english Once + MV_BALANCEWHITE_AUTO_CONTINUOUS = 1, ///< \~chinese 连续 \~english Continuous + +}MV_CAM_BALANCEWHITE_AUTO; + +/// \~chinese 触发源 \~english Trigger Source +typedef enum _MV_CAM_TRIGGER_SOURCE_ +{ + MV_TRIGGER_SOURCE_LINE0 = 0, ///< \~chinese Line0 \~english Line0 + MV_TRIGGER_SOURCE_LINE1 = 1, ///< \~chinese Line1 \~english Line1 + MV_TRIGGER_SOURCE_LINE2 = 2, ///< \~chinese Line2 \~english Line2 + MV_TRIGGER_SOURCE_LINE3 = 3, ///< \~chinese Line3 \~english Line3 + MV_TRIGGER_SOURCE_COUNTER0 = 4, ///< \~chinese Conuter0 \~english Conuter0 + + MV_TRIGGER_SOURCE_SOFTWARE = 7, ///< \~chinese 软触发 \~english Software + MV_TRIGGER_SOURCE_FrequencyConverter= 8, ///< \~chinese 变频器 \~english Frequency Converter + +}MV_CAM_TRIGGER_SOURCE; + +/// \~chinese GigEVision IP配置 \~english GigEVision IP Configuration +#define MV_IP_CFG_STATIC 0x05000000 ///< \~chinese 静态 \~english Static +#define MV_IP_CFG_DHCP 0x06000000 ///< \~chinese DHCP \~english DHCP +#define MV_IP_CFG_LLA 0x04000000 ///< \~chinese LLA \~english LLA + +/// \~chinese GigEVision网络传输模式 \~english GigEVision Net Transfer Mode +#define MV_NET_TRANS_DRIVER 0x00000001 ///< \~chinese 驱动 \~english Driver +#define MV_NET_TRANS_SOCKET 0x00000002 ///< \~chinese Socket \~english Socket + +/// \~chinese CameraLink波特率 \~english CameraLink Baud Rates (CLUINT32) +#define MV_CAML_BAUDRATE_9600 0x00000001 ///< \~chinese 9600 \~english 9600 +#define MV_CAML_BAUDRATE_19200 0x00000002 ///< \~chinese 19200 \~english 19200 +#define MV_CAML_BAUDRATE_38400 0x00000004 ///< \~chinese 38400 \~english 38400 +#define MV_CAML_BAUDRATE_57600 0x00000008 ///< \~chinese 57600 \~english 57600 +#define MV_CAML_BAUDRATE_115200 0x00000010 ///< \~chinese 115200 \~english 115200 +#define MV_CAML_BAUDRATE_230400 0x00000020 ///< \~chinese 230400 \~english 230400 +#define MV_CAML_BAUDRATE_460800 0x00000040 ///< \~chinese 460800 \~english 460800 +#define MV_CAML_BAUDRATE_921600 0x00000080 ///< \~chinese 921600 \~english 921600 +#define MV_CAML_BAUDRATE_AUTOMAX 0x40000000 ///< \~chinese 最大值 \~english Auto Max + +/// \~chinese 异常消息类型 \~english Exception message type +#define MV_EXCEPTION_DEV_DISCONNECT 0x00008001 ///< \~chinese 设备断开连接 \~english The device is disconnected +#define MV_EXCEPTION_VERSION_CHECK 0x00008002 ///< \~chinese SDK与驱动版本不匹配 \~english SDK does not match the driver version + +/// \~chinese 流异常类型 +typedef enum _MV_CC_STREAM_EXCEPTION_TYPE_ +{ + MV_CC_STREAM_EXCEPTION_ABNORMAL_IMAGE = 0x4001, ///< \~chinese 图像异常(图像长度不正确、数据包内容解析异常和校验失败等),丢弃该帧(可能原因:链路传输异常和设备发包异常等) + MV_CC_STREAM_EXCEPTION_LIST_OVERFLOW = 0x4002, ///< \~chinese 缓存列表已满(没有及时取走图像),采集卡下相机不支持, 外部注册缓存时, 单USB口相机不支持 + MV_CC_STREAM_EXCEPTION_LIST_EMPTY = 0x4003, ///< \~chinese 缓存列表为空(取走图像后未及时将图像缓存归还) + MV_CC_STREAM_EXCEPTION_RECONNECTION = 0x4004, ///< \~chinese 触发一次断流恢复(仅U3V支持) + MV_CC_STREAM_EXCEPTION_DISCONNECTED = 0x4005, ///< \~chinese 断流恢复失败,取流被中止(仅U3V支持) + MV_CC_STREAM_EXCEPTION_DEVICE = 0x4006, ///< \~chinese 设备异常,取流被中止(仅U3V支持) + MV_CC_STREAM_EXCEPTION_PARTIAL_IMAGE = 0x4007, ///< \~chinese 行高不足,丢弃残帧(线阵相机或者采集卡配置了残帧丢弃模式,出图行高不足时被SDK丢弃) + MV_CC_STREAM_EXCEPTION_IMAGE_BUFFER_OVERFLOW = 0x4008, ///< \~chinese 设备发送的图像数据大小超过了图像缓冲区容量(该帧丢弃) +}MV_CC_STREAM_EXCEPTION_TYPE; + +/// \~chinese 流异常回调信息 \~english Stream exception callback infomation +typedef struct _MV_CC_STREAM_EXCEPTION_INFO_T_ +{ + char chSerialNumber[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 设备序列号 \~english Device serial number + unsigned int nStreamIndex; ///< [OUT] \~chinese 流通道序号 \~english Stream index + MV_CC_STREAM_EXCEPTION_TYPE enExceptionType; ///< [OUT] \~chinese 流异常类型 \~english Exception type + + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_STREAM_EXCEPTION_INFO; + +///< \~chinese 设备Event事件名称最大长度 \~english Max length of event name +#define MAX_EVENT_NAME_SIZE 128 + +/// \~chinese Event事件回调信息\ \~english Event callback infomation +typedef struct _MV_EVENT_OUT_INFO_ +{ + char EventName[MAX_EVENT_NAME_SIZE]; ///< [OUT] \~chinese Event名称 \~english Event name + + unsigned short nEventID; ///< [OUT] \~chinese Event号 \~english Event ID + unsigned short nStreamChannel; ///< [OUT] \~chinese 流通道序号 \~english Circulation number + + unsigned int nBlockIdHigh; ///< [OUT] \~chinese 帧号高位 (暂无固件支持) \~english BlockId high, not support + unsigned int nBlockIdLow; ///< [OUT] \~chinese 帧号低位 (暂无固件支持) \~english BlockId low, not support + + unsigned int nTimestampHigh; ///< [OUT] \~chinese 时间戳高位 \~english Timestramp high + unsigned int nTimestampLow; ///< [OUT] \~chinese 时间戳低位 \~english Timestramp low + + void* pEventData; ///< [OUT] \~chinese Event数据 (暂无固件支持) \~english Event data, not support + unsigned int nEventDataSize; ///< [OUT] \~chinese Event数据长度 (暂无固件支持) \~english Event data len, not support + + unsigned int nReserved[16]; ///< \~chinese 预留 \~english Reserved + +}MV_EVENT_OUT_INFO; + +/// \~chinese 文件存取 \~english File Access +typedef struct _MV_CC_FILE_ACCESS_T +{ + const char* pUserFileName; ///< [IN] \~chinese 用户文件名 \~english User file name + const char* pDevFileName; ///< [IN] \~chinese 设备文件名 \~english Device file name + + unsigned int nReserved[32]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_FILE_ACCESS; + +/// \~chinese 文件存取 \~english File Access +typedef struct _MV_CC_FILE_ACCESS_E +{ + char* pUserFileBuf; ///< [IN] \~chinese 用户数据缓存 \~english User data Buffer + unsigned int pFileBufSize; ///< [IN] \~chinese 用户数据缓存大小 \~english data buffer size + unsigned int pFileBufLen; ///< [OUT][IN] \~chinese 文件数据缓存总长度(读取时输出文件数据总长度,写入时输入文件数据总长度) \~english data buffer len + const char* pDevFileName; ///< [IN] \~chinese 设备文件名 \~english Device file name + + unsigned int nReserved[32]; ///< \~chinese 预留 \~english Reserved +}MV_CC_FILE_ACCESS_EX; + +/// \~chinese 文件存取进度 \~english File Access Progress +typedef struct _MV_CC_FILE_ACCESS_PROGRESS_T +{ + int64_t nCompleted; ///< [OUT] \~chinese 已完成的长度 \~english Completed Length + int64_t nTotal; ///< [OUT] \~chinese 总长度 \~english Total Length + + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_FILE_ACCESS_PROGRESS; + +/// \~chinese Gige的传输类型 \~english The transmission type of Gige +typedef enum _MV_GIGE_TRANSMISSION_TYPE_ +{ + MV_GIGE_TRANSTYPE_UNICAST = 0x0, ///< \~chinese 表示单播(默认) \~english Unicast mode + MV_GIGE_TRANSTYPE_MULTICAST = 0x1, ///< \~chinese 表示组播(组播IP范围[224.*.*.*-239.*.*.*]) \~english Multicast mode + MV_GIGE_TRANSTYPE_LIMITEDBROADCAST = 0x2, ///< \~chinese 表示局域网内广播,暂不支持 \~english Limited broadcast mode,not support + MV_GIGE_TRANSTYPE_SUBNETBROADCAST = 0x3, ///< \~chinese 表示子网内广播,暂不支持 \~english Subnet broadcast mode,not support + MV_GIGE_TRANSTYPE_CAMERADEFINED = 0x4, ///< \~chinese 表示从设备获取,暂不支持 \~english Transtype from camera,not support + MV_GIGE_TRANSTYPE_UNICAST_DEFINED_PORT = 0x5, ///< \~chinese 表示用户自定义应用端接收图像数据Port号 \~english User Defined Receive Data Port + MV_GIGE_TRANSTYPE_UNICAST_WITHOUT_RECV = 0x00010000, ///< \~chinese 表示设置了单播,但本实例不接收图像数据 \~english Unicast without receive data + MV_GIGE_TRANSTYPE_MULTICAST_WITHOUT_RECV= 0x00010001, ///< \~chinese 表示组播模式,但本实例不接收图像数据 \~english Multicast without receive data + +}MV_GIGE_TRANSMISSION_TYPE; + +/// \~chinese 网络传输模式 \~english Transmission type +typedef struct _MV_TRANSMISSION_TYPE_T +{ + MV_GIGE_TRANSMISSION_TYPE enTransmissionType; ///< [IN] \~chinese 传输模式 \~english Transmission type + unsigned int nDestIp; ///< [IN] \~chinese 目标IP,组播模式下有意义 \~english Destination IP + unsigned short nDestPort; ///< [IN] \~chinese 目标Port,组播模式下有意义 \~english Destination port + + unsigned int nReserved[32]; ///< \~chinese 预留 \~english Reserved + +}MV_TRANSMISSION_TYPE; + +/// \~chinese 动作命令信息 \~english Action Command +typedef struct _MV_ACTION_CMD_INFO_T +{ + unsigned int nDeviceKey; ///< [IN] \~chinese 设备密钥 \~english Device Key; + unsigned int nGroupKey; ///< [IN] \~chinese 组键 \~english Group Key + unsigned int nGroupMask; ///< [IN] \~chinese 组掩码 \~english Group Mask + + unsigned int bActionTimeEnable; ///< [IN] \~chinese 只有设置成1时Action Time才有效,非1时无效 \~english Action Time Enable + int64_t nActionTime; ///< [IN] \~chinese 预定的时间,和主频有关 \~english Action Time + + const char* pBroadcastAddress; ///< [IN] \~chinese 广播包地址 \~english Broadcast Address + unsigned int nTimeOut; ///< [IN] \~chinese 等待ACK的超时时间,如果为0表示不需要ACK \~english TimeOut + + unsigned int bSpecialNetEnable; ///< [IN] \~chinese 只有设置成1时指定的网卡IP才有效,非1时无效 \~english Special IP Enable + unsigned int nSpecialNetIP; ///< [IN] \~chinese 指定的网卡IP \~english Special Net IP address + + unsigned int nReserved[14]; ///< \~chinese 预留 \~english Reserved + +}MV_ACTION_CMD_INFO; + +/// \~chinese 动作命令返回信息 \~english Action Command Result +typedef struct _MV_ACTION_CMD_RESULT_T +{ + unsigned char strDeviceAddress[12 + 3 + 1]; ///< [OUT] \~chinese 设备IP \~english IP address of the device + + int nStatus; ///< [OUT] \~chinese 状态码 \~english status code returned by the device + //1.0x0000:success. + //2.0x8001:Command is not supported by the device. + //3.0x8013:The device is not synchronized to a master clock to be used as time reference. + //4.0x8015:A device queue or packet data has overflowed. + //5.0x8016:The requested scheduled action command was requested at a time that is already past. + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MV_ACTION_CMD_RESULT; + +/// \~chinese 动作命令返回信息列表 \~english Action Command Result List +typedef struct _MV_ACTION_CMD_RESULT_LIST_T +{ + unsigned int nNumResults; ///< [OUT] \~chinese 返回值个数 \~english Number of returned values + MV_ACTION_CMD_RESULT* pResults; ///< [OUT] \~chinese 动作命令结果 \~english Reslut of action command + +}MV_ACTION_CMD_RESULT_LIST; + +/// \~chinese 每个节点对应的接口类型 \~english Interface type corresponds to each node +enum MV_XML_InterfaceType +{ + IFT_IValue, ///< \~chinese Value \~english IValue interface + IFT_IBase, ///< \~chinese Base \~english IBase interface + IFT_IInteger, ///< \~chinese Integer \~english IInteger interface + IFT_IBoolean, ///< \~chinese Boolean \~english IBoolean interface + IFT_ICommand, ///< \~chinese Command \~english ICommand interface + IFT_IFloat, ///< \~chinese Float \~english IFloat interface + IFT_IString, ///< \~chinese String \~english IString interface + IFT_IRegister, ///< \~chinese Register \~english IRegister interface + IFT_ICategory, ///< \~chinese Category \~english ICategory interface + IFT_IEnumeration, ///< \~chinese Enumeration \~english IEnumeration interface + IFT_IEnumEntry, ///< \~chinese EnumEntry \~english IEnumEntry interface + IFT_IPort, ///< \~chinese Port \~english IPort interface +}; + +/// \~chinese 节点的访问模式 \~english Node Access Mode +enum MV_XML_AccessMode +{ + AM_NI, ///< \~chinese 不可实现 \~english Not implemented + AM_NA, ///< \~chinese 不可用 \~english Not available + AM_WO, ///< \~chinese 只写 \~english Write Only + AM_RO, ///< \~chinese 只读 \~english Read Only + AM_RW, ///< \~chinese 读写 \~english Read and Write + AM_Undefined, ///< \~chinese 未定义 \~english Object is not yet initialized + AM_CycleDetect, ///< \~chinese 内部用于AccessMode循环检测 \~english used internally for AccessMode cycle detection +}; + +/// \~chinese 最大节点个数 \~english Max Number of Nodes +#define MV_MAX_NODE_NUM 1024 +/// \~chinese 节点名称的最大长度 \~english Max Length of a Node Name +#define MV_MAX_NODE_NAME_LEN 64 +/// \~chinese 节点名称 \~english Node Name +typedef struct _MVCC_NODE_NAME_T +{ + char strName[MV_MAX_NODE_NAME_LEN]; ///< \~chinese 节点名称 \~english Nodes Name + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_NODE_NAME; +/// \~chinese 节点列表 \~english Node List +typedef struct _MVCC_NODE_NAME_LIST_T +{ + unsigned int nNodeNum; ///< \~chinese 节点个数 \~english Number of Node + MVCC_NODE_NAME stNodeName[MV_MAX_NODE_NUM]; ///< \~chinese 节点名称 \~english Node Name + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_NODE_NAME_LIST; + +/// \~chinese 最大错误个数 \~english Max Number of Error +#define MV_MAX_NODE_ERROR_NUM 64 + +/// \~chinese 导入参数报错时的原因,错误码 \~english Reasons for importing parameter errors code +typedef enum _MVCC_NODE_ERR_TYPE_ +{ + MVCC_NODE_ERR_NODE_INVALID = 1, ///< \~chinese 节点不存在 \~english Usually, the operating node does not exist in the device + MVCC_NODE_ERR_ACCESS = 2, ///< \~chinese 访问条件错误,通常是节点不可读写 \~english Access condition error, usually due to nodes not being readable or writable + MVCC_NODE_ERR_OUT_RANGE = 3, ///< \~chinese 写入越界,超出该节点支持的范围 \~english Write out of bounds, beyond the supported range of this node + MVCC_NODE_ERR_VERIFY_FAILD = 4, ///< \~chinese 校验失败,通常是写入的值与文件中的值不匹配 \~english Verification failed, usually due to a mismatch between the written value and the value in the file + + MVCC_NODE_ERR_OTHER = 100, ///< \~chinese 其它错误,可查阅日志 \~english Other errors, can view logs + +}MVCC_NODE_ERR_TYPE; +/// \~chinese 错误信息 \~english Error Name +typedef struct _MVCC_NODE_ERROR_T +{ + char strName[MV_MAX_NODE_NAME_LEN]; ///< \~chinese 节点名称 \~english Nodes Name + MVCC_NODE_ERR_TYPE enErrType; ///< \~chinese 错误类型 \~english Error Type + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_NODE_ERROR; +/// \~chinese 错误信息列表 \~english Error List +typedef struct _MVCC_NODE_ERROR_LIST_T +{ + unsigned int nErrorNum; ///< \~chinese 错误个数 \~english Number of Error + MVCC_NODE_ERROR stNodeError[MV_MAX_NODE_ERROR_NUM]; ///< \~chinese 错误信息 \~english Error Name + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_NODE_ERROR_LIST; + +/// \~chinese 最大XML符号数 \~english Max XML Symbolic Number +#define MV_MAX_XML_SYMBOLIC_NUM 64 +/// \~chinese 枚举类型值 \~english Enumeration Value +typedef struct _MVCC_ENUMVALUE_T +{ + unsigned int nCurValue; ///< [OUT] \~chinese 当前值 \~english Current Value + unsigned int nSupportedNum; ///< [OUT] \~chinese 数据的有效数据个数 \~english Number of valid data + unsigned int nSupportValue[MV_MAX_XML_SYMBOLIC_NUM]; ///< [OUT] \~chinese 支持的枚举值 \~english Support Value + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_ENUMVALUE; + +/// \~chinese 最大枚举条目对应的符号数量 \~english Max Enum Entry Symbolic Number +#define MV_MAX_ENUM_SYMBOLIC_NUM 256 + +/// \~chinese 枚举类型值 \~english Enumeration Value +typedef struct _MVCC_ENUMVALUE_EX_T +{ + unsigned int nCurValue; ///< [OUT] \~chinese 当前值 \~english Current Value + unsigned int nSupportedNum; ///< [OUT] \~chinese 数据的有效数据个数 \~english Number of valid data + unsigned int nSupportValue[MV_MAX_ENUM_SYMBOLIC_NUM]; ///< [OUT] \~chinese 支持的枚举值 \~english Support Value + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_ENUMVALUE_EX; + + +/// \~chinese 最大枚举条目对应的符号长度 \~english Max Enum Entry Symbolic Number +#define MV_MAX_SYMBOLIC_LEN 64 +/// \~chinese 枚举类型条目 \~english Enumeration Entry +typedef struct _MVCC_ENUMENTRY_T +{ + unsigned int nValue; ///< [IN] \~chinese 指定值 \~english Value + char chSymbolic[MV_MAX_SYMBOLIC_LEN]; ///< [OUT] \~chinese 指定值对应的符号 \~english Symbolic + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_ENUMENTRY; + +/// \~chinese Int类型值 \~english Int Value +typedef struct _MVCC_INTVALUE_T +{ + unsigned int nCurValue; ///< [OUT] \~chinese 当前值 \~english Current Value + unsigned int nMax; ///< [OUT] \~chinese 最大值 \~english Max + unsigned int nMin; ///< [OUT] \~chinese 最小值 \~english Min + unsigned int nInc; ///< [OUT] \~chinese \~english Inc + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_INTVALUE; + +/// \~chinese Int类型值Ex \~english Int Value Ex +typedef struct _MVCC_INTVALUE_EX_T +{ + int64_t nCurValue; ///< [OUT] \~chinese 当前值 \~english Current Value + int64_t nMax; ///< [OUT] \~chinese 最大值 \~english Max + int64_t nMin; ///< [OUT] \~chinese 最小值 \~english Min + int64_t nInc; ///< [OUT] \~chinese Inc \~english Inc + + unsigned int nReserved[16]; ///< \~chinese 预留 \~english Reserved + +}MVCC_INTVALUE_EX; + +/// \~chinese Float类型值 \~english Float Value +typedef struct _MVCC_FLOATVALUE_T +{ + float fCurValue; ///< [OUT] \~chinese 当前值 \~english Current Value + float fMax; ///< [OUT] \~chinese 最大值 \~english Max + float fMin; ///< [OUT] \~chinese 最小值 \~english Min + + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_FLOATVALUE; + +/// \~chinese String类型值 \~english String Value +typedef struct _MVCC_STRINGVALUE_T +{ + char chCurValue[256]; ///< [OUT] \~chinese 当前值 \~english Current Value + + int64_t nMaxLength; ///< [OUT] \~chinese 最大长度 \~english MaxLength + unsigned int nReserved[2]; ///< \~chinese 预留 \~english Reserved + +}MVCC_STRINGVALUE; + +/// \~chinese 辅助线颜色 \~english Color of Auxiliary Line +typedef struct _MVCC_COLORF +{ + float fR; ///< [IN] \~chinese 红色,根据像素颜色的相对深度,范围为[0.0 , 1.0],代表着[0, 255]的颜色深度 \~english Red,Range[0.0, 1.0] + float fG; ///< [IN] \~chinese 绿色,根据像素颜色的相对深度,范围为[0.0 , 1.0],代表着[0, 255]的颜色深度 \~english Green,Range[0.0, 1.0] + float fB; ///< [IN] \~chinese 蓝色,根据像素颜色的相对深度,范围为[0.0 , 1.0],代表着[0, 255]的颜色深度 \~english Blue,Range[0.0, 1.0] + float fAlpha; ///< [IN] \~chinese 透明度,根据像素颜色的相对透明度,范围为[0.0 , 1.0],GDI渲染不支持 \~english Alpha,Range[0.0, 1.0], it is not supported under GDI rendering. + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_COLORF; + +/// \~chinese 自定义点 \~english Point defined +typedef struct _MVCC_POINTF +{ + float fX; ///< [IN] \~chinese 该点距离图像左边缘距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Left,Range[0.0, 1.0] + float fY; ///< [IN] \~chinese 该点距离图像上边缘距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Top,Range[0.0, 1.0] + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_POINTF; + +/// \~chinese 矩形框区域信息 \~english Rect Area Info +typedef struct _MVCC_RECT_INFO +{ + float fTop; ///< [IN] \~chinese 矩形上边缘距离图像上边缘的距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Top,Range[0, 1.0] + float fBottom; ///< [IN] \~chinese 矩形下边缘距离图像上边缘的距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Top,Range[0, 1.0] + float fLeft; ///< [IN] \~chinese 矩形左边缘距离图像左边缘的距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Left,Range[0, 1.0] + float fRight; ///< [IN] \~chinese 矩形右边缘距离图像左边缘的距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Left,Range[0, 1.0] + + MVCC_COLORF stColor; ///< [IN] \~chinese 辅助线颜色 \~english Color of Auxiliary Line + unsigned int nLineWidth; ///< [IN] \~chinese 辅助线宽度,宽度只能是1或2 \~english Width of Auxiliary Line, width is 1 or 2 + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_RECT_INFO; + +/// \~chinese 圆形框区域信息 \~english Circle Area Info +typedef struct _MVCC_CIRCLE_INFO +{ + MVCC_POINTF stCenterPoint; ///< [IN] \~chinese 圆心信息 \~english Circle Point Info + + float fR1; ///< [IN] \~chinese 宽向半径,根据图像的相对位置[0, 1.0],半径与圆心的位置有关,需保证画出的圆在显示框范围之内,否则报错 \~english Windth Radius, Range[0, 1.0] + float fR2; ///< [IN] \~chinese 高向半径,根据图像的相对位置[0, 1.0],半径与圆心的位置有关,需保证画出的圆在显示框范围之内,否则报错 \~english Height Radius, Range[0, 1.0] + + MVCC_COLORF stColor; ///< [IN] \~chinese 辅助线颜色信息 \~english Color of Auxiliary Line + unsigned int nLineWidth; ///< [IN] \~chinese 辅助线宽度,宽度只能是1或2 \~english Width of Auxiliary Line, width is 1 or 2 + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_CIRCLE_INFO; + +/// \~chinese 线条辅助线信息 \~english Linear Auxiliary Line Info +typedef struct _MVCC_LINES_INFO +{ + MVCC_POINTF stStartPoint; ///< [IN] \~chinese 线条辅助线的起始点坐标 \~english The Start Point of Auxiliary Line + MVCC_POINTF stEndPoint; ///< [IN] \~chinese 线条辅助线的终点坐标 \~english The End Point of Auxiliary Line + MVCC_COLORF stColor; ///< [IN] \~chinese 辅助线颜色信息 \~english Color of Auxiliary Line + unsigned int nLineWidth; ///< [IN] \~chinese 辅助线宽度,宽度只能是1或2 \~english Width of Auxiliary Line, width is 1 or 2 + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved + +}MVCC_LINES_INFO; + +///< \~chinese 分时曝光时最多将源图像拆分的个数 \~english The maximum number of source image to be split in time-division exposure +#define MV_MAX_SPLIT_NUM 8 + +/// \~chinese 图像重构的方式 \~english Image reconstruction method +typedef enum _MV_IMAGE_RECONSTRUCTION_METHOD_ +{ + MV_SPLIT_BY_LINE = 1, ///< \~chinese 源图像单行拆分成多张图像 \~english Source image split into multiple images by line + +}MV_IMAGE_RECONSTRUCTION_METHOD; + +/// \~chinese 图像重构后的图像列表 \~english List of images after image reconstruction +typedef struct _MV_OUTPUT_IMAGE_INFO_ +{ + unsigned int nWidth; ///< [OUT] \~chinese 源图像宽 \~english Source Image Width + unsigned int nHeight; ///< [OUT] \~chinese 源图像高 \~english Source Image Height + enum MvGvspPixelType enPixelType; ///< [OUT] \~chinese 像素格式 \~english Pixel format + + unsigned char* pBuf; ///< [IN][OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nBufLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved +}MV_OUTPUT_IMAGE_INFO; + +/// \~chinese 重构图像参数信息 \~english Restructure image parameters +typedef struct _MV_RECONSTRUCT_IMAGE_PARAM_ +{ + unsigned int nWidth; ///< [IN] \~chinese 源图像宽 \~english Source Image Width + unsigned int nHeight; ///< [IN] \~chinese 源图像高 \~english Source Image Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + + unsigned char* pSrcData; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input data length + + unsigned int nExposureNum; ///< [IN] \~chinese 曝光个数(1-8] \~english Exposure number + MV_IMAGE_RECONSTRUCTION_METHOD enReconstructMethod; ///< [IN] \~chinese 图像重构方式 \~english Image restructuring method + + MV_OUTPUT_IMAGE_INFO stDstBufList[MV_MAX_SPLIT_NUM]; ///< [OUT] \~chinese 输出数据缓存信息 \~english Output data info + + unsigned int nRes[4]; +}MV_RECONSTRUCT_IMAGE_PARAM; + +/// \~chinese 串口信息 \~english Serial Port Info +typedef struct _MV_CAML_SERIAL_PORT_ +{ + unsigned char chSerialPort[INFO_MAX_BUFFER_SIZE]; ///< [OUT] \~chinese 串口号 \~english Serial Port + + unsigned int nRes[4]; ///<\~chinese 预留 \~english Reserved +}MV_CAML_SERIAL_PORT; + +///< \~chinese 最大支持的串口数量 \~english The maximum number of serial port supported +#define MV_MAX_SERIAL_PORT_NUM 64 + +typedef struct _MV_CAML_SERIAL_PORT_LIST_ +{ + unsigned int nSerialPortNum; ///< [OUT] \~chinese 串口数量 \~english Serial Port Num + MV_CAML_SERIAL_PORT stSerialPort[MV_MAX_SERIAL_PORT_NUM]; ///< [IN][OUT] \~chinese 串口信息 \~english Serial Port Information + + unsigned int nRes[4]; ///<\~chinese 预留 \~english Reserved +}MV_CAML_SERIAL_PORT_LIST; + +#endif /* _MV_CAMERA_PARAMS_H_ */ diff --git a/third_party/hikrobot/include/MvCamera.h b/third_party/hikrobot/include/MvCamera.h new file mode 100644 index 0000000..be58aaf --- /dev/null +++ b/third_party/hikrobot/include/MvCamera.h @@ -0,0 +1,151 @@ +/************************************************************************/ +/* 以C++接口为基础,对常用函数进行二次封装,方便用户使用 */ +/************************************************************************/ + +#ifndef _MV_CAMERA_H_ +#define _MV_CAMERA_H_ + +#include "MvCameraControl.h" +#include + +#ifndef MV_NULL +#define MV_NULL 0 +#endif + + + +class CMvCamera +{ +public: + CMvCamera(); + ~CMvCamera(); + + // ch:初始化SDK | en:Initialize SDK + static int InitSDK(); + + // ch:反初始化SDK | en:Finalize SDK + static int FinalizeSDK(); + + // ch:获取SDK版本号 | en:Get SDK Version + static int GetSDKVersion(); + + // ch:枚举设备 | en:Enumerate Device + static int EnumDevices(unsigned int nTLayerType, MV_CC_DEVICE_INFO_LIST* pstDevList); + + // ch:判断设备是否可达 | en:Is the device accessible + static bool IsDeviceAccessible(MV_CC_DEVICE_INFO* pstDevInfo, unsigned int nAccessMode); + + // ch:打开设备 | en:Open Device + int Open(MV_CC_DEVICE_INFO* pstDeviceInfo); + + // ch:关闭设备 | en:Close Device + int Close(); + + // ch:判断相机是否处于连接状态 | en:Is The Device Connected + bool IsDeviceConnected(); + + // ch:注册图像数据回调 | en:Register Image Data CallBack + int RegisterImageCallBack(void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser), void* pUser); + + int RegisterImageCallBack2(void(__stdcall* cbOutput)(MV_FRAME_OUT* pstFrame, void *pUser, bool bAutoFree), void* pUser, bool bAutoFree); + + + // ch:开启抓图 | en:Start Grabbing + int StartGrabbing(); + + // ch:停止抓图 | en:Stop Grabbing + int StopGrabbing(); + + // ch:主动获取一帧图像数据 | en:Get one frame initiatively + int GetImageBuffer(MV_FRAME_OUT* pFrame, int nMsec); + + // ch:释放图像缓存 | en:Free image buffer + int FreeImageBuffer(MV_FRAME_OUT* pFrame); + + // ch:显示一帧图像 | en:Display one frame image + int DisplayOneFrame(void* hDisplay, MV_CC_IMAGE* pImageInfo); + + // ch:设置SDK内部图像缓存节点个数 | en:Set the number of the internal image cache nodes in SDK + int SetImageNodeNum(unsigned int nNum); + + // ch:获取设备信息 | en:Get device information + int GetDeviceInfo(MV_CC_DEVICE_INFO* pstDevInfo); + + // ch:获取GEV相机的统计信息 | en:Get detect info of GEV camera + int GetGevAllMatchInfo(MV_MATCH_INFO_NET_DETECT* pMatchInfoNetDetect); + + // ch:获取U3V相机的统计信息 | en:Get detect info of U3V camera + int GetU3VAllMatchInfo(MV_MATCH_INFO_USB_DETECT* pMatchInfoUSBDetect); + + // ch:获取和设置Int型参数,如 Width和Height + // en:Get Int type parameters, such as Width and Height + int GetIntValue(IN const char* strKey, OUT MVCC_INTVALUE_EX *pIntValue); + int SetIntValue(IN const char* strKey, IN int64_t nValue); + + // ch:获取和设置Enum型参数,如 PixelFormat + // en:Get Enum type parameters, such as PixelFormat + int GetEnumValue(IN const char* strKey, OUT MVCC_ENUMVALUE *pEnumValue); + int SetEnumValue(IN const char* strKey, IN unsigned int nValue); + int SetEnumValueByString(IN const char* strKey, IN const char* sValue); + int GetEnumEntrySymbolic(IN const char* strKey, IN MVCC_ENUMENTRY* pstEnumEntry); + + // ch:获取和设置Float型参数,如 ExposureTime和Gain + // en:Get Float type parameters, such as ExposureTime and Gain + int GetFloatValue(IN const char* strKey, OUT MVCC_FLOATVALUE *pFloatValue); + int SetFloatValue(IN const char* strKey, IN float fValue); + + // ch:获取和设置Bool型参数,如 ReverseX + // en:Get Bool type parameters, such as ReverseX + int GetBoolValue(IN const char* strKey, OUT bool *pbValue); + int SetBoolValue(IN const char* strKey, IN bool bValue); + + // ch:获取和设置String型参数,如 DeviceUserID + // en:Get String type parameters, such as DeviceUserID + int GetStringValue(IN const char* strKey, MVCC_STRINGVALUE *pStringValue); + int SetStringValue(IN const char* strKey, IN const char * strValue); + + // ch:执行一次Command型命令,如 UserSetSave + // en:Execute Command once, such as UserSetSave + int CommandExecute(IN const char* strKey); + + // ch:探测网络最佳包大小(只对GigE相机有效) | en:Detection network optimal package size(It only works for the GigE camera) + int GetOptimalPacketSize(unsigned int* pOptimalPacketSize); + + // ch:注册消息异常回调 | en:Register Message Exception CallBack + int RegisterExceptionCallBack(void(__stdcall* cbException)(unsigned int nMsgType, void* pUser), void* pUser); + + // ch:注册单个事件回调 | en:Register Event CallBack + int RegisterEventCallBack(const char* pEventName, void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser), void* pUser); + + // ch:强制IP | en:Force IP + int ForceIp(unsigned int nIP, unsigned int nSubNetMask, unsigned int nDefaultGateWay); + + // ch:配置IP方式 | en:IP configuration method + int SetIpConfig(unsigned int nType); + + // ch:设置网络传输模式 | en:Set Net Transfer Mode + int SetNetTransMode(unsigned int nType); + + // ch:像素格式转换 | en:Pixel format conversion + int ConvertPixelType(MV_CC_PIXEL_CONVERT_PARAM_EX* pstCvtParam); + + // ch:保存图片 | en:save image + int SaveImage(MV_SAVE_IMAGE_PARAM_EX3* pstParam); + + // ch:保存图片为文件 | en:Save the image as a file + int SaveImageToFile(MV_CC_IMAGE* pstImage, MV_CC_SAVE_IMAGE_PARAM* pSaveImageParam, const char* pcImagePath); + + // ch:绘制圆形辅助线 | en:Draw circle auxiliary line + int DrawCircle(MVCC_CIRCLE_INFO* pCircleInfo); + + // ch:绘制线形辅助线 | en:Draw lines auxiliary line + int DrawLines(MVCC_LINES_INFO* pLinesInfo); + +private: + + void* m_hDevHandle; + + +}; + +#endif//_MV_CAMERA_H_ diff --git a/third_party/hikrobot/include/MvCameraControl.h b/third_party/hikrobot/include/MvCameraControl.h new file mode 100644 index 0000000..b958233 --- /dev/null +++ b/third_party/hikrobot/include/MvCameraControl.h @@ -0,0 +1,3195 @@ + +#ifndef _MV_CAMERA_CTRL_H_ +#define _MV_CAMERA_CTRL_H_ + +#include "MvErrorDefine.h" +#include "CameraParams.h" +#include "MvObsoleteInterfaces.h" + + + +#ifndef MV_CAMCTRL_API + +#if (defined (_WIN32) || defined(WIN64)) +#if defined(MV_CAMCTRL_EXPORTS) +#define MV_CAMCTRL_API __declspec(dllexport) +#else +#define MV_CAMCTRL_API __declspec(dllimport) +#endif +#else +#ifndef __stdcall +#define __stdcall +#endif + +#ifndef MV_CAMCTRL_API +#define MV_CAMCTRL_API +#endif +#endif + +#endif + +#ifdef MV_CAMCTRL_API + +#if (defined (_WIN32) || defined(WIN64)) + #if defined(MV_CAMCTRL_EXPORTS) + #define MV_CAMCTRL_API __declspec(dllexport) + #else + #define MV_CAMCTRL_API __declspec(dllimport) + #endif + #else + #ifndef __stdcall + #define __stdcall + #endif + + #if defined(MV_CAMCTRL_EXPORTS) + #define MV_CAMCTRL_API __attribute__((visibility("default"))) + #else + #define MV_CAMCTRL_API + #endif + #endif + +#endif + +#ifndef IN + #define IN +#endif + +#ifndef OUT + #define OUT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/****************************** ch: 摘要 | en: Instructions**********************************************/ + +/** + * @~chinese + * 该头文件主要包含13部分: + * 0.回调函数定义 + * 1.SDK初始化 + * 2.相机的配置(枚举/打开/关闭)和取流接口 + * 3.采集卡的配置(枚举/打开/关闭) + * 4.相机/采集卡属性万能配置接口&读写寄存器接口 + * 5.相机/采集卡 升级 + * 6.相机和采集卡 注册异常回调和事件接口 + * 7.仅GigE设备支持的接口 + * 8.仅CameraLink 设备支持的接口 + * 9.仅U3V设备支持的接口 + * 10.GenTL相关接口 + * 11.图像保存、格式转换等相关接口 + * 12.适用于支持串口通信的设备接口 + + * @~english + * This header file mainly includes 13 sections: + * 0.Callback function definition + * 1.SDK initialization + * 2.Camera configuration (enumeration/open/close) and streaming API + * 3.Frame grabber configuration (enumeration/open/close) + * 4.Universal property configuration API & register read/write API for cameras/frame grabbers + * 5.Firmware upgrade for cameras/frame grabbers + * 6.Exception callback registration and event API for cameras and frame grabbers + * 7.API exclusively for GigE devices + * 8.API exclusively for CameraLink devices + * 9.API exclusively for USB3 Vision (U3V) devices + * 10.GenTL-related API + * 11.Image saving and format conversion API + * 12.API for devices supporting serial communication +**/ + + +/*******************Part0 ch: 回调函数定义 | en: Callback function definition*******************/ + +/// \addtogroup 回调函数定义 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 取图回调函数 + * @param pData [OUT] 图像数据指针 + * @param pFrameInfo [OUT] 图像信息结构体 + * @param pUser [OUT] 用户自定义变量 + + * @~english + * @brief Image Callback function + * @param pData [OUT] It refers to the pointer to image data. + * @param pFrameInfo [OUT] It refers to the image information structure. + * @param pUser [OUT] It refers to the user-defined variable. +*****************************************************************************/ +typedef void(__stdcall *MvImageCallbackEx)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 取图回调函数 + * @param pstFrame [OUT] 图像数据和图像信息 + * @param pUser [OUT] 用户自定义变量 + * @param bAutoFree [OUT] true-回调函数退出后自动释放图像缓存,false-回调结束不释放图像缓存,需调用 MV_CC_FreeImageBuffer() + + + * @~english + * @brief Image callback function + * @param pstFrame [OUT] It refers to the image data and information. + * @param pUser [OUT] It refers to the user-defined variable. + * @param bAutoFree [OUT] Whether to release image buffer automatically after callback is completed. + true: the image buffer is released automatically after callback is completed, + false: the image buffer cannot be released automatically, and it is required to call MV_CC_FreeImageBuffer(). + +*****************************************************************************/ +typedef void(__stdcall *MvImageCallbackEx2)(MV_FRAME_OUT* pstFrame, void *pUser, bool bAutoFree); + +/********************************************************************//** + * @~chinese + * @brief 事件回调函数 + * @param pEventInfo [OUT] 事件信息 + * @param pUser [OUT] 用户自定义变量 + + * @~english + * @brief Event callback function + * @param pEventInfo [OUT] It refers to the event information. + * @param pUser [OUT] It refers to the user-defined variable. +*****************************************************************************/ +typedef void(__stdcall *MvEventCallback)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 流异常回调函数 + * @param pstStreamExceptionInfo [OUT] 流异常信息 + * @param pUser [OUT] 用户自定义变量 + + * @~english + * @brief Stream exception callback function. + * @param pstStreamExceptionInfo [OUT] It refers to the stream exception information. + * @param pUser [OUT] It refers to the user-defined variable. +*****************************************************************************/ +typedef void(__stdcall *MvStreamExceptionCallback)(MV_CC_STREAM_EXCEPTION_INFO* pstStreamExceptionInfo, void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 异常消息回调 + * @param nMsgType [OUT] 异常类型 + * @param pUser [OUT] 用户自定义变量 + + * @~english + * @brief Exception callback function. + * @param nMsgType [OUT] It refers to the exception type. + * @param pUser [OUT] It refers to the user-defined variable. +*****************************************************************************/ +typedef void(__stdcall *MvExceptionCallback)(unsigned int nMsgType, void *pUser); + +/// @} + +/**************************Part1 ch: SDK 初始化 | en: SDK Initialization ******************************************/ + +/// \addtogroup SDK初始化 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 初始化SDK + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Initializes SDK resources. + * @return Returns MV_OK for success, and returns corresponding error code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_Initialize(); + +/********************************************************************//** + * @~chinese + * @brief 反初始化SDK,释放资源 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks main函数退出前调用 + + * @~english + * @brief Releases SDK resources. + * @return Returns MV_OK for success, and returns corresponding error code for failure. + * @remarks Call this API before exiting the main function. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_Finalize(); + +/// @} + +/// \addtogroup SDK版本信息 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 获取SDK版本号 + * @return 返回4字节版本号 + | 主 | 次 | 修正 | 测试 | + | :---: | :---: | :---: | :---: | + | 8bits | 8bits | 8bits | 8bits | + * @remarks \li 比如返回值为0x01000001,即SDK版本号为V1.0.0.1。 + \li MV_CC_GetSDKVersion() 引入头文件、Lib文件后,SDK环境搭建完毕,可直接调用。 + + * @~english + * @brief Gets SDK Version + * @return Always return 4 Bytes of version number + |Main |Sub |Rev | Test| + 8bits 8bits 8bits 8bits + * @remarks For example, if the return value is 0x01000001, the SDK version is V1.0.0.1. + ************************************************************************/ +MV_CAMCTRL_API unsigned int __stdcall MV_CC_GetSDKVersion(); + +/// @} + + + +/**************************Part2 ch: 相机的控制和取流 | en: Camera control and streaming******************************************/ + +/// \addtogroup 相机初始化 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 枚举设备 + * @param nTLayerType [IN] 枚举传输层, 参数定义参见CameraParams.h定义 + | 传输层协议类型定义 | 值 | 说明 | + | :--- | :---: | :--- | + | \ref MV_UNKNOW_DEVICE | 0x00000000 | 未知设备类型 | + | \ref MV_GIGE_DEVICE | 0x00000001 | GigE设备 | + | \ref MV_1394_DEVICE | 0x00000002 | 1394-a/b设备 | + | \ref MV_USB_DEVICE | 0x00000004 | USB设备 | + | \ref MV_CAMERALINK_DEVICE | 0x00000008 | 串口设备,包含Camera Link设备和串口视觉控制器 | + | \ref MV_VIR_GIGE_DEVICE | 0x00000010 | 虚拟GigE设备 | + | \ref MV_VIR_USB_DEVICE | 0x00000020 | 虚拟USB设备 | + | \ref MV_GENTL_GIGE_DEVICE | 0x00000040 | 自研网卡下GigE设备 | + | \ref MV_GENTL_CAMERALINK_DEVICE | 0x00000080 | CameraLink设备 | + | \ref MV_GENTL_CXP_DEVICE | 0x00000100 | CoaXPress设备 | + | \ref MV_GENTL_XOF_DEVICE | 0x00000200 | XoF设备 | + | \ref MV_GENTL_VIR_DEVICE | 0x00000800 | 虚拟设备 | + * @param pstDevList [IN][OUT] 设备列表 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,建议尽量避免多线程枚举操作。\n + * \li 参数枚举传输层,适配传入MV_GIGE_DEVICE、MV_1394_DEVICE、MV_USB_DEVICE、MV_CAMERALINK_DEVICE;MV_GIGE_DEVICE该参数传出所有GiGE相关的设备信息(包含虚拟GiGE和GenTL下的GiGE设备),MV_USB_DEVICE该参数传出所有USB设备,包含虚拟USB设备。\n + + * @~english + * @brief Enumerates devices, including cameras connected to frame grabbers. + * @param nTLayerType [IN] It refers to the transport layer protocol type. For more details, refer to CameraParams.h. for example, #define MV_GIGE_DEVICE 0x00000001 + * @param pstDevList [IN][OUT] It refers to the device list. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The memory of device list is internally allocated. When this API is called in multiple threads, the SDK will release and apply for the device list memory. + It is recommended to avoid multithreaded enumeration operations. + * @remarks For the parameter nTLayerType, the following parameters are supported: MV_GIGE_DEVICE, MV_1394_DEVICE, MV_USB_DEVICE, and MV_CAMERALINK_DEVICE. + MV_GIGE_DEVICE sends out information of all GigE devices (including virtual GigE devices and GigE devices of GenTL), and MV_USB_DEVICE sends out information of USB devices (including virtual USB devices). + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EnumDevices(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList); + +/********************************************************************//** + * @~chinese + * @brief 根据厂商名字枚举设备 + * @param nTLayerType [IN] 枚举传输层,参数定义参见CameraParams.h + | 传输层协议类型定义 | 值 | 说明 | + | :--- | :---: | :--- | + | \ref MV_UNKNOW_DEVICE | 0x00000000 | 未知设备类型 | + | \ref MV_GIGE_DEVICE | 0x00000001 | GigE设备 | + | \ref MV_1394_DEVICE | 0x00000002 | 1394-a/b设备 | + | \ref MV_USB_DEVICE | 0x00000004 | USB设备 | + | \ref MV_CAMERALINK_DEVICE | 0x00000008 | 串口设备,包含Camera Link设备和串口视觉控制器 | + | \ref MV_VIR_GIGE_DEVICE | 0x00000010 | 虚拟GigE设备 | + | \ref MV_VIR_USB_DEVICE | 0x00000020 | 虚拟USB设备 | + | \ref MV_GENTL_GIGE_DEVICE | 0x00000040 | 自研网卡下GigE设备 | + | \ref MV_GENTL_CAMERALINK_DEVICE | 0x00000080 | CameraLink设备 | + | \ref MV_GENTL_CXP_DEVICE | 0x00000100 | CoaXPress设备 | + | \ref MV_GENTL_XOF_DEVICE | 0x00000200 | XoF设备 | + | \ref MV_GENTL_VIR_DEVICE | 0x00000800 | 虚拟设备 | + * @param pstDevList [IN][OUT] 设备列表 + * @param strManufacturerName [IN] 厂商名字 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 参数枚举传输层,适配传入MV_GIGE_DEVICE、MV_1394_DEVICE、MV_USB_DEVICE、MV_CAMERALINK_DEVICE;MV_GIGE_DEVICE该参数传出所有GiGE相关的设备信息(包含虚拟GiGE和GenTL下的GiGE设备),MV_USB_DEVICE该参数传出所有USB设备,包含虚拟USB设备。\n + * \li 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,建议尽量避免多线程枚举操作。\n + * \li MV_GENTL_GIGE_DEVICE、MV_GENTL_CAMERALINK_DEVICE、MV_GENTL_CXP_DEVICE、MV_GENTL_XOF_DEVICE传输层可以返回对采集卡下的相机信息。 + + * @~english + * @brief Enumerates devices according to manufacturers. + * @param nTLayerType [IN] It refers to the transport layer protocol type. For more details, refer to CameraParams.h. for example, #define MV_GIGE_DEVICE 0x00000001 + * @param pstDevList [IN][OUT] It refers to the device list. + * @param strManufacturerName [IN] It refers to the manufacturers. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks For the parameter nTLayerType, the following parameters are supported: MV_GIGE_DEVICE, MV_1394_DEVICE, MV_USB_DEVICE, and MV_CAMERALINK_DEVICE. + MV_GIGE_DEVICE sends out information of all GigE devices (including virtual GigE devices and GigE devices of GenTL), and MV_USB_DEVICE sends out information of USB devices (including virtual USB devices). + * @remarks The memory of device list is internally allocated. When this API is called in multiple threads, the SDK will release and apply for the device list memory. + It is recommended to avoid multithreaded enumeration operations. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesEx(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList, IN const char* strManufacturerName); + + +/********************************************************************//** + * @~chinese + * @brief 枚举设备扩展(可指定排序方式枚举、根据厂商名字过滤) + * @param nTLayerType [IN] 枚举传输层(区分每一种传输层类型,不耦合),参数定义参见CameraParams.h + | 传输层协议类型定义 | 值 | 说明 | + | :--- | :---: | :--- | + | \ref MV_UNKNOW_DEVICE | 0x00000000 | 未知设备类型 | + | \ref MV_GIGE_DEVICE | 0x00000001 | GigE设备 | + | \ref MV_1394_DEVICE | 0x00000002 | 1394-a/b设备 | + | \ref MV_USB_DEVICE | 0x00000004 | USB设备 | + | \ref MV_CAMERALINK_DEVICE | 0x00000008 | 串口设备,包含Camera Link设备和串口视觉控制器 | + | \ref MV_VIR_GIGE_DEVICE | 0x00000010 | 虚拟GigE设备 | + | \ref MV_VIR_USB_DEVICE | 0x00000020 | 虚拟USB设备 | + | \ref MV_GENTL_GIGE_DEVICE | 0x00000040 | 自研网卡下GigE设备 | + | \ref MV_GENTL_CAMERALINK_DEVICE | 0x00000080 | CameraLink设备 | + | \ref MV_GENTL_CXP_DEVICE | 0x00000100 | CoaXPress设备 | + | \ref MV_GENTL_XOF_DEVICE | 0x00000200 | XoF设备 | + | \ref MV_GENTL_VIR_DEVICE | 0x00000800 | 虚拟设备 | + * @param pstDevList [IN][OUT] 设备列表 + * @param strManufacturerName [IN] 厂商名字(可传NULL,即不过滤) + * @param enSortMethod [IN] 排序方式 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,建议尽量避免多线程枚举操作。 + \li strManufacturerName可传入NULL,若传入NULL则返回排好序的所有设备列表,若不为NULL则只返回排好序的指定厂商设备列表。\n + \li MV_GENTL_GIGE_DEVICE、MV_GENTL_CAMERALINK_DEVICE、MV_GENTL_CXP_DEVICE、MV_GENTL_XOF_DEVICE传输层可以返回对采集卡下的相机信息。\n + * @note MV_CC_EnumDevicesEx2() 与 MV_CC_EnumDevicesEx() 接口的差异如下: + \li MV_CC_EnumDevicesEx() 传入MV_GIGE_DEVICE,除了枚举网段内的网口相机以外,还会枚举虚拟网口相机和自研采集卡下的网口相机;若传入MV_USB_DEVICE,则会枚举USB口相机和虚拟USB口相机。\n + \li MV_CC_EnumDevicesEx2() 传入MV_GIGE_DEVICE,仅枚举网段内的网口相机;若传入MV_USB_DEVICE,则仅枚举USB口相机。\n + \li MV_CC_EnumDevicesEx2() 多出排序的功能,由参数MV_SORT_METHOD enSortMethod决定排序方式。 + + + * @~english + * @brief Enumerates devices, supporting enumerating devices by specified sorting method and filtering by manufacturer name. + * @param nTLayerType [IN] It refers to the transport layer protocol type. For more details, refer to CameraParams.h. for example, #define MV_GIGE_DEVICE 0x00000001 + * @param pstDevList [IN][OUT] It refers to the device list. + * @param strManufacturerName [IN] It refers to the name of the manufacturer (NULL means not filtering). + * @param enSortMethod [IN] It refers to the sorting type. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The memory of device list is internally allocated. When this API is called in multiple threads, the SDK will release and apply for the device list memory. + It is recommended to avoid multithreaded enumeration operations. + strManufacturerName can be set to NULL, which indicates enumerating all devices according to the specified sorting type; + if not set to NULL, the sorted device list of specified manufacturers will be returned. + + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesEx2(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList, IN const char* strManufacturerName, IN MV_SORT_METHOD enSortMethod); + +/********************************************************************//** + * @~chinese + * @brief 通过采集卡句柄枚举设备 + * @param handle [IN] 采集卡句柄 + * @param pstDevList [OUT] 设备列表 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,\n + \li 建议尽量避免多线程枚举操作。 + + * @~english + * @brief Enumerates devices by frame grabber handle. + * @param handle [IN] It refers to the frame grabber handle. + * @param pstDevList [OUT] It refers to the device list. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The memory of device list is internally allocated. When this API is called in multiple threads, the SDK will release and apply for the device list memory. It is recommended to avoid multithreaded enumeration operations. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesByInterface(IN void* handle, OUT MV_CC_DEVICE_INFO_LIST* pstDevList); + +/********************************************************************//** + * @~chinese + * @brief 设备是否可连接 + * @param pstDevInfo [IN] 设备信息结构体 + * @param nAccessMode [IN] 访问权限,参数定义参见CameraParams.h定义 + | 宏定义 | 宏定义值 | 含义 | + | :--- | :---: | :--- | + | \ref MV_ACCESS_Exclusive | 1 | 独占权限,其他APP只允许读CCP寄存器 | + | \ref MV_ACCESS_ExclusiveWithSwitch | 2 | 可以从5模式下抢占权限,然后以独占权限打开 | + | \ref MV_ACCESS_Control | 3 | 控制权限,其他APP允许读所有寄存器 | + | \ref MV_ACCESS_ControlWithSwitch | 4 | 可以从5模式下抢占权限,然后以控制权限打开 | + | \ref MV_ACCESS_ControlSwitchEnable | 5 | 以可被抢占的控制权限打开 | + | \ref MV_ACCESS_ControlSwitchEnableWithKey | 6 | 可以从5模式下抢占权限,然后以可被抢占的控制权限打开 | + | \ref MV_ACCESS_Monitor | 7 | 读模式打开设备,适用于控制权限下 | + * @return 若设备可达,返回true;若设备不可达,返回false。 + * @remarks \li GigE相机: 读取设备CCP寄存器的值,判断当前状态是否具有某种访问权限。\n + 如果设备(MV_GENTL_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE)不支持MV_ACCESS_ExclusiveWithSwitch、MV_ACCESS_ControlWithSwitch、MV_ACCESS_ControlSwitchEnable、MV_ACCESS_ControlSwitchEnableWithKey这四种模式,接口返回false。(目前设备不支持这4种抢占模式,国际上主流的厂商的设备也都暂不支持这4种模式。) + \li MV_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE 类型设备:按照nAccessMode,返回当前是否可以被连接; + @note + \li 该接口支持虚拟相机,U3V相机,CXP, XoF, CameraLink采集卡相机, nAccessMode无效,如果相机没有被连接返回true, 如果设备被第三方连接,则返回false + \li 该接口不支持CameraLink设备(返回false) + * @~english + * @brief Checks if the specified device can be accessed. + * @param pstDevInfo [IN] It refers to device information. + * @param nAccessMode [IN] It refers to access mode. Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_ACCESS_Exclusive 1 (This parameter is only valid for devices of type MV_GIGE-DEVICE/MV_GENTL_GIGE-DEVICE) + * @return Returns true for accessible status, and false for inaccessible status. + * @remarks You can read the device CCP register value to check the current access permission. + Return false if the device(MV_GENTL_GIGE_DEVICE/MV_GENTL_GIGE_DEVICE) does not support the modes MV_ACCESS_ExclusiveWithSwitch, MV_ACCESS_ControlWithSwitch, MV_ACCESS_ControlSwitchEnable and MV_ACCESS_ControlSwitchEnableWithKey. Currently, the device does not support the 4 modes, neither do the devices from other mainstream manufacturers. + This API supports virtual cameras, U3V cameras, CoaXPress (CXP), XoF, and CameraLink frame grabber cameras. The nAccessMode parameter has no actual effect. It returns true if the camera is not connected, and false if the device is occupied by a third party. + This API does not support CameraLink devices (returns false). + **************************************************************************/ +MV_CAMCTRL_API bool __stdcall MV_CC_IsDeviceAccessible(IN MV_CC_DEVICE_INFO* pstDevInfo, IN unsigned int nAccessMode); + +/********************************************************************//** + * @~chinese + * @brief 创建设备句柄 + * @param handle [IN][OUT] 设备句柄 + * @param pstDevInfo [IN] 设备信息结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 根据输入的设备信息,创建库内部必须的资源和初始化内部模块。\n + \li 通过该接口创建句柄,调用SDK接口,会默认生成SDK日志文件,如果不需要生成日志文件,可以将日志配置文件中的日志等级改成off。 + + * @~english + * @brief Creates a device handle. + * @param handle [IN][OUT] It refers to the device handle. + * @param pstDevInfo [IN] It refers to device information. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Create required resources within library and initialize internal module according to input device information. + SDK log file will be created by default when you call the API to create the device handle. If log file generation is not required, you can set the log level to off in the log configuration file. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_CreateHandle(IN OUT void ** handle, IN const MV_CC_DEVICE_INFO* pstDevInfo); + +/********************************************************************//** + * @~chinese + * @brief 打开设备 + * @param handle [IN] 设备句柄 + * @param nAccessMode [IN] 访问权限, 参数定义参见CameraParams.h定义 + | 宏定义 | 宏定义值 | 含义 | + | :--- | :---: | :--- | + | \ref MV_ACCESS_Exclusive | 1 | 独占权限,其他APP只允许读CCP寄存器 | + | \ref MV_ACCESS_ExclusiveWithSwitch | 2 | 可以从5模式下抢占权限,然后以独占权限打开 | + | \ref MV_ACCESS_Control | 3 | 控制权限,其他APP允许读所有寄存器 | + | \ref MV_ACCESS_ControlWithSwitch | 4 | 可以从5模式下抢占权限,然后以控制权限打开 | + | \ref MV_ACCESS_ControlSwitchEnable | 5 | 以可被抢占的控制权限打开 | + | \ref MV_ACCESS_ControlSwitchEnableWithKey | 6 | 可以从5模式下抢占权限,然后以可被抢占的控制权限打开 | + | \ref MV_ACCESS_Monitor | 7 | 读模式打开设备,适用于控制权限下 | + * @param nSwitchoverKey [IN] 切换访问权限时的密钥 (仅对 MV_GIGE_DEVICE 类型的设备有效) + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 根据设置的设备参数,找到对应的设备,连接设备, 调用接口时可不传入nAccessMode和nSwitchoverKey,此时默认设备访问模式为独占权限。\n + \li MV_GIGE_DEVICE 类型设备,目前相机固件暂不支持MV_ACCESS_ExclusiveWithSwitch、MV_ACCESS_ControlWithSwitch、MV_ACCESS_ControlSwitchEnable、MV_ACCESS_ControlSwitchEnableWithKey这四种抢占模式, 可通过SDK接口设置。\n + \li MV_GENTL_GIGE_DEVICE 设备只支持 nAccessMode 是 MV_ACCESS_Exclusive 、MV_ACCESS_Control 、MV_ACCESS_Monitor权限。\n + \li 对于U3V设备,CXP,Cameralink(MV_CAMERALINK_DEVICE、MV_GENTL_CAMERALINK_DEVICE),XoF设备,虚拟GEV,虚拟U3V设备:nAccessMode、nSwitchoverKey这两个参数无效; 默认以控制权限打开设备。\n + \li 该接口支持网口设备不枚举直接打开,不支持U口和GenTL设备不枚举打开设备。\n + + * @~english + * @brief Turns on the device. + * @param handle [IN] It refers to the device handle. + * @param nAccessMode [IN] It refers to access mode. Refer to the 'CameraParams.h'. + * @param nSwitchoverKey [IN] It refers to the secret key for switching access permission. (only valid for devices of type MV_GIGE_DEVICE.) + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks You can find the device and connect it according to the configured device parameters. + The parameters nAccessMode and nSwitchoverKey are optional, and the device access mode is exclusive permission by default. + For GigE devices, the camera firmware does not support the following preemption modes: MV_ACCESS_ExclusiveWithSwitch, MV_ACCESS_ControlWithSwitch, MV_ACCESS_ControlSwitchEnable, and MV_ACCESS_ControlSwitchEnableWithKey. + For GenTL devices, the camera firmware only supports the following modes: MV_ACCESS_Exclusive, MV_ACCESS_Control, and MV_ACCESS_Monitor. + For U3V, CXP, camera link, XoF, virtual GEV, and virtual U3V devices, the parameters nAccessMode and nSwitchoverKey are invalid, and the device is opened with control permission via MV_ACCESS_Control by default. + This API allows turning on GigE devices without enumeration, but it does not suport turning on USB or GenTL devices without enumeration. + ************************************************************************/ +#ifndef __cplusplus +MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, IN unsigned int nAccessMode, IN unsigned short nSwitchoverKey); +#else +MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, IN unsigned int nAccessMode = MV_ACCESS_Exclusive, IN unsigned short nSwitchoverKey = 0); +#endif + +/********************************************************************//** + * @~chinese + * @brief 判断设备是否处于连接状态 + * @param handle [IN] 设备句柄 + * @return 若设备处于连接状态,返回true;没连接或失去连接,返回false + + * @~english + * @brief Checks if the camera is connected. + * @param handle [IN] It refers to the device handle. + * @return Returns true if the device is connected, and returns false if the device is not connected or disconnected. + ***********************************************************************/ +MV_CAMCTRL_API bool __stdcall MV_CC_IsDeviceConnected(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 获取设备信息,取流之前调用 + * @param handle [IN] 设备句柄 + * @param pstDevInfo [IN][OUT] 返回给调用者有关设备信息结构体指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 支持用户在打开设备后获取设备信息,不支持GenTL设备。 \n + \li 若该设备是GigE设备,则调用该接口存在阻塞风险,因此不建议在取流过程中调用该接口。 + + * @~english + * @brief Gets device information, used before image grabbing. + * @param handle [IN] It refers to the device handle. + * @param pstDevInfo [IN][OUT] It refers to the pointer to device information structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after MV_CC_OpenDevice() to get the device information. + For a GigE device, there is a blocking risk when calling the API, so it is not recommended to call the API during image grabbing. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetDeviceInfo(IN void * handle, IN OUT MV_CC_DEVICE_INFO* pstDevInfo); + +/********************************************************************//** + * @~chinese + * @brief 获取各种类型的信息 + * @param handle [IN] 设备句柄 + * @param pstInfo [IN][OUT] 返回给调用者有关设备各种类型的信息结构体指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 接口里面输入需要获取的信息类型(指定 MV_ALL_MATCH_INFO 结构体中的nType类型),获取对应的信息(在 MV_ALL_MATCH_INFO 结构体中pInfo里返回)。\n + \li 该接口的调用前置条件取决于所获取的信息类型,获取GigE设备的 \ref MV_MATCH_TYPE_NET_DETECT 信息需在开启抓图之后调用,获取U3V设备的 \ref MV_MATCH_TYPE_USB_DETECT 信息需在打开设备之后调用。\n + \li 信息类型 MV_MATCH_TYPE_NET_DETECT 对应结构体\ref MV_MATCH_INFO_NET_DETECT , 只支持MV_GIGE_DEVICE相机/MV_GENTL_GIGE_DEVICE相机。 \n + \li 信息类型 MV_MATCH_TYPE_USB_DETECT 对应结构体\ref MV_MATCH_INFO_USB_DETECT , 只支持MV_USB_DEVICE 类型相机。 \n + @note 该接口不支持MV_CAMERALINK_DEVICE设备。 + + * @~english + * @brief Gets information of all types. + * @param handle [IN] It refers to the device handle. + * @param pstInfo [IN][OUT] It refers to the pointer to information structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Input required information type (specify nType in structure MV_ALL_MATCH_INFO ), and get corresponding information (returned via pInfo in structure MV_ALL_MATCH_INFO ). + The calling precondition of this API is determined by the required information type. To obtain MV_MATCH_TYPE_NET_DETECT information of GigE devices, this API should be called after image grabbing starts. To obtain MV_MATCH_TYPE_USB_DETECT information of U3V devices, this API should be called after the device is turned on. + The information type MV_MATCH_TYPE_NET_DETECT corresponds to the structure MV_MATCH_INFO_NET_DETECT, which only supports cameras of MV_GIGE_DEVICE and MV_GENTL_GIGE_DEVICE types + The information type MV_MATCH_TYPE_USB_DETECT corresponds to the structure MV_MATCH_INFO_USB_DETECT, which only supports cameras of MV_USB_DEVICE type + This API is not supported by MV_CAMERALINK_DEVICE device. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetAllMatchInfo(IN void* handle, IN OUT MV_ALL_MATCH_INFO* pstInfo); + +/********************************************************************//** + * @~chinese + * @brief 关闭设备 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 通过 MV_CC_OpenDevice() 连接设备后,可以通过该接口断开设备连接,释放资源。 + + * @~english + * @brief Turns off the device. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is used to disconnect the device and release resources. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_CloseDevice(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 销毁设备句柄 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 若向本接口传入采集卡句柄,其效果和 MV_CC_DestroyInterface() 相同; + + * @~english + * @brief Destroys the device handle. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks If a frame grabber handle is passed to MV_CC_DestroyHandle, its effect is identical to MV_CC_DestroyInterface. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_DestroyHandle(IN void * handle); + +/// @} + +/// \addtogroup 图像采集 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 注册图像数据回调 + * @param handle [IN] 设备句柄 + * @param cbOutput [IN] 回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 通过该接口可以设置图像数据回调函数,在 MV_CC_CreateHandle() 之后即可调用。 \n + * @remarks 图像数据采集有两种方式,两种方式不能复用: \n + * \li 调用 MV_CC_RegisterImageCallBackEx() 设置图像数据回调函数,然后调用 MV_CC_StartGrabbing() 开始采集,采集的图像数据在设置的回调函数中返回。 \n + * \li 调用 MV_CC_StartGrabbing() 开始采集,然后在应用层循环调用 MV_CC_GetImageBuffer() 和 MV_CC_FreeImageBuffer() 获取指定像素格式的帧数据,获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 \n + @note 该接口不支持M MV_CAMERALINK_DEVICE() 的设备。 \n + + * @~english + * @brief Registers an image data callback (extended API 1). + * @param handle [IN] It refers to the device handle. + * @param cbOutput [IN] It refers to the pointer to the callback function. + * @param pUser [IN] It refers to user-defined variable. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Before calling this API to register an image data callback, you should call the API MV_CC_CreateHandle(). + There are two image acquisition methods, and the two methods cannot be used together: + Method 1: Call MV_CC_RegisterImageCallBackEx() to register an image data callback, and then call MV_CC_StartGrabbing() to start image acquisition. The collected image data will be returned in the configured callback function. + Method 2: Call MV_CC_StartGrabbing() to start image acquisition, and the call MV_CC_GetOneFrameTimeout() repeatedly in application layer to get frame data in specified pixel format. When getting frame data, the upper application program should control the frequency of calling this API according to frame rate. + This API is not supported by devices with MV_CAMERALINK_DEVICE + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackEx(IN void* handle, IN MvImageCallbackEx cbOutput, IN void* pUser); + +/********************************************************************//** +* @~chinese +* @brief 注册图像数据回调 +* @param handle [IN] 设备句柄 +* @param cbOutput [IN] 回调函数指针 +* @param bAutoFree [IN] 图像缓存自动回收标记 + \li true:回调结束后,图像缓存会被SDK回收 + \li false:回调结束后,需要调用 MV_CC_FreeImageBuffer() 接口才能回收图像缓存 +* @param pUser [IN] 用户自定义变量 +* @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 +* @remarks \li 通过该接口可以设置图像数据回调函数,在 MV_CC_CreateHandle() 之后即可调用。 + \li 该接口不支持 \ref MV_CAMERALINK_DEVICE 类型的设备。 + \li 该方式与 MV_CC_RegisterImageCallBackEx() 等注册图像回调函数的接口互斥; + \li 该接口与 MV_CC_GetImageBuffer() 、 MV_CC_GetOneFrameTimeout() 等主动取流接口互斥; + \li 该接口中 \ref MvImageCallbackEx2 的“MV_FRAME_OUT* pstFrame”为SDK内部变量。如需在回调函数外使用,您需浅拷贝pstFrame结构体(不需要拷贝图像数据)。 + + * @~english + * @brief Registers an image data callback (extended API 2). + * @param handle [IN] It refers to the device handle. + * @param cbOutput [IN] It refers to the pointer to the callback function. + * @param bAutoFree [IN] It refers to the mark for automatic releasing of image buffer. (true:The image buffer will be released and reused by SDK after callback. false:After callback, it is required to call MV_CC_FreeImageBuffer() to release and reuse the image buffer.) + * @param pUser [IN] It refers to the user-defined variable. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Before calling this API to register an image data callback, you should call the API MV_CC_CreateHandle(). + When getting frame data, the upper application program should control the frequency of calling this API according to frame rate. + This API is not supported by devices with MV_CAMERALINK_DEVICE. + The pstFrame parameter in the callback function is an internal temporary variable of the SDK, and its content must be copied before it can be used outside the callback. +***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackEx2(IN void* handle, IN MvImageCallbackEx2 cbOutput, IN void* pUser, IN bool bAutoFree); + +/********************************************************************//** + * @~chinese + * @brief 开始取流 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口不支持 \ref MV_CAMERALINK_DEVICE 类型的设备。 + + * @~english + * @brief Starts image grabbing. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is not supported by MV_CAMERALINK_DEVICE. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_StartGrabbing(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 停止取流 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口不支持 \ref MV_CAMERALINK_DEVICE 类型的设备。 + + * @~english + * @brief Stops image grabbing. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is not supported by MV_CAMERALINK_DEVICE. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_StopGrabbing(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 获取一帧图片(与 MV_CC_Display() 不能同时使用) + * @param handle [IN] 设备句柄 + * @param pstFrame [IN][OUT] 图像数据和图像信息 + * @param nMsec [IN] 等待超时时间,输入INFINITE时表示无限等待,直到收到一帧数据或者停止取流 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 调用该接口获取图像数据帧之前需要先调用 MV_CC_StartGrabbing() 启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。该接口支持设置超时时间,SDK内部等待直到有数据时返回,可以增加取流平稳性,适合用于对平稳性要求较高的场合。 \n + \li 该接口与 MV_CC_FreeImageBuffer() 配套使用,当处理完取到的数据后,需要用 MV_CC_FreeImageBuffer() 接口将pstFrame内的数据指针权限进行释放。 \n + \li 该接口与 MV_CC_GetOneFrameTimeout() 相比,有着更高的效率。且其取流缓存的分配由sdk内部自动分配或者外部注册,而 MV_CC_GetOneFrameTimeout() 接口是需要客户自行分配。\n + \li 该接口在调用 MV_CC_Display() 后无法取流。 \n + \li 该接口对于U3V、GIGE设备均可支持。 \n + \li 该接口不支持CameraLink设备。\n + + * @~english + * @brief Gets one frame of image. (This API cannot be used with MV_CC_Display() at the same time.) + * @param handle [IN] It refers to the device handle. + * @param pstFrame [IN][OUT] It refers to image data and information. + * @param nMsec [IN] It refers to the timeout duration, unit: millisecond. You can input INFINITE to set unlimited timeout duration, and image grabbing will not stop until a frame of data is received or the image grabbing is manually stopped. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Before calling this API to get image data frame, call MV_CC_StartGrabbing to start image acquisition. + This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. This API supports setting timeout duration for receiving image data frames, which helps ensure stable image acquisition. It is applicable to scenes with high-stability requirement for getting images. + This API and MV_CC_FreeImageBuffer should be called in pairs, after processing the acquired data, you should call MV_CC_FreeImageBuffer to release the data pointer permission of pstFrame. + This API's image buffer is allocated by the SDK internally or registered externally, it has higher image acquisition efficiency than MV_CC_GetOneFrameTimeout() , whose image buffer needs to be manually allocated by the user. + This API cannot be called to grab images after calling MV_CC_Display(). + This API is not supported by MV_CAMERALINK_DEVICE. + This API is supported by both USB3 vision camera and GigE camera. + *****************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetImageBuffer(IN void* handle, IN OUT MV_FRAME_OUT* pstFrame, IN unsigned int nMsec); + +/********************************************************************//** + * @~chinese + * @brief 释放图像缓存(此接口用于释放不再使用的图像缓存,与 MV_CC_GetImageBuffer() 配套使用) + * @param handle [IN] 设备句柄 + * @param pstFrame [IN] 图像数据和图像数据 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 该接口与 MV_CC_GetImageBuffer() 配套使用,使用 MV_CC_GetImageBuffer() 接口取到的图像数据pstFrame,需要用 MV_CC_FreeImageBuffer() 接口进行权限释放。 \n + \li 该接口对于取流效率高于 MV_CC_GetOneFrameTimeout() 接口,且 MV_CC_GetImageBuffer() 在不进行Free的情况下,最大支持输出的节点数与 MV_CC_SetImageNodeNum() 接口所设置的节点数相等,默认节点数是1。\n + \li 该接口对于U3V、GIGE设备均可支持。 \n + \li 该接口不支持CameraLink设备。\n + + * @~english + * @brief Releases image buffer. (This API is used to release the image buffer that is no longer used, and it is used with MV_CC_GetImageBuffer() in pairs.) + * @param handle [IN] It refers to the device handle. + * @param pstFrame [IN] It refers to image data and information. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API and MV_CC_GetImageBuffer() should be called in pairs. After calling MV_CC_GetImageBuffer() to get image data pstFrame, call MV_CC_FreeImageBuffer() to release the permission. + This API has higher efficiency of image acquisition than the API MV_CC_GetOneFrameTimeout(). The max. number of nodes that can be outputted by MV_CC_GetImageBuffer()(without freeing the buffer) is the same as the "nNum" set by the API MV_CC_SetImageNodeNum(). + This API is not supported by MV_CAMERALINK_DEVICE. + The API is supported by both USB3 vision camera and GigE camera. + **********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FreeImageBuffer(IN void* handle, IN MV_FRAME_OUT* pstFrame); + +/********************************************************************//** + * @~chinese + * @brief 采用超时机制获取一帧图片,SDK内部等待直到有数据时返回 + * @param handle [IN] 设备句柄 + * @param pData [IN][OUT] 图像数据接收指针 + * @param nDataSize [IN] 接收缓存大小 + * @param pstFrameInfo [IN][OUT] 图像信息结构体 + * @param nMsec [IN] 等待超时时间 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 调用该接口获取图像数据帧之前需要先调用 MV_CC_StartGrabbing() 启动图像采集。该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。该接口支持设置超时时间,SDK内部等待直到有数据时返回,可以增加取流平稳性,适合用于对平稳性要求较高的场合。\n + * @note \li 该接口对于U3V、GigE设备均可支持。\n + \li 该接口不支持CameraLink设备。 \n + + * @~english + * @brief Gets one frame of image with timeout, and the SDK waits internally to return until data is available. + * @param handle [IN] It refers to the device handle. + * @param pData [IN][OUT] It refers to the pointer to receive image data. + * @param nDataSize [IN] It refers to received buffer size. + * @param pstFrameInfo [IN][OUT] It refers to the structure of image information. + * @param nMsec [IN] It refers to timeout duration. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Before calling this API to get image data frame, call MV_CC_StartGrabbing() to start image acquisition. + This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. + This API supports setting timeout duration for receiving image data frames, which helps ensure stable image acquisition. It is applicable to scenes with high-stability requirement for getting images. + This API is supported by both USB3 vision devices and GigE devices. + This API is not supported by MV_CAMERALINK_DEVICE. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetOneFrameTimeout(IN void* handle, IN OUT unsigned char* pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, IN unsigned int nMsec); + +/********************************************************************//** + * @~chinese + * @brief 清除取流数据缓存 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 该接口允许用户在不停止取流的时候,就能清除缓存中不需要的图像。 \n + \li 该接口在连续模式切触发模式后,可以清除历史数据。 \n + \li 该接口当前仅支持清除SDK内部的图像缓存,暂不支持清除采集卡内的缓存。 + + * @~english + * @brief Clears the image buffer. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to clear the images you do not need in the buffer when the streaming is in progress. + After switching to trigger mode from continuous mode, you can call this API to clear historical data buffer. + Call this API to clear internal image buffer of SDK. The clearing of the buffer inside the frame grabbers is not supported. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ClearImageBuffer(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 获取当前图像缓存区的有效图像个数 + * @param handle [IN] 设备句柄 + * @param pnValidImageNum [IN][OUT] 当前图像缓存区中有效图像个数的指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口只统计SDK内部的有效图像个数,不包括采集卡缓存内的有效图像个数 + + * @~english + * @brief Gets the number of valid images in the current image buffer. + * @param handle [IN] It refers to the device handle. + * @param pnValidImageNum [IN][OUT] It refers to the pointer to the number of valid images in the current image buffer. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API can only be called to get the number of valid images in the SDK, not the number of those in frame grabbers. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetValidImageNum(IN void* handle, IN OUT unsigned int *pnValidImageNum); + +/********************************************************************//** + * @~chinese + * @brief 设置SDK内部图像缓存节点个数,大于等于1,在抓图前调用 + * @param handle [IN] 设备句柄 + * @param nNum [IN] 缓存节点个数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 调用该接口可以设置SDK内部图像缓存节点个数,在调用 MV_CC_StartGrabbing() 开始抓图前调用。 \n + \li 由于不同相机的取流方式不同,在不调用 MV_CC_SetImageNodeNum() 情况下,不同相机的默认缓存节点个数不同。比如双U内部默认分配3个节点。 \n + \li SDK实际分配的节点个数 = SDK内部预分配的个数 + 通过调用该接口分配的节点;若系统内存资源不够,SDK内部将重新计算预分配的缓存节点个数,在该情况下,SDK实际分配的节点个数以重新计算的节点个数为准。 \n + \li 该接口不支持CameraLink设备。CameraLink设备可以通过GenTL方式连接并设置缓存节点个数。 \n + + * @~english + * @brief Sets the number of nodes for SDK internal image buffer. The value is no less than 1, and this API should be called before image grabbing. + * @param handle [IN] It refers to the device handle. + * @param nNum [IN] It refers to the number of buffer nodes, which cannot be less than 1. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API before MV_CC_StartGrabbing() to set the number of nodes for SDK internal image buffer. + Image grabbing methods vary from different camera types. If this API is not called, the default number of buffer nodes will be different. + The number of SDK allocated nodes = the pre-allocated nodes within SDK + the nodes allocated via this API. If the memory allocated by the system is insufficient, the pre-allocated nodes for SDK will be calculated again, and the actual number of allocated nodes will be set to the number of latest pre-allocated nodes. + If the system memory resources are insufficient, the SDK will recalculate and use it as the actual number of nodes. + This API does not support devices of type MV_CAMERALINK_DEVICE + This API is only valid for the SDK's internal allocation cache mode, and the external allocation cache mode (i.e., calling MV_CC_RegisterBuffer) is invalid; + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetImageNodeNum(IN void* handle, IN unsigned int nNum); + +/********************************************************************//** + * @~chinese + * @brief 设置取流策略 + * @param handle [IN] 设备句柄 + * @param enGrabStrategy [IN] 策略枚举值 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口定义了四种取流策略,用户可以根据实际需求进行选择。具体描述如下: + \li OneByOne:从旧到新一帧一帧的从输出缓存列表中获取图像,打开设备后默认为该策略 + \li LatestImagesOnly:仅从输出缓存列表中获取最新的一帧图像,同时清空输出缓存列表 + \li LatestImages:从输出缓存列表中获取最新的OutputQueueSize帧图像,其中OutputQueueSize范围为1-ImageNodeNum,可用 MV_CC_SetOutputQueueSize() 接口设置,ImageNodeNum默认为1,可用 MV_CC_SetImageNodeNum() 接口设置 OutputQueueSize设置成1等同于LatestImagesOnly策略,OutputQueueSize设置成ImageNodeNum等同于OneByOne策略 + \li UpcomingImage:在调用取流接口时忽略输出缓存列表中所有图像,并等待设备即将生成的一帧图像。该策略仅支持GigE设备和USB设备 + @note + \li WINDOWS + 该接口仅支持 \ref MV_GIGE_DEVICE 、 \ref MV_USB_DEVICE 设备。 + \endif + \li LINUX + 该接口仅支持 \ref MV_USB_DEVICE 设备。 + \endif + + * @~english + * @brief Sets image grabbing strategy. + * @param handle [IN] It refers to the device handle. + * @param enGrabStrategy [IN] It refers to strategy enumeration. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks There are four defined image grabbing strategies, from which you can choose the suitable one according to the actual requirement. Details are following. + OneByOne:Gets image frames one by one in chronological order. It is the default strategy. + LatestImagesOnly:Only gets the latest one frame from the output buffer list, and clears the rest images in the list. + LatestImages:Gets the latest image of OutputQueueSize frame from the output buffer list. The range of OutputQueueSize is between 1 and ImageNodeNum. + If the OutputQueueSize value is set to 1, the strategy is same to LatestImagesOnly, and if the OutputQueueSize value is set to ImageNodeNum, the strategy is same to OneByOne. + You can set the OutputQueueSize via API MV_CC_SetOutputQueueSize(), and set the ImageNodeNum via API MV_CC_SetImageNodeNum(). + UpcomingImage:Ignores all images in the output buffer list during calling this API, and waits for the upcoming image generated by the device. This strategy is supported by GigE devices and USB devices only. + This API only support MV_GIGE_DEVICE, MV_USB_DEVICE device on Windows, and only support MV_USB_DEVICE device on Linux. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetGrabStrategy(IN void* handle, IN MV_GRAB_STRATEGY enGrabStrategy); + +/********************************************************************//** + * @~chinese + * @brief 设置输出缓存个数(只有在 \ref MV_GrabStrategy_LatestImages 策略下才有效,范围:1-ImageNodeNum) + * @param handle [IN] 设备句柄 + * @param nOutputQueueSize [IN] 输出缓存个数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口需与LatestImages取流策略配套调用,用于设置LatestImages策略下最多允许缓存图像的个数。可以在取流过程中动态调节输出缓存个数。 + @note + \li WINDOWS + 该接口仅支持 \ref MV_GIGE_DEVICE 、 \ref MV_USB_DEVICE 设备。 + \endif + \li LINUX + 该接口仅支持 \ref MV_USB_DEVICE 设备。 + \endif + + * @~english + * @brief Sets the number of output buffers, range: [1, ImageNodeNum]. + * @param handle [IN] It refers to the device handle. + * @param nOutputQueueSize [IN] It refers to the number of output buffers. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is valid only when MV_CC_SetGrabStrategy() is set to LatestImages. It is called to set the max. number of buffer images under the LatestImages strategy. You can adjust the number of output buffers during image grabbing. + The user may change the output queue size while grabbing images. + This API only support MV_GIGE_DEVICE, MV_USB_DEVICE device on Windows, and only support MV_USB_DEVICE device on Linux. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetOutputQueueSize(IN void* handle, IN unsigned int nOutputQueueSize); + +/********************************************************************//** + * @~chinese + * @brief 分配对齐内存 + * @param nBufSize [IN] 分配内存的长度 + * @param nAlignment [IN] 内存对齐字节数 (必须是大于0,并且是2的整数次幂) + * @return 成功,返回申请内存地址;失败,返回 NULL + * @remarks + + * @~english + * @brief Allocates aligned memory + * @param nBufSize [IN] It refers to allocation length of memory + * @param nAlignment [IN] It refers to memory alignment size (must be greater than 0 and a power of 2) + * @return Returns memory address for success, and returns NULL for failure. + * @remarks +************************************************************************/ +MV_CAMCTRL_API void * __stdcall MV_CC_AllocAlignedBuffer(IN uint64_t nBufSize, IN unsigned int nAlignment); + +/********************************************************************//** + * @~chinese + * @brief 对齐内存释放 + * @param pBuffer [IN] 内存地址 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 对齐内存的释放,搭配 MV_CC_AllocAlignedBuffer() 使用 + + * @~english + * @brief Releases aligned memory + * @param pBuffer [IN] It refers to memory address + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API and MV_CC_AllocAlignedBuffer should be called in pairs. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FreeAlignedBuffer(IN void* pBuffer); + +/********************************************************************//** + * @~chinese + * @brief 获取设备payload大小(payload包含图像数据和Chunk数据)和内存对其方式,用于SDK外部注册缓存时,应用层分配足够的缓存及正确的内存对齐方式 + * @param handle [IN] 设备句柄 + * @param pnPayloadSize [IN OUT] 负载长度 + * @param pnAlignment [IN OUT] 负载内存对齐的字节数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks + + * @~english + * @brief Gets the device payload size (including image data and Chunk data) and memory alignment method. + It is used by the application layer to allocate sufficient buffer and correct memory alignment when registering external memory for SDK. + * @param handle [IN] It refers to the device handle. + * @param pnPayloadSize [IN OUT] It refers to the payload size. + * @param pnAlignment [IN OUT] It refers to alignment bytes. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetPayloadSize(IN void* handle, IN OUT uint64_t* pnPayloadSize, IN OUT unsigned int* pnAlignment); + +/********************************************************************//** + * @~chinese + * @brief 应用程序分配缓存,并注册到SDK内部,供SDK使用 + * @param handle [IN] 设备句柄 + * @param pBuffer [IN] 内存地址 + * @param nBufSize [IN] 内存长度 + * @param pUser [IN] 用户指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 可以使用 MV_CC_GetPayloadSize() 获取缓存大小,并使用 MV_CC_AllocAlignedBuffer() 分配空间,之后使用 MV_CC_RegisterBuffer() 注册 + \li 注册的缓存需要由应用层通知SDK取消注册( MV_CC_UnRegisterBuffer() )后,进行释放( MV_CC_FreeAlignedBuffer() )。 + \li 使用该接口后,仅支持 MV_CC_GetImageBuffer() / MV_CC_FreeImageBuffer() / MV_CC_RegisterImageCallBackEx() 获取图像,不支持其他接口获取图像。\n + @note \li 使用该接口后,如果之前配置了SDK内部节点( MV_CC_SetImageNodeNum() )无效。\n + \li 双USB接口相机要求至少注册3块空间到SDK内部。其他相机暂无限制,但是为了避免缓存不足,请配置足够的缓存到底层。\n + + * @~english + * @brief Application allocates cache and registers it internally to the SDK for SDK usage + * @param handle [IN] It refers to the device handle. + * @param pBuffer [IN] It refers to external memory address + * @param nBufSize [IN] It refers to external length of memory + * @param pUser [IN] It refers to user-defined variable. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Registering memory can be done by using MV_CC_GetPayloadSize to obtain the memory size, and allocating the memory size using MV_CC_AllocAlignedBuffer + The registered memory needs to be notified by the application layer to the SDK to cancel the registration (MV_CC_UnregisterBuffer) and then released (MV_CC_FreeAlignedBuffer) + After using this API, only MV_CC_GetImageBuffer、MV_CC_FreeImageBuffer/MV_CC_RegisterImageCallBackEx is supported for image retrieval, and other API are not supported for image retrieval + After using this API, if the SDK internal node (MV_CC_SetImageNodeNum) was previously configured, it is invalid + The dual USB API camera requires at least 3 spaces to be registered inside the SDK;There is no limit for other cameras for the time being, but to avoid insufficient cache, please configure sufficient cache into the SDK +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterBuffer(IN void* handle, IN void *pBuffer, IN uint64_t nBufSize, IN void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 外部内存取消SDK内部注册 + * @param handle [IN] 设备句柄 + * @param pBuffer [IN] 外部内存地址 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks + + * @~english + * @brief Revokes external memory + * @param handle [IN] It refers to the device handle + * @param pBuffer [IN] It refers to external memory address + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_UnRegisterBuffer(IN void* handle, IN void* pBuffer); + +/// @} + +/// \addtogroup 图像渲染 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 显示一帧图像(扩展接口) + * @param handle [IN] 设备句柄 + * @param hWnd [IN] 窗口句柄 + * @param pstDisplayInfo [IN] 图像信息 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口支持渲染的图像宽、高可达到Int类型。 + * \if WINDOWS + * 可选择GDI或D3D渲染模式,默认选择GDI模式。关于渲染模式的说明如下: + \li GDI模式:对电脑的显卡性能没有要求,适用于所有电脑。 + \li D3D模式:适用于已安装显卡驱动且显卡内存大于1GB的电脑。在该模式下,客户端预览的图像效果会优于GDI模式下的图像效果。该模式支持的最大图像分辨率为16384 * 163840。 + \li MV_CC_DisplayOneFrameEx() 支持PixelType_Gvsp_RGB8_Packed,PixelType_Gvsp_BGR8_Packed,PixelType_Gvsp_Mono8三种像素格式的渲染宽高大小至int类型,其余像素格式渲染仅支持宽高至short。 + \endif + + * @~english + * @brief Displays one frame of image (extended API 1). + * @param handle [IN] It refers to the device handle. + * @param hWnd [IN] It refers to window handle. + * @param pstDisplayInfo [IN] It refers to image information. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks TThis API supports converting image width and image height to integer type data. The rendering mode can be set to GDI (default) or D3D. See details about rendering modes below. + The GDI mode is applicable to all computers with no requirements on graphic card performance. + The D3D mode is suitable for computers with a graphics card driver and the memory of the graphics card is greater than 1GB. In this mode, the image effect of the client preview is better than that of the GDI mode. The max. supported resolution is 16384 × 163840. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_DisplayOneFrameEx(IN void* handle, IN void* hWnd, IN MV_DISPLAY_FRAME_INFO_EX* pstDisplayInfo); + +/********************************************************************//** + * @~chinese + * @brief 显示一帧图像(扩展接口2) + * @param handle [IN] 设备句柄 + * @param hWnd [IN] 窗口句柄 + * @param pstImage [IN] 图像信息 + * \if WINDOWS + * @param enRenderMode [IN] 渲染方式:0-GDI 1-D3D 2-OpenGL + * \endif + * \if LINUX + * @param enRenderMode [IN] 渲染方式:0-OpenGL + * \endif + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * \if WINDOWS + * @remarks 此接口支持4GB以上超大图渲染,调用时需要输入 MV_CC_IMAGE 中 nImageLen 的值。 \n + D3D和OpenGL模式适用于安装显卡驱动且显卡内存大于1GB的电脑,该模式下客户端预览的图像效果会优于GDI模式下的图像效果。渲染模式为D3D时,支持的最大分辨率为16384 * 163840。 \n + 根据图像大小是否超过4GB,该接口可选的渲染模式不同,详情如下: + \li 若图像大小大于4GB,仅支持使用OpenGL模式渲染图像,并且支持渲染RGB8_Packed,BGR8_Packed和Mono8格式的图像。\n + \li 若图像大小小于4GB,可根据实际情况选择GDI、D3D或OpenGL模式。若选择渲染的图像格式为RGB8_Packed,BGR8_Packed或Mono8格式,该渲染图像的宽高可达到int类型。 \n + * \endif + * \if LINUX + * \li 支持PixelType_Gvsp_RGB8_Packed,PixelType_Gvsp_BGR8_Packed,PixelType_Gvsp_Mono8三种像素格式图像大小超过4GB的渲染。 \n + \li 若图像大小未超过4GB,支持宽高大小至int类型。 \n + \li 调用时需要输入 MV_CC_IMAGE 结构体中nImageLen的值; \n + * \endif + + * @~english + * @brief Displays one frame of image (extended API 2). + * @param handle [IN] It refers to the device handle. + * @param hWnd [IN] It refers to window handle. + * @param pstImage [IN] It refers to the image information. + * @param enRenderMode [IN] It refers to image rendering mode. 0: GDI; 1: D3D; 2: OpenGL. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API supports rendering of images over 4 GB by entering nImageBufLen value of structure MV_CC_IMAGE. + D3D mode and OpenGL mode are suitable for computers with a graphics card driver and the memory of the graphics card is greater than 1GB. In these modes, the image effect of the client preview is better than that of the GDI mode. For D3D mode, the max. supported resolution is 16384 × 163840. + Rendering mode and supported rendering width and rendering height vary from images over 4 GB and images no more than 4 GB. + For an image over 4 GB, only OpenGL rendering mode is supported for image in pixel formats including RGB8_Packed, BGR8_Packed, and Mono8. + For image size under 4 GB, you can choose GDI, D3D, or OpenGL according to actual demand. For an image with pixel formats including RGB8_Packed, BGR8_Packed, and Mono8, it supports converting image width and image height to integer type data. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_DisplayOneFrameEx2(IN void* handle, IN void* hWnd, IN MV_CC_IMAGE* pstImage, unsigned int enRenderMode); + +/// \if WINDOWS + +/********************************************************************//** + * @~chinese + * @brief 在图像上绘制矩形框辅助线 + * @param handle [IN] 设备句柄 + * @param pRectInfo [IN] 矩形辅助线的信息 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口仅支持windows平台 + + * @~english + * @brief Draws auxiliary rectangle frames on the image. + * @param handle [IN] It refers to the device handle. + * @param pRectInfo [IN] It refers to the information of auxiliary rectangle frame. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API only supports windows platform. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_DrawRect(IN void* handle, IN MVCC_RECT_INFO* pRectInfo); + +/********************************************************************//** + * @~chinese + * @brief 在图像上绘制圆形辅助线 + * @param handle [IN] 设备句柄 + * @param pCircleInfo [IN] 圆形辅助线的信息 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口仅支持windows平台 + + * @~english + * @brief Draws auxiliary circle frames on the image. + * @param handle [IN] It refers to the device handle. + * @param pCircleInfo [IN] It refers to the information of auxiliary circle frame. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API only supports windows platform. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_DrawCircle(IN void* handle, IN MVCC_CIRCLE_INFO* pCircleInfo); + +/********************************************************************//** + * @~chinese + * @brief 在图像上绘制线条 + * @param handle [IN] 设备句柄 + * @param pLinesInfo [IN] 线条辅助线信息 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口仅支持windows平台 + + * @~english + * @brief Draws lines on the image. + * @param handle [IN] It refers to the device handle. + * @param pLinesInfo [IN] It refers to the information of line + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API only supports windows platform. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_DrawLines(IN void* handle, IN MVCC_LINES_INFO* pLinesInfo); + +/// \endif +/// @} + +/**************************Part3 ch: 采集卡的配置 | en: Frame grabber control ******************************************/ + +/// \addtogroup 采集卡初始化 +/// @{ +/********************************************************************//** + * @~chinese + * @brief 枚举采集卡 + * @param nTLayerType [IN] 采集卡接口类型 + | 采集卡接口类型定义 | 值 | 说明 | + | :--- | :---: | :--- | + | \ref MV_GIGE_INTERFACE | 0x00000001 | GigE Vision采集卡 | + | \ref MV_CAMERALINK_INTERFACE | 0x00000004 | Camera Link采集卡 | + | \ref MV_CXP_INTERFACE | 0x00000008 | CoaXPress采集卡 | + | \ref MV_XOF_INTERFACE | 0x00000010 | XoFLink采集卡 | + | \ref MV_VIR_INTERFACE | 0x00000020 | 虚拟采集卡 | + | \ref MV_LC_INTERFACE | 0x00000040 | 光源控制卡 | + * @param pInterfaceInfoList [IN][OUT] 采集卡列表 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @if LINUX + * @remarks 该接口不支持arm和Linux32平台 + * @endif + + * @~english + * @brief Enumerates frame grabbers. + * @param nTLayerType [IN] It refers to the frame grabber interface type. eg: (MV_GIGE_INTERFACE | MV_CAMERALINK_INTERFACE | MV_CXP_INTERFACE| MV_XOF_INTERFACE | MV_VIR_INTERFACE | MV_LC_INTERFACE) + * @param pInterfaceInfoList [IN][OUT] It refers to the frame grabber list. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API do not support arm and Linux32 platform. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EnumInterfaces(IN unsigned int nTLayerType, IN OUT MV_INTERFACE_INFO_LIST* pInterfaceInfoList); + +/********************************************************************//** + * @~chinese + * @brief 创建采集卡句柄 + * @param handle [OUT] 采集卡句柄 + * @param pInterfaceInfo [IN] 采集卡信息 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @if LINUX + * @remarks 该接口不支持arm和Linux32平台 + * @endif + + * @~english + * @brief Creates frame grabber handle. + * @param handle [OUT] It refers to the frame grabber handle. + * @param pInterfaceInfo [IN] It refers to the frame grabber information. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API do not support arm and Linux32 platform. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_CreateInterface(IN OUT void ** handle, IN MV_INTERFACE_INFO* pInterfaceInfo); + +/********************************************************************//** + * @~chinese + * @brief 通过采集卡ID创建采集卡句柄 + * @param handle [IN][OUT] 采集卡句柄 + * @param pInterfaceID [IN] 采集卡ID + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @if LINUX + * @remarks 该接口不支持arm和Linux32平台 + * @endif + + * @~english + * @brief Creates frame grabber handle by frame grabber ID. + * @param handle [IN][OUT] It refers to the frame grabber handle. + * @param pInterfaceID [IN] It refers to the frame grabber ID such as frame grabber serial No. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API do not support arm and Linux32 platform. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_CreateInterfaceByID(IN OUT void ** handle, IN const char* pInterfaceID); + +/********************************************************************//** + * @~chinese + * @brief 打开采集卡 + * @param handle [IN] 采集卡句柄 + * @param pReserved [IN] 预留,直接填NULL + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @if LINUX + * @remarks 该接口不支持arm和Linux32平台 + * @endif + + * @~english + * @brief Turns on the frame grabber. + * @param handle [IN] It refers to the frame grabber handle. + * @param pReserved [IN] Reserved (NULL). + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API do not support arm and Linux32 platform. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_OpenInterface(IN void* handle, IN char* pReserved); + +/********************************************************************//** + * @~chinese + * @brief 关闭采集卡 + * @param handle [IN] 采集卡句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @if LINUX + * @remarks 该接口不支持arm和Linux32平台 + * @endif + + * @~english + * @brief Turns off the frame grabber. + * @param handle [IN] It refers to the frame grabber handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API do not support arm and Linux32 platform. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_CloseInterface(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 销毁采集卡句柄 + * @param handle [IN]采集卡句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 若传入相机句柄,其效果和 MV_CC_DestroyHandle() 相同; + * @if LINUX + * @remarks 该接口不支持arm和Linux32平台 + * @endif + + * @~english + * @brief Destroys the frame grabber handle. + * @param handle [IN] It refers to the frame grabber handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks If camera handle is passed, the effect is the same as the MV_CC_DestroyHandle. This API do not support arm and Linux32 platform. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_DestroyInterface(IN void* handle); + +/// @} + + +/*******************Part4 ch: 相机/采集卡属性万能配置接口 | en: Universal configuration API for camera/frame grabber properties*******************/ + +/// \addtogroup 属性配置 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 获取Integer属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值,如获取宽度信息则为"Width" + * @param pstIntValue [IN][OUT] 返回给调用者有关设备属性结构体指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以获取int类型的指定节点的值。具体可查看客户端的属性描述。 + + * @~english + * @brief Gets the value of integer type node. + * @param handle [IN] It refers to the device handle. + * @param strKey [IN] It refers to key value (node name), for example, using "Width" to get the image width. + * @param pstIntValue [IN][OUT] It refers to the pointer to device feature structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of integer type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetIntValueEx(IN void* handle,IN const char* strKey,IN OUT MVCC_INTVALUE_EX *pstIntValue); + +/********************************************************************//** + * @~chinese + * @brief 设置Integer型属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值,如获取宽度信息则为"Width" + * @param nValue [IN] 想要设置的设备的属性值 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置int类型的指定节点的值,具体可以查看客户端属性描述。 + + * @~english + * @brief Sets the value of integer type node + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to key value (node name), for example, using "Width" to set width. + * @param nValue [IN] It refers to the device node value to be set. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of integer type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetIntValueEx(IN void* handle,IN const char* strKey,IN int64_t nValue); + +/********************************************************************//** + * @~chinese + * @brief 获取Enum属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat" + * @param pstEnumValue [IN][OUT] 返回给调用者有关设备属性结构体指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以获取Enum类型的指定节点的值。 + + * @~english + * @brief Gets the value of enumeration type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to key value (node name), for example, using "PixelFormat" to get pixel format. + * @param pstEnumValue [IN][OUT] It refers to the pointer to device feature structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of Enum type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetEnumValue(IN void* handle,IN const char* strKey,IN OUT MVCC_ENUMVALUE *pstEnumValue); + +/********************************************************************//** + * @~chinese + * @brief 获取Enum属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat" + * @param pstEnumValue [IN][OUT] 返回给调用者有关设备属性结构体指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 连接设备之后调用该接口可以获取Enum类型的指定节点的值。\n + * \li 区别与 MV_CC_GetEnumValue() ,此接口返回的枚举有效个数扩展到256个。 + + * @~english + * @brief Gets the value of enumeration type node (extended API). + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to key value (node name), for example, using "PixelFormat" to get pixel format. + * @param pstEnumValue [IN][OUT] It refers to the pointer to device feature structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of Enum type + The valid enumerations this API returns extend to 256. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetEnumValueEx(IN void* handle, IN const char* strKey, IN OUT MVCC_ENUMVALUE_EX *pstEnumValue); + +/********************************************************************//** + * @~chinese + * @brief 设置Enum型属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat" + * @param nValue [IN] 想要设置的设备的属性值 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置Enum类型的指定节点的值。 + + * @~english + * @brief Sets the value of enumeration type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to key value (node name), for example, using "PixelFormat" to set pixel format. + * @param nValue [IN] It refers to the device node value to be set. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of Enum type + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetEnumValue(IN void* handle,IN const char* strKey,IN unsigned int nValue); + +/********************************************************************//** + * @~chinese + * @brief 获取Enum型节点指定值的符号 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat" + * @param pstEnumEntry [IN][OUT] 想要获取的设备的属性符号 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以获取Enum类型的指定节点的值所对应的符号。 + + * @~english + * @brief Gets the enumerator name according to the node name and assigned value. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to key value (node name), for example, using "PixelFormat" to get pixel format. + * @param pstEnumEntry [IN][OUT] It refers to the enumerator name. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of Enum type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetEnumEntrySymbolic(IN void* handle,IN const char* strKey,IN OUT MVCC_ENUMENTRY* pstEnumEntry); + +/********************************************************************//** + * @~chinese + * @brief 设置Enum型属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值,如获取像素格式信息则为"PixelFormat" + * @param strValue [IN] 想要设置的设备的属性字符串 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置Enum类型的指定节点的值。 + + * @~english + * @brief Sets the value of enumeration type node + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to key value (node name), for example, using "PixelFormat" to set pixel format. + * @param strValue [IN] It refers to device property string to be set. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of Enum type + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetEnumValueByString(IN void* handle,IN const char* strKey,IN const char* strValue); + +/********************************************************************//** + * @~chinese + * @brief 获取Float属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值 + * @param pstFloatValue [IN][OUT] 返回给调用者有关设备属性结构体指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以获取float类型的指定节点的值。 + + * @~english + * @brief Gets the value of float type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to the key value. + * @param pstFloatValue [IN][OUT] It refers to the structure pointer to the returned device features. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of float type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetFloatValue(IN void* handle,IN const char* strKey,IN OUT MVCC_FLOATVALUE *pstFloatValue); + +/********************************************************************//** + * @~chinese + * @brief 设置Float型属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值 + * @param fValue [IN] 想要设置的设备的属性值 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置float类型的指定节点的值。 + + * @~english + * @brief Sets the value of float type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to the key value. + * @param fValue [IN] It refers to device node value to be set. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of float type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetFloatValue(IN void* handle,IN const char* strKey,IN float fValue); + +/********************************************************************//** + * @~chinese + * @brief 获取Boolean属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值 + * @param pbValue [IN][OUT] 返回给调用者有关设备属性值 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以获取bool类型的指定节点的值。 + + * @~english + * @brief Gets the value of boolean type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to the key value. + * @param pbValue [IN][OUT] It refers to the structure pointer for returning device features. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of bool type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetBoolValue(IN void* handle,IN const char* strKey,IN OUT bool *pbValue); + +/********************************************************************//** + * @~chinese + * @brief 设置Boolean型属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值 + * @param bValue [IN] 想要设置的设备的属性值 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置bool类型的指定节点的值。 + + * @~english + * @brief Sets the value of boolean type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to the key value. + * @param bValue [IN] It refers to device node value to be set. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of bool type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBoolValue(IN void* handle,IN const char* strKey,IN bool bValue); + +/********************************************************************//** + * @~chinese + * @brief 获取String属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值 + * @param pstStringValue [IN][OUT] 返回给调用者有关设备属性结构体指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以获取string类型的指定节点的值。 + + * @~english + * @brief Gets the value of string type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to the key value. + * @param pstStringValue [IN][OUT] It refers to the structure pointer to the returned device features. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarksCall this API after connecting to the device to get the value of specified node of string type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetStringValue(IN void* handle,IN const char* strKey,IN OUT MVCC_STRINGVALUE *pstStringValue); + +/********************************************************************//** + * @~chinese + * @brief 设置String型属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值 + * @param strValue [IN] 想要设置的设备的属性值 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置string类型的指定节点的值。 + + * @~english + * @brief Sets the value of string type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to the key value. + * @param strValue [IN] It refers to device node value to be set. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of string type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetStringValue(IN void* handle,IN const char* strKey,IN const char* strValue); + +/********************************************************************//** + * @~chinese + * @brief 设置Command型属性值 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strKey [IN] 属性键值 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置指定的Command类型节点。 + + * @~english + * @brief Sets the value of command type node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strKey [IN] It refers to the key value. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to get the value of specified node of Command type. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetCommandValue(IN void* handle,IN const char* strKey); + +/********************************************************************//** + * @~chinese + * @brief 获得当前节点的访问模式 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strName [IN] 节点名称 + * @param penAccessMode [IN][OUT] 节点的访问模式 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Gets access mode of the current node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strName [IN] It refers to the node name. + * @param penAccessMode [IN][OUT] It refers to access mode for node. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_XML_GetNodeAccessMode(IN void* handle, IN const char * strName, IN OUT enum MV_XML_AccessMode *penAccessMode); + +/********************************************************************//** + * @~chinese + * @brief 获得当前节点的类型 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strName [IN] 节点名称 + * @param penInterfaceType [IN][OUT] 节点的类型 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 在调用 MV_CC_GetIntValueEx() 、 MV_CC_SetIntValueEx() 等万能接口之前,您可调用该接口获取节点类型,方便选择合适的接口进行节点值的设置和获取。 + + * @~english + * @brief Gets the type of the current node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strName [IN] It refers to the node name. + * @param penInterfaceType [IN][OUT] It refers to node type. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks You can call this API to get the node type in advance before calling the universal API, so that you can choose the proper universal API to get and set node value. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_XML_GetNodeInterfaceType(IN void* handle, IN const char * strName, IN OUT enum MV_XML_InterfaceType *penInterfaceType); + +/********************************************************************//** + * @~chinese + * @brief 导入设备属性 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strFileName [IN] 属性文件名 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Loads device features. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strFileName [IN] It refers to the feature file name. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FeatureLoad(IN void* handle, IN const char* strFileName); + +/********************************************************************//** + * @~chinese + * @brief 导入设备属性并保存错误信息列表 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strFileName [IN] 属性文件名 + * @param pstNodeErrorList [IN OUT] 错误信息列表 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 部分节点导入失败时,接口返回MV_OK,通过错误信息列表中stNodeError获取出错节点及失败原因 + * \li pstNodeErrorList该参数在外部申请并由内部填充数据。该参数可接受填入null,代表用户不关心导入时的错误信息。 + + * @~english + * @brief Loads device features, and saves error information list. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param strFileName [IN] It refers to the feature file name. + * @param pstNodeErrorList [IN OUT] It refers to the error message list. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks If loading part of the nodes fails, the API will return MV_OK. You can get the error node and the reason for failure through stNodeError in the error message list. + * The parameter pstNodeErrorList is requested by the user externally and filled with data internally, and the value null indicates that the user is not concerned about error occurred when loading. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FeatureLoadEx(IN void* handle, IN const char* strFileName, IN OUT MVCC_NODE_ERROR_LIST* pstNodeErrorList); + +/********************************************************************//** + * @~chinese + * @brief 保存设备属性 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param strFileName [IN] 属性文件名 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Saves device features. + * @param handle [IN] It refers to device handle / frame grabber handle. + * @param strFileName [IN] It refers to the feature file name. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FeatureSave(IN void* handle, IN const char* strFileName); + +/// @} + +/// \addtogroup 读写寄存器 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 读内存 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param pBuffer [IN][OUT] 作为返回值使用,保存读到的内存值(GEV设备内存值是按照大端模式存储的,采集卡设备和采集卡下相机按照大端存储,其它协议设备按照小端存储) + * @param nAddress [IN] 待读取的内存地址,该地址可以从设备的Camera.xml文件中获取,形如xxx_RegAddr的xml节点值 + * @param nLength [IN] 待读取的内存长度 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 读取设备某段寄存器的数据。 + + * @~english + * @brief Read data from device register. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param pBuffer [IN][OUT] It refers to data buffer for saving memory value that is read (GEV memory value is stored based on big-endian mode, frame grabber device is stored based on big-endian mode, and memory value of other devices is stored based on little-endian mode) + * @param nAddress [IN] It refers to memory address to be read. It can be acquired from Camera.xml file, in a form similar to XML node value of xxx_RegAddr. + * @param nLength [IN] It refers to length of memory to be read. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Access device and read the data from certain register. +*************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ReadMemory(IN void* handle , IN OUT void *pBuffer, IN int64_t nAddress, IN int64_t nLength); + +/********************************************************************//** + * @~chinese + * @brief 写内存 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param pBuffer [IN] 待写入的内存值(注意GEV设备内存值要按照大端模式存储,采集卡设备和采集卡下相机按照大端存储,其它协议设备按照小端存储) + * @param nAddress [IN] 待写入的内存地址,该地址可以从设备的Camera.xml文件中获取,形如xxx_RegAddr的xml节点值 + * @param nLength [IN] 待写入的内存长度 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 访问设备,把一段数据写入某段寄存器。 + + * @~english + * @brief Writes data into device register. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param pBuffer [IN] It refers to memory value to be written(GEV memory value is stored based on big-endian mode, frame grabber device is stored based on big-endian mode, and memory value of other devices is stored based on little-endian mode) + * @param nAddress [IN] It refers to memory address to be written to. It can be acquired from Camera.xml file, in a form similar to XML node value of xxx_RegAddr. + * @param nLength [IN] It refers to length of memory to be written. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Access device for writing data to certain segment of register. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_WriteMemory(IN void* handle, IN const void *pBuffer, IN int64_t nAddress, IN int64_t nLength); + +/// @} + +/// \addtogroup 设备XML文件 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 清除GenICam节点缓存 + * @param handle [IN] 设备句柄/采集卡句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remark 在加载工业相机节点时需要读取GenICam配置文件,该接口可以起到清除GenICam缓存的功能。 + + * @~english + * @brief Clears the buffer of the GenICam node. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_InvalidateNodes(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 获取设备属性树XML + * @param handle [IN] 设备句柄/采集卡句柄 + * @param pData [IN][OUT] XML数据接收缓存 + * @param nDataSize [IN] 接收缓存大小 + * @param pnDataLen [IN][OUT] 实际数据大小 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 当pData为NULL或nDataSize比实际的xml文件小时,不拷贝数据,由pnDataLen返回xml文件大小。 \n + \li 当pData为有效缓存地址,且缓存足够大时,拷贝完整数据保存在该缓存里面,并由pnDataLen返回xml文件实际大小。 \n + + * @~english + * @brief Gets the XML file of device feature tree. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param pData [IN][OUT] It refers to received XML data buffer. + * @param nDataSize [IN] It refers to received buffer size. + * @param pnDataLen [IN][OUT] It refers to actual data size. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks When pData is NULL or when the value of nDataSize is less than the XML file size, no data will be copied, and the XML file size will be returned by pnDataLen. + When pData is valid and the buffer size is enough, the complete data will be copied and stored in the buffer, and the XML file size will be returned by pnDataLen. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_XML_GetGenICamXML(IN void* handle, IN OUT unsigned char* pData, IN unsigned int nDataSize, IN OUT unsigned int* pnDataLen); + +/// @} + +/// \addtogroup 读写相机文件 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 从设备读取文件 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param pstFileAccess [IN] 文件存取结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Reads the file from the device. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param pstFileAccess [IN] It refers to the file access structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FileAccessRead(IN void* handle, IN MV_CC_FILE_ACCESS * pstFileAccess); + +/********************************************************************//** + * @~chinese + * @brief 从设备读取文件(扩展接口,文件是Data数据) + * @param handle [IN] 设备句柄/采集卡句柄 + * @param pstFileAccessEx [IN] 文件存取结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口直接使用缓存数据,进行读写操作,避免直接操作文件出现无权限的问题。该接口是 MV_CC_FileAccessRead() 的扩展接口。 + + * @~english + * @brief Reads the Data file from the device (extended). + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param pstFileAccessEx [IN] It refers to the file access structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FileAccessReadEx(IN void* handle, IN OUT MV_CC_FILE_ACCESS_EX * pstFileAccessEx); + +/********************************************************************//** + * @~chinese + * @brief 将文件写入设备 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param pstFileAccess [IN] 文件存取结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Writes file to device. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param pstFileAccess [IN] It refers to the file access structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FileAccessWrite(IN void* handle, IN MV_CC_FILE_ACCESS * pstFileAccess); + +/********************************************************************//** + * @~chinese + * @brief 将缓存(buffer)写入设备 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param pstFileAccessEx [IN][OUT] 文件存取结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口直接使用缓存数据,进行写操作,避免直接将文件写入C盘,系统保护出现写失败。该接口是 MV_CC_FileAccessWrite() 的扩展接口。 + + * @~english + * @brief Writes buffer to device. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param pstFileAccessEx [IN][OUT] It refers to the file access structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to write the file by using the buffer data in case of the error of system protection when operating files in C disk. This API is the extended API of MV_CC_FileAccessWrite(). + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FileAccessWriteEx(IN void* handle, IN OUT MV_CC_FILE_ACCESS_EX * pstFileAccessEx); + +/********************************************************************//** + * @~chinese + * @brief 获取文件存取的进度 + * @param handle [IN] 设备句柄/采集卡句柄 + * @param pstFileAccessProgress [IN][OUT] 进度内容 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 (当前文件存取的状态) + + * @~english + * @brief Gets file access progress. + * @param handle [IN] It refers to the device handle or frame grabber handle. + * @param pstFileAccessProgress [IN][OUT] It refers to the file access progress. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetFileAccessProgress(IN void* handle, IN OUT MV_CC_FILE_ACCESS_PROGRESS * pstFileAccessProgress); + +/// @} + +/*******************Part5 ch: 相机和采集卡 升级 | en: Camera /Frame grabber upgrade *******************/ + +/// \addtogroup 设备升级 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 设备本地升级 + * @param handle [IN] 设备句柄 + * @param strFilePathName [IN] 文件名 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 通过该接口可以将升级固件文件发送给设备进行升级。该接口需要等待升级固件文件成功传给设备端之后再返回,响应时间可能较长。 + + * @~english + * @brief Upgrades device via local file. + * @param handle [IN] It refers to the device handle. + * @param strFilePathName [IN] It refers to the file name. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Provided this API to send upgrade firmware to device. + It may take a long response time since the API will only be recalled after the upgrade firmware is sent to device. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_LocalUpgrade(IN void* handle, IN const void* strFilePathName); + +/********************************************************************//** + * @~chinese + * @brief 获取升级进度 + * @param handle [IN] 设备句柄 + * @param pnProcess [IN][OUT] 进度接收地址 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Gets the upgrade progress. + * @param handle [IN] It refers to the device handle. + * @param pnProcess [IN][OUT] It refers to address for receiving upgrade progress. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetUpgradeProcess(IN void* handle, IN OUT unsigned int* pnProcess); + +/// @} + +/*******************Part6 ch: 相机和采集卡 注册异常回调和事件接口 | en: Exception callback registration and event API for cameras and frame grabbers*******************/ + +/// \addtogroup 事件及异常 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 注册异常消息回调,在打开设备之后调用 + * @param handle [IN] 设备句柄 + * @param cbException [IN] 异常回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 该接口需要在 MV_CC_OpenDevice() 打开设备之后调用。\n + \li 设备异常断开连接后可以在回调里面获取到异常消息,GigE设备掉线之后需要先调用 MV_CC_CloseDevice() 接口关闭设备,再调用 MV_CC_OpenDevice() 接口重新打开设备。 + | 宏定义 | 宏定义值 | 含义 | + | :---: | :---: | :---: | + | \ref MV_EXCEPTION_DEV_DISCONNECT | 0x00008001 | 设备断开连接 | + + * @~english + * @brief Register callback function for getting exception information of cameras and dongles. + * @param handle [IN] It refers to the device handle. + * @param cbException [IN] It refers to the pointer to the exception callback function. + * @param pUser [IN] It refers to the user-defined variable. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after turning on the device by calling MV_CC_OpenDevice(). + When the device is exceptionally disconnected, you can get the exception message from callback function. + For disconnected GigE device, call MV_CC_CloseDevice() to turn off the device, and then call MV_CC_OpenDevice() to turn on the device again. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterExceptionCallBack(IN void* handle, IN MvExceptionCallback cbException, IN void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 注册全部事件回调,在打开设备之后调用 + * @param handle [IN] 设备句柄 + * @param cbEvent [IN] 事件回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 通过该接口设置事件回调,可以在回调函数里面获取采集、曝光等事件信息。 + \li 该接口不支持CameraLink设备。 + + * @~english + * @brief Registers a callback for all events. + * @param handle [IN] It refers to the device handle. + * @param cbEvent [IN] It refers to the pointer to the event callback function. + * @param pUser [IN] It refers to user-defined variable. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to set the event callback function to get event information including acquisition and exposure. + This API is not supported by CameraLink device. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterAllEventCallBack(IN void* handle, IN MvEventCallback cbEvent, IN void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 注册单个事件回调,在打开设备之后调用 + * @param handle [IN] 设备句柄 + * @param strEventName [IN] 事件名称 + * @param cbEvent [IN] 事件回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 + * @note \li 通过该接口设置事件回调,可以在回调函数里面获取采集、曝光等事件信息。 + \li 该接口不支持CameraLink设备。 + + * @~english + * @brief Registers a callback for single event. + * @param handle [IN] It refers to the device handle. + * @param strEventName [IN] It refers to the event name. + * @param cbEvent [IN] It refers to the pointer to the event callback function. + * @param pUser [IN] It refers to user-defined variable. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to set the event callback function to get event information including acquisition and exposure. + This API is not supported by CameraLink device . +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterEventCallBackEx(IN void* handle, IN const char* strEventName, IN MvEventCallback cbEvent, IN void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 注册流异常消息回调 + * @param handle [IN] 设备句柄 + * @param cbStreamException [IN] 异常回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 +* @remarks \li 该接口注册的回调函数中不能调用 MV_CC_StopGrabbing() 、 MV_CC_CloseDevice() 和 MV_CC_DestroyHandle() ,只用于消息通知。 + \li 该接口不支持虚拟相机和导入三方cti的场景。 + + * @~english + * @brief Registers a stream exception callback. + * @param handle [IN] It refers to the device handle. + * @param cbStreamException [IN] It refers to the pointer to the exception callback function. + * @param pUser [IN] It refers to the user-defined variable. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks In the callback function registered via this API, MV_CC_StopGrabbing(), MV_CC_CloseDevice(), and MV_CC_DestroyHandle() cannot be called, and the callback function can only be used for message notification. + This API does not support virtual cameras and scenarios involving the import of third-party CTI files. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterStreamExceptionCallBack(IN void* handle, IN MvStreamExceptionCallback cbStreamException, IN void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 开启设备指定事件 + * @param handle [IN] 设备句柄 + * @param strEventName [IN] 事件名称 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Enables specified event of device. + * @param handle [IN] It refers to the device handle. + * @param strEventName [IN] It refers to the event name. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EventNotificationOn(IN void* handle, IN const char* strEventName); + +/********************************************************************//** + * @~chinese + * @brief 关闭设备指定事件 + * @param handle [IN] 设备句柄 + * @param strEventName [IN] 事件名称 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Disable specified event of device + * @param handle [IN] It refers to the device handle. + * @param strEventName [IN] It refers to the event name. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EventNotificationOff(IN void* handle, IN const char* strEventName); + +/// @} + +/*******************Part7 ch: 仅GigE设备支持的接口 | en: API exclusively for GigE devices*******************/ + +/// \addtogroup GigE相机 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 设置枚举超时时间,仅支持GigE协议,范围:[1, UINT_MAX) + * @param nMilTimeout [IN] 超时时间,应为无符号整数,默认100ms + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 在调用 MV_CC_EnumDevices() 等枚举接口前使用该接口,可设置枚举GIGE设备的网卡最大超时时间(默认100ms),可以减少最大超时时间,以加快枚举GIGE设备的速度。\n + \li 该接口仅支持输入无符号整数。 + * @note 该接口仅支持GigEVision设备。 + + * @~english + * @brief Sets enumeration timeout duration, range: [1, UINT_MAX). Only GigE protocol is supported. + * @param nMilTimeout [IN] It refers to the timeout duration, unit: millisecond. The value should be an integer (100 by default). + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API before calling enumeration APIs including MV_CC_EnumDevices() to set the timeout duration for enumerating GigE devices (100 ms by default). You can accelerate the enumeration by reducing the timeout duration. + * @remarks Only supports GigE vision devices. + + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetEnumDevTimeout(IN unsigned int nMilTimeout); + +/********************************************************************//** + * @~chinese + * @brief 强制IP + * @param handle [IN] 设备句柄 + * @param nIP [IN] 设置的IP + * @param nSubNetMask [IN] 子网掩码 + * @param nDefaultGateWay [IN] 默认网关 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 强制设置设备网络参数(包括IP、子网掩码、默认网关),强制设置之后将需要重新创建设备句柄,支持GigEVision(MV_GIGE_DEVICE)设备和GenTL(MV_GENTL_GIGE_DEVICE)设备。 \n + \li 如果设备为DHCP的状态,调用该接口强制设置设备网络参数之后设备将会重启。 \n + + * @~english + * @brief Sets device network parameters forcefully, including IP address, subnet mask, and default gateway. + * @param handle [IN] It refers to the device handle. + * @param nIP [IN] It refers to the IP address. + * @param nSubNetMask [IN] It refers to the subnet mask. + * @param nDefaultGateWay [IN] It refers to the default gateway. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks After forcing the configuration of device network parameters (including IP address, subnet mask,and default gateway), create device handle again. + This API is supported GigEVision(MV_GIGE_DEVICE) and GenTL(MV_GENTL_GIGE_DEVICE) device. + The device will restart after calling this API to set network parameters forcefully when the device is in DHCP status. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_ForceIpEx(IN void* handle, IN unsigned int nIP, IN unsigned int nSubNetMask, IN unsigned int nDefaultGateWay); + +/********************************************************************//** + * @~chinese + * @brief 配置IP方式 + * @param handle [IN] 设备句柄 + * @param nType [IN] IP类型,见MV_IP_CFG_x + | 宏定义 | 宏定义值 | 含义 | + | :---: | :---: | :---: | + | \ref MV_IP_CFG_STATIC | 0x05000000 | 固定IP地址模式 | + | \ref MV_IP_CFG_DHCP | 0x06000000 | DHCP自动获取IP模式 | + | \ref MV_IP_CFG_LLA | 0x04000000 | LLA(Link-local address),链路本地地址 | + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 发送命令设置设备的IP方式,如DHCP、LLA等,仅支持GigEVision(MV_GIGE_DEVICE)和GenTl(MV_GENTL_GIGE_DEVICE)的设备。 + + * @~english + * @brief Configures IP mode. + * @param handle [IN] It refers to the device handle. + * @param nType [IN] It refers to IP type. Refer to MV_IP_CFG_x for more details. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is only supported by GigE vision devices and GenTL(MV_GENTL_GIGE_DEVICE) device. You can send command to set the MVC IP configuration mode, including DHCP and LLA. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetIpConfig(IN void* handle, IN unsigned int nType); + +/********************************************************************//** + * @~chinese + * @brief 设置仅使用某种模式,type: MV_NET_TRANS_x,不设置时,默认优先使用driver + * @param handle [IN] 设备句柄 + * @param nType [IN] 网络传输模式,见MV_NET_TRANS_x + | 宏定义 | 宏定义值 | 含义 | + | :---: | :---: | :---: | + | \ref MV_NET_TRANS_DRIVER | 0x00000001 | 驱动模式 | + | \ref MV_NET_TRANS_SOCKET | 0x00000002 | Socket模式 | + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 通过该接口可以设置SDK内部优先使用的网络模式,默认优先使用驱动模式,仅GigEVision设备支持。 + + * @~english + * @brief Sets SDK internal priority network mode. If it is not set, driver mode is used by default. + * @param handle [IN] It refers to the device handle. + * @param nType [IN] It refers to the network transmission mode. See MV_NET_TRANS_x for details. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarksSet You can call this API to set the internal priority network mode for the SDK (driver mode by default). This API is supported by GigE vision devices only. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetNetTransMode(IN void* handle, IN unsigned int nType); + +/********************************************************************//** + * @~chinese + * @brief 获取网络传输信息 + * @param handle [IN] 设备句柄 + * @param pstInfo [IN][OUT] 信息结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 通过该接口可以获取网络传输相关信息,包括已接收数据大小、丢帧数量等,在 MV_CC_StartGrabbing() 开启采集之后调用。仅GigEVision相机支持。 + + * @~english + * @brief Gets network transmission information. + * @param handle [IN] It refers to the device handle. + * @param pstInfo [IN][OUT] It refers to network transmission information structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to get information about network transmission after grabbing images via calling MV_CC_StartGrabbing(), including received data size and the number of lost frames. + This API is supported only by GigEVision devices. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetNetTransInfo(IN void* handle, IN OUT MV_NETTRANS_INFO* pstInfo); + +/********************************************************************//** + * @~chinese + * @brief 设置枚举命令的回复包类型 + * @param nMode [IN] 回复包类型(默认广播),0-单播,1-广播 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口只对GigE相机有效。 + + * @~english + * @brief Sets the ACK mode of enumeration command. + * @param nMode [IN] It refers to the ACK mode (default broadcast). 0: unicast; 1: broadcast. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is only supported by GigE devices. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetDiscoveryMode(IN unsigned int nMode); + +/********************************************************************//** + * @~chinese + * @brief 设置GVSP取流超时时间 + * @param handle [IN] 设备句柄 + * @param nMillisec [IN] 超时时间,默认300ms,范围:>10ms + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后,取流动作发生前,调用该接口可以设置GVSP取流超时时间。GVSP取流超时设置过短可能造成图像异常,设置过长可能造成取流时间变长。 + + * @~english + * @brief Sets timeout duration for image grabbing via GVSP. + * @param handle [IN] It refers to the device handle. + * @param nMillisec [IN] It refers to timeout duration (unit:millisecond), range:>10ms. The default value is 300 ms. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks After connecting to the device and before starting image grabbing, call this API to set timeout duration for image grabbing via GVSP. + Image exception might occur if timeout duration is too short, and the streaming duration will become longer if timeout duration is too long. + * + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvspTimeout(IN void* handle, IN unsigned int nMillisec); + +/********************************************************************//** + * @~chinese + * @brief 获取GVSP取流超时时间 + * @param handle [IN] 设备句柄 + * @param pnMillisec [IN][OUT] 超时时间指针,以毫秒为单位 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于获取当前的GVSP取流超时时间 + + * @~english + * @brief Gets timeout for image grabbing via GVSP. + * @param handle [IN] It refers to the device handle. + * @param pnMillisec [IN][OUT] It refers to pointer to the timeout duration, unit: millisecond. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to get the current timeout duration of image grabbing via GVSP. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvspTimeout(IN void* handle, IN OUT unsigned int* pnMillisec); + +/********************************************************************//** + * @~chinese + * @brief 设置GVCP命令超时时间 + * @param handle [IN] 设备句柄 + * @param nMillisec [IN] 超时时间(ms),默认500ms,范围:[0,10000] + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置GVCP命令超时时间。 + + * @~english + * @brief Sets timeout for GVCP command. + * @param handle [IN] It refers to the device handle. + * @param nMillisec [IN] It refers to the timeout duration, range: [0, 10000], unit: millisecond. It is 500 ms by default. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to set the timeout of GVCP command. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetGvcpTimeout(IN void* handle, IN unsigned int nMillisec); + +/********************************************************************//** + * @~chinese + * @brief 获取GVCP命令超时时间 + * @param handle [IN] 设备句柄 + * @param pnMillisec [IN][OUT] 超时时间指针,以毫秒为单位 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于获取当前的GVCP超时时间。 + + * @~english + * @brief Gets timeout duration for GVCP command. + * @param handle [IN] It refers to the device handle. + * @param pnMillisec [IN][OUT] It refers to pointer to the timeout duration, unit: millisecond. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to get the current GVCP timeout duration. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetGvcpTimeout(IN void* handle, IN OUT unsigned int* pnMillisec); + +/********************************************************************//** + * @~chinese + * @brief 设置重传GVCP命令次数 + * @param handle [IN] 设备句柄 + * @param nRetryGvcpTimes [IN] 重传次数,范围:0-100 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于在GVCP包传输异常时,增加重传的次数,在一定程度上可以避免设备掉线,范围为0-100。 + + * @~english + * @brief Sets the number of times for resending GVCP command. + * @param handle [IN] It refers to the device handle. + * @param nRetryGvcpTimes [IN] It refers to the number of times for resending. It should be between 0 and 100. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to increase the resending times when exception occurred during GVCP packet transmission, range: [0, 100]. To some extent, it can prevent the device from getting offline. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetRetryGvcpTimes(IN void* handle, IN unsigned int nRetryGvcpTimes); + +/********************************************************************//** + * @~chinese + * @brief 获取重传GVCP命令次数 + * @param handle [IN] 设备句柄 + * @param pnRetryGvcpTimes [IN][OUT] 重传次数指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于获取当前的GVCP重传次数,默认3次。 + + * @~english + * @brief Gets the number of times for resending GVCP command. + * @param handle [IN] It refers to the device handle. + * @param pnRetryGvcpTimes [IN][OUT] It refers to the pointer to resending times. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to get the current resending times of GVCP command (3 by default). + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetRetryGvcpTimes(IN void* handle, IN OUT unsigned int* pnRetryGvcpTimes); + +/********************************************************************//** + * @~chinese + * @brief 获取最佳的packet size,该接口目前只支持GigE设备 + * @param handle [IN] 设备句柄 + * @return 最佳packetsize + * @remarks \li 获取最佳的packet size,对应GigEVision设备是SCPS,对应U3V设备是每次从驱动读取的包大小,该大小即网络上传输一个包的大小。\n + \li 该接口需要在 MV_CC_OpenDevice() 之后、 MV_CC_StartGrabbing() 之前调用。\n + \li 该接口不支持CameraLink设备、U3V设备。\n + \li 该接口不支持GenTL设备(协议不支持),如果是GenTL方式添加的网口相机,建议根据网络实际情况配置GevSCPSPacketSize,或者配置1500。 + + * @~english + * @brief Gets the optimal packet size. + * @param handle [IN] It refers to the device handle. + * @return Returns optimal packet size. + * @remarks The optimal packet size for GigEVision device is SCPS. + This API should be called after calling MV_CC_OpenDevice(), and before calling MV_CC_StartGrabbing(). + This API is not supported by CameraLink device and U3V device. + This API is not supported by GenTL device (unsupported protocols). For GigE Vision cameras added via GenTL, configure GevSCPSPacketSize or configure 1500 as needed. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetOptimalPacketSize(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 设置是否打开重发包支持,及重发包设置 + * @param handle [IN] 设备句柄 + * @param bEnable [IN] 是否支持重发包 + * @param nMaxResendPercent [IN] 最大重发比 + * @param nResendTimeout [IN] 重发超时时间,范围:0-10000ms + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 连接设备之后调用该接口可以设置重发包属性,仅GigEVision设备支持。 + + * @~english + * @brief Sets whether to enable packet resending, and sets corresponding parameters. + * @param handle [IN] It refers to the device handle. + * @param bEnable [IN] Whether to enable packet resending. + * @param nMaxResendPercent [IN] It refers to the max. resending percent. + * @param nResendTimeout [IN] It refers to resending timeout duration. rang:0-10000ms + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API after connecting to the device to set packet resending parameters. This API is only supported by GigE vision devices. + ************************************************************************/ +#ifndef __cplusplus +MV_CAMCTRL_API int __stdcall MV_GIGE_SetResend(IN void* handle, IN unsigned int bEnable, IN unsigned int nMaxResendPercent, IN unsigned int nResendTimeout); +#else +MV_CAMCTRL_API int __stdcall MV_GIGE_SetResend(IN void* handle, IN unsigned int bEnable, IN unsigned int nMaxResendPercent = 100, IN unsigned int nResendTimeout = 50); +#endif + +/********************************************************************//** + * @~chinese + * @brief 设置重传命令最大尝试次数 + * @param handle [IN] 设备句柄 + * @param nRetryTimes [IN] 重传命令最大尝试次数,默认20 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口必须在调用 MV_GIGE_SetResend() 开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER + + * @~english + * @brief Sets the max. command resending times. + * @param handle [IN] It refers to the device handle. + * @param nRetryTimes [IN] It refers to the max. command resending times. It is 20 by default. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API should be called after resending packet is enabled via calling MV_GIGE_SetResend(). If APIs are not called in order, it will be failed and MV_E_CALLORDER will be returned. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendMaxRetryTimes(IN void* handle, IN unsigned int nRetryTimes); + +/********************************************************************//** + * @~chinese + * @brief 获取重传命令最大尝试次数 + * @param handle [IN] 设备句柄 + * @param pnRetryTimes [IN][OUT] 重传命令最大尝试次数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口必须在调用 MV_GIGE_SetResend() 开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER。 + + * @~english + * @brief Gets the max. command resending times. + * @param handle [IN] It refers to the device handle. + * @param pnRetryTimes [IN][OUT] It refers to the max. times to retry resending lost packets + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API should be called after resending packet is enabled via calling MV_GIGE_SetResend(). If APIs are not called in order, it will be failed and MV_E_CALLORDER will be returned. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendMaxRetryTimes(IN void* handle, IN OUT unsigned int* pnRetryTimes); + +/********************************************************************//** + * @~chinese + * @brief 设置同一重传包多次请求之间的时间间隔 + * @param handle [IN] 设备句柄 + * @param nMillisec [IN] 同一重传包多次请求之间的时间间隔,默认10ms + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口必须在调用 MV_GIGE_SetResend() 开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER。 + + * @~english + * @brief Sets the time interval of two resending requests for one packet. + * @param handle [IN] It refers to the device handle. + * @param nMillisec [IN] It refers to the time interval of two resending requests for one packet. It is 10 ms by default. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API should be called after resending packet is enabled via calling MV_GIGE_SetResend(). If APIs are not called in order, MV_GIGE_SetResendTimeInterval() calling will be failed and MV_E_CALLORDER will be returned. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetResendTimeInterval(IN void* handle, IN unsigned int nMillisec); + +/********************************************************************//** + * @~chinese + * @brief 获取同一重传包多次请求之间的时间间隔 + * @param handle [IN] 设备句柄 + * @param pnMillisec [IN][OUT] 同一重传包多次请求之间的时间间隔 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口必须在调用 MV_GIGE_SetResend() 开启重传包功能之后调用,否则失败且返回MV_E_CALLORDER。 + + * @~english + * @brief Gets the time interval of two resending requests for one packet. + * @param handle [IN] It refers to the device handle. + * @param pnMillisec [IN][OUT] It refers to the time interval of two resending requests for one packet. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API should be called after resending packet is enabled via calling MV_GIGE_SetResend(). If APIs are not called in order, MV_GIGE_GetResendTimeInterval() calling will be failed and MV_E_CALLORDER will be returned. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetResendTimeInterval(IN void* handle, IN OUT unsigned int* pnMillisec); + +/********************************************************************//** + * @~chinese + * @brief 设置传输模式,可以为单播模式、组播模式等 + * @param handle [IN] 设备句柄 + * @param pstTransmissionType [IN] 传输模式结构体 + | 宏定义 | 宏定义值 | 含义 | + | :---: | :---: | :---: | + | \ref MV_GIGE_TRANSTYPE_UNICAST | 0 | 单播 | + | \ref MV_GIGE_TRANSTYPE_MULTICAST | 1 |组播 | + | \ref MV_GIGE_TRANSTYPE_LIMITEDBROADCAST | 2 | 表示局域网内广播 | + | \ref MV_GIGE_TRANSTYPE_SUBNETBROADCAST | 3 | 表示子网内广播 | + | \ref MV_GIGE_TRANSTYPE_CAMERADEFINED | 4 | 表示从相机获取 | + | \ref MV_GIGE_TRANSTYPE_UNICAST_DEFINED_PORT | 5 | 表示用户自定义应用端接收图像数据Port号 | + | \ref MV_GIGE_TRANSTYPE_UNICAST_WITHOUT_RECV | 00010000 | 表示设置了单播,但本实例不接收图像数据 | + | \ref MV_GIGE_TRANSTYPE_MULTICAST_WITHOUT_RECV | 00010001 | 表示组播模式,但本实例不接收图像数据 | + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 通过该接口可以设置传输模式为单播、组播等模式,仅GigEVision设备支持。 + + * @~english + * @brief Sets the transmission mode, including unicast and multicast. + * @param handle [IN] It refers to the device handle. + * @param pstTransmissionType [IN] It refers to the transmission mode structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to set the transmission mode as unicast mode and multicast mode.This API is only supported by GigE vision devices. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetTransmissionType(IN void* handle, IN MV_TRANSMISSION_TYPE * pstTransmissionType); + +/********************************************************************//** + * @~chinese + * @brief 发出动作命令 + * @param pstActionCmdInfo [IN] 动作命令信息 + * @param pstActionCmdResults [IN][OUT] 动作命令返回信息列表 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 仅GigEVision设备支持。 + + * @~english + * @brief Sends action commands. + * @param pstActionCmdInfo [IN] It refers to information of action commands. + * @param pstActionCmdResults [IN][OUT] It refers to list of returned information about action commands. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is supported only by GigEVision devices. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_IssueActionCommand(IN MV_ACTION_CMD_INFO* pstActionCmdInfo, IN OUT MV_ACTION_CMD_RESULT_LIST* pstActionCmdResults); + +/********************************************************************//** + * @~chinese + * @brief 获取组播状态 + * @param pstDevInfo [IN] 设备信息结构体 + * @param pbStatus [IN][OUT] 组播状态,true:组播状态,false:非组播 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于判断设备当前是否处于组播状态,解决客户端枚举时需要打开设备判断组播的问题。 \n + 仅支持标准GigE Vision设备。 + + * @~english + * @brief Gets multicast status. + * @param pstDevInfo [IN] It refers to device information. + * @param pbStatus [IN][OUT] It refers to status (true: multicast status; false: not multicast status). + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks When enumerating the device, call this API to check if the device is in multicast status without turning on the device. + This API only support GigE Vision Device. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetMulticastStatus(IN MV_CC_DEVICE_INFO* pstDevInfo, IN OUT bool* pbStatus); + +/// @} + +/*******************Part8 ch: 仅CameraLink 设备支持的接口 | en: API exclusively for CameraLink devices*******************/ + +/// \addtogroup 串口设备 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 获取串口信息列表 + * @param pstSerialPortList [IN][OUT] 串口信息列表 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于获取本地的串口信息。 + + * @~english + * @brief Gets serial port information list. + * @param pstSerialPortList [IN][OUT] It refers to serial port information list. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is used to get local serial port information. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_GetSerialPortList(IN OUT MV_CAML_SERIAL_PORT_LIST* pstSerialPortList); + +/********************************************************************//** + * @~chinese + * @brief 设置取指定枚举串口 + * @param pstSerialPortList [IN][OUT] 串口信息列表 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于设置枚举CameraLink 设备的指定串口。 + + * @~english + * @brief Specifies the serial ports for enumerations. + * @param pstSerialPortList [IN] It refers to serial port information list. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to specify serial ports for camera link device enumeration. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_SetEnumSerialPorts(IN MV_CAML_SERIAL_PORT_LIST* pstSerialPortList); + +/***********************************************************************************************************//** + * @~chinese + * @brief 设置设备波特率 + * @param handle [IN] 设备句柄 + * @param nBaudrate [IN] 设置的波特率值,数值参考CameraParams.h中宏定义 + | CamercaLink波特率定义 | 值 | 对应的波特率值 | + | :--- | :---: | :--- | + | \ref MV_CAML_BAUDRATE_9600 | 0x00000001 | 9600 | + | \ref MV_CAML_BAUDRATE_19200 | 0x00000002 | 19200 | + | \ref MV_CAML_BAUDRATE_38400 | 0x00000004 | 38400 | + | \ref MV_CAML_BAUDRATE_57600 | 0x00000008 | 57600 | + | \ref MV_CAML_BAUDRATE_115200 | 0x00000010 | 115200 | + | \ref MV_CAML_BAUDRATE_230400 | 0x00000020 | 230400 | + | \ref MV_CAML_BAUDRATE_460800 | 0x00000040 | 460800 | + | \ref MV_CAML_BAUDRATE_921600 | 0x00000080 | 921600 | + | \ref MV_CAML_BAUDRATE_AUTOMAX | 0x40000000 | 最大值 | + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口支持在设备未连接时调用。通过GenTL协议访问设备时,需要先连接设备,才能调用该接口。\n + 因硬件/系统/外部干扰等因素,配置高波特率可能导致通信异常,建议配置波特率最大小于115200。 + + * @~english + * @brief Sets baud rate for the device. + * @param handle [IN] It refers to the device handle. + * @param nBaudrate [IN] It refers to baud rate to set. Refer to the 'CameraParams.h' for parameter definitions. for example, #define MV_CAML_BAUDRATE_9600 0x00000001 + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks You can call this API when the device is not connected. If the device is accessed via GenTL protocol, call this API after the device is connected. + High baud rate may cause communication exception due to factors such as hardware specification, system configuration, and external interference. + It is recommended to configure a baud rate of less than 115200 +************************************************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_SetDeviceBaudrate(IN void* handle, IN unsigned int nBaudrate); + +/********************************************************************//** + * @~chinese + * @brief 获取设备波特率 + * @param handle [IN] 设备句柄 + * @param pnCurrentBaudrate [IN][OUT] 波特率信息指针,数值参考CameraParams.h中宏定义 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口支持在设备未连接时调用。 + + * @~english + * @brief Gets baud rate for devices. + * @param handle [IN] It refers to the device handle. + * @param pnCurrentBaudrate [IN][OUT] It refers to the pointer to baud rate information. See the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001 + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks You can call this API when the device is not connected. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_GetDeviceBaudrate(IN void* handle,IN OUT unsigned int* pnCurrentBaudrate); + +/********************************************************************//** + * @~chinese + * @brief 获取设备与主机间连接支持的波特率 + * @param handle [IN] 设备句柄 + * @param pnBaudrateAblity [IN][OUT] 支持的波特率信息的指针。 所有支持波特率的"或运算"结果,单个数值参考CameraParams.h中宏定义 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口支持在设备未连接时调用。 + + * @~english + * @brief Gets the supported baud rate of the connection between the device and host. + * @param handle [IN] It refers to the device handle. + * @param pnBaudrateAblity [IN][OUT] It refers to the pointer to the supported baud rate information. See 'CameraParams.h' for the definitions of single value of the OR operation results of all supported baud rate. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks You can call this API when the device is not connected. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_GetSupportBaudrates(IN void* handle,IN OUT unsigned int* pnBaudrateAblity); + +/********************************************************************//** + * @~chinese + * @brief 设置串口操作等待时长 + * @param handle [IN] 设备句柄 + * @param nMillisec [IN] 串口操作的等待时长, 单位为ms + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Sets the waiting duration for serial port operation. + * @param handle [IN] It refers to the device handle. + * @param nMillisec [IN] It refers to waiting time of serial port operation, unit: millisecond. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_SetGenCPTimeOut(IN void* handle, IN unsigned int nMillisec); + +/// @} + +/*******************Part9 ch: 仅U3V设备支持的接口 | en: API exclusively for USB3 Vision (U3V) devices*******************/ + +/// \addtogroup U3V相机 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 设置U3V的传输包大小 + * @param handle [IN] 设备句柄 + * @param nTransferSize [IN] 传输的包大小, Byte,默认为1M,rang:>=0x400,建议最大值:[windows] rang <= 0x400000;[Linux] rang <= 0x200000 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 增加传输包大小可以适当降低取流时的CPU占用率。但不同的PC和不同USB扩展卡存在不同的兼容性,如果该参数设置过大可能会出现取不到图像的风险。 + + * @~english + * @brief Sets transmission packet size of USB3 vision cameras. + * @param handle [IN] It refers to the device handle. + * @param nTransferSize [IN] It refers to the size of the transmission packet (unit: byte), and the default value is 1 MB (1,048,576 bytes).rang: >=0x400. + Recommended maximum values: [Windows] range ≤ 0x400000; [Linux] range ≤ 0x200000. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Increasing the packet size can reduce the CPU usage, but for different computers and USB expansion cards, the compatibility is different. If the packet size is too large, image acquisition might fail. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_USB_SetTransferSize(IN void* handle, IN unsigned int nTransferSize); + +/********************************************************************//** + * @~chinese + * @brief 获取U3V的传输包大小 + * @param handle [IN] 设备句柄 + * @param pnTransferSize [IN][OUT] 传输的包大小指针, Byte + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于获取当前的U3V传输包大小,默认1M。 + + * @~english + * @brief Gets transmission packet size of USB3 vision cameras. + * @param handle [IN] It refers to the device handle. + * @param pnTransferSize [IN][OUT] It refers to the pointer to the size of the transmission packet (unit: byte). + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to get the packet size of the current USB3 vision device (1 MB by default). +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_USB_GetTransferSize(IN void* handle, IN OUT unsigned int* pnTransferSize); + +/********************************************************************//** + * @~chinese + * @brief 设置U3V的传输通道个数 + * @param handle [IN] 设备句柄 + * @param nTransferWays [IN] 传输通道个数,范围:1-10 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 用户可以根据PC的性能、设备出图帧率、图像大小和内存使用率等因素对该参数进行调节。但不同的PC和不同的USB扩展卡存在不同的兼容性。 + + * @~english + * @brief Sets the number of transmission channels of USB3 vision cameras. + * @param handle [IN] It refers to the device handle. + * @param nTransferWays [IN] It refers to the number of transmission channels. It should be between 1 to 10. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This parameter can be adjusted based on computer performance, device image frame rate, device image size, and device memory usage. But compatibility differs due to different PC and USB expansion cards. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_USB_SetTransferWays(IN void* handle, IN unsigned int nTransferWays); + +/********************************************************************//** + * @~chinese + * @brief 获取U3V的传输通道个数 + * @param handle [IN] 设备句柄 + * @param pnTransferWays [IN][OUT] 传输通道个数指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于获取当前的U3V异步取流节点个数,U口相机传输通道个数和像素格式对应的负载包大小相关,可通过(最大异步注册长度/像素格式对应的负载包大小)计算得出。 \n + * 2000W设备的MONO8默认为3个,YUV为默认2个,RGB为默认1个,其它情况默认8个节点。 + + * @~english + * @brief Gets the number of transmission channels of USB3 vision cameras. + * @param handle [IN] It refers to the device handle. + * @param pnTransferWays [IN][OUT] It refers to the pointer to the number of transmission channels. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is used to get the current number of U3V asynchronous image acquisition nodes. + For USB3 vision cameras, the number of transmission channels is closely related to the packet size corresponding to the pixel format, and it can be calculated based on the max. asynchronous registration length/packet size of pixel format. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_USB_GetTransferWays(IN void* handle, IN OUT unsigned int* pnTransferWays); + +/********************************************************************//** + * @~chinese + * @brief 设置U3V的事件缓存节点个数 + * @param handle [IN] 设备句柄 + * @param nEventNodeNum [IN] 事件缓存节点个数,范围:1-64 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于设置当前的U3V事件缓存节点个数,默认情况下为5个。 + + * @~english + * @brief Sets the number of event buffer nodes of USB3 vision cameras. + * @param handle [IN] It refers to the device handle. + * @param nEventNodeNum [IN] It refers to the number of event buffer nodes, range: [1, 64]. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to set the number of the buffer nodes for the current USB3 vision event. The default value is 5. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_USB_SetEventNodeNum(IN void* handle, IN unsigned int nEventNodeNum); + +/********************************************************************//** + * @~chinese + * @brief 设置U3V的同步读写超时时间,范围为:[1000, INT_MAX),默认1000 ms + * @param handle [IN] 设备句柄 + * @param nMills [IN] 设置同步读写超时时间,默认时间为1000ms + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 增加设置同步读取时间接口,兼容部分相机配置参数很慢,超过1000ms的情况 + + * @~english + * @brief Sets the timeout duration for sync reading and writing of USB3 vision devices (1000 ms by default), range: [1000, INT_MAX]. + * @param handle [IN] It refers to the device handle. + * @param nMills [IN] It refers to the timeout duration for sync reading and writing (1000 by default), unit: millisecond. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Increasing the timeout duration for sync reading and writing can help deal with the problem that some cameras' parameter configuration process is very slow (more than 1000 ms). +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_USB_SetSyncTimeOut(IN void* handle, IN unsigned int nMills); + +/********************************************************************//** + * @~chinese + * @brief 获取U3V相机同步读写超时时间 + * @param handle [IN] 设备句柄 + * @param pnMills [IN][OUT] 获取的超时时间(ms) + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口用于获取当前的U3V同步读写超时时间大小,默认1000ms。 + + * @~english + * @brief Gets the timeout duration for sync reading and writing of USB3 vision devices. + * @param handle [IN] It refers to the device handle. + * @param pnMills [IN][OUT] It refers to the timeout duration, unit: millisecond. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to get the timeout duration for sync reading and writing of USB3 vision cameras (1000 ms by default). +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_USB_GetSyncTimeOut(IN void* handle, IN OUT unsigned int* pnMills); + +/// @} + + +/*******************Part10 ch: GenTL相关接口 | en: GenTL-related API*******************/ + +/// \addtogroup GenTL +/// @{ + +/******************************************************************************//** + * @~chinese + * @brief 通过GenTL枚举Interfaces + * @param pstIFList [IN][OUT] Interfaces列表 + * @param strGenTLPath [IN] GenTL的cti文件路径 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li Interfaces列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请,建议尽量避免多线程枚举操作。\n + \li 暂不支持直接调用MvProducerU3V.cti和MvProducerGEV.cti, 支持调用其他.cti + + * @~english + * @brief Enumerates interfaces via GenTL. + * @param pstIFList [IN][OUT] It refers to interface list. + * @param strGenTLPath [IN] It refers to CTI file path of GenTL. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The memory of device list is internally allocated. When this API is called in multiple threads, the SDK will release and apply for the device list memory. + It is recommended to avoid multithreaded enumeration operations. + MvProducerU3V.cti and MvProducerGEV.cti calling are unsupported. + *******************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EnumInterfacesByGenTL(IN OUT MV_GENTL_IF_INFO_LIST* pstIFList, IN const char * strGenTLPath); + +/********************************************************************//** + * @~chinese + * @brief 卸载cti库 + * @param pGenTLPath [IN] 枚举卡时加载的cti文件路径 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 卸载前需要保证通过该cti枚举出的相机已全部关闭,否则报错前置条件错误。 + + * @~english + * @brief Unload the CTI library. + * @param pGenTLPath [IN] It refers to the CTI file path during the enumeration. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Make sure that all cameras enumerated by the CTI file are closed before calling this API. Otherwise, MV_E_PRECONDITION error will be returned. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_UnloadGenTLLibrary(IN const char * pGenTLPath); + +/*****************************************************************************************************//** + * @~chinese + * @brief 通过GenTL Interface枚举设备 + * @param pstIFInfo [IN] Interface信息 + * @param pstDevList [IN][OUT] 设备列表 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 设备列表的内存是在SDK内部分配的,多线程调用该接口时会进行设备列表内存的释放和申请。 + * @note 尽量避免多线程枚举操作。 + + * @~english + * @brief Enumerates devices via GenTL interface. + * @param pstIFInfo [IN] It refers to interface information. + * @param pstDevList [IN][OUT] It refers to the device list. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The memory of device list is internally allocated. When this API is called in multiple threads, the SDK will release and apply for the device list memory. + It is recommended to avoid multithreaded enumeration operations. + *****************************************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EnumDevicesByGenTL(IN MV_GENTL_IF_INFO* pstIFInfo, IN OUT MV_GENTL_DEV_INFO_LIST* pstDevList); + +/********************************************************************//** + * @~chinese + * @brief 通过GenTL设备信息创建设备句柄 + * @param handle [IN][OUT] 设备句柄 + * @param pstDevInfo [IN] 设备信息结构体指针 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块。 + + * @~english + * @brief Creates the device handle by GenTL related device information. + * @param handle [IN][OUT] It refers to interface information. + * @param pstDevInfo [IN] It refers to the struct pointer to device Information. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Create required resources within library and initialize internal module according to input device information. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_CreateHandleByGenTL(IN OUT void ** handle, IN const MV_GENTL_DEV_INFO* pstDevInfo); + +/// @} + +/*******************Part11 ch: 图像保存、格式转换等相关接口 | en: Image saving and format conversion API*******************/ + +/// \addtogroup 图像处理 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 保存图片,支持Bmp和Jpeg. + * @param handle [IN] 设备句柄 + * @param pstSaveParam [IN][OUT] 保存图片参数结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 通过该接口可以将从设备采集到的原始图像数据转换成JPEG或者BMP等格式并存放在指定内存中,然后用户可以将转换之后的数据直接保存成图片文件。\n + \li 该接口调用无接口顺序要求,有图像源数据就可以进行转换,可以先调用 MV_CC_GetOneFrameTimeout() 或者 MV_CC_RegisterImageCallBackEx() 设置回调函数,获取一帧图像数据,然后再通过该接口转换格式。\n + \li 该接口支持长乘宽至UINT_MAX,其中 MV_CC_SaveImageEx2() 支持长乘宽最大至 USHRT_MAX,JPEG格式最大支持宽高为65500。 + + * @~english + * @brief Saves images, supporting BMP and JPEG. + * @param handle [IN] It refers to the device handle. + * @param pstSaveParam [IN][OUT] It refers to the structure of image saving parameters. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to convert the collected original images to JPEG or BMP format and save them to specified memory. You can then save the converted data as image files. + This API requires no specific calling sequence. The conversion will be executed when there is any image data. You can call MV_CC_GetOneFrameTimeout() or MV_CC_RegisterImageCallBackEx() to set the callback function and get one image frame, then call this API to convert the format. + This API supports setting the nWidth/nHeight/Length parameter to UINT_MAX: MV_CC_SaveImageEx2() supports setting the max. parameter to USHRT_MAX, and JPEG format supports the max. width and height value 65500. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SaveImageEx3(IN void* handle, IN OUT MV_SAVE_IMAGE_PARAM_EX3* pstSaveParam); + +/********************************************************************//** + * @~chinese + * @brief 保存图像到文件 + * @param handle [IN] 设备句柄 + * @param pstSaveFileParam [IN][OUT] 保存图片文件参数结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 该接口支持BMP/JPEG/PNG/TIFF。\n + \li 该接口支持保存的图像长乘宽至UINT_MAX, MV_CC_SaveImageToFile() 支持长乘宽最大至USHRT_MAX。JPEG格式最大支持宽高为65500 px。 \n + \li 该接口是 MV_CC_SaveImageToFile() 接口的扩展接口。 + + * @~english + * @brief Saves image to file (extended API 1) + * @param handle [IN] It refers to the device handle. + * @param pstSaveFileParam [IN][OUT] It refers to the structure of image file saving parameters. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks It supports saving images in BMP, JPEG, PNG, and TIFF formats. + this API support the parameter nWidth/nHeight/Length to UINT_MAX. + For images in JPEG format, the supported max. width and height values are 65500. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFileEx(IN void* handle, IN OUT MV_SAVE_IMAGE_TO_FILE_PARAM_EX* pstSaveFileParam); + +/********************************************************************//** + * @~chinese + * @brief 保存图像到文件 + * @param handle [IN] 设备句柄 + * @param pstImage [IN] 图像信息 + * @param pSaveImageParam [IN] 存图参数 + * @param pcImagePath [IN] 存图路径,Windows平台长度不超过260字节,Linux平台不超过255字节 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 该接口支持4G以上超大图的PNG/TIFF存图,非超大图像支持BMP/JPEG/TIFF/PNG。 \n + \li JPEG格式最大支持宽高为65500 px。 + + * @~english + * @brief Saves image to file (extended API 2) + * @param handle [IN] It refers to the device handle. + * @param pstImage [IN] It refers to the image information. + * @param pSaveImageParam [IN] It refers to the image saving parameter. + * @param pcImagePath [IN] It refers to the image saving path. On Windows length does not exceed 260 bytes, and on Linux, it does not exceed 255 bytes. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks It supports saving images over 4 GB in PNG and TIFF formats, and images under 4 GB in BMP, JPEG, TIFF, and PNG formats. + For images in JPEG format, the supported max. width and height values are 65500. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFileEx2(IN void* handle, IN MV_CC_IMAGE* pstImage, IN MV_CC_SAVE_IMAGE_PARAM* pSaveImageParam, IN const char* pcImagePath); + +/********************************************************************//** + * @~chinese + * @brief 图像旋转 + * @param handle [IN] 设备句柄 + * @param pstRotateParam [IN][OUT] 图像旋转参数结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口只支持MONO8/RGB24/BGR24格式数据的90/180/270度旋转。 + + * @~english + * @brief Rotates images. + * @param handle [IN] It refers to the device handle. + * @param pstRotateParam [IN][OUT] It refers to image rotation parameters structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API only supports 90°, 180°, and 270° rotation of images in Mono 8, RGB 24, and BGR 24 formats. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RotateImage(IN void* handle, IN OUT MV_CC_ROTATE_IMAGE_PARAM* pstRotateParam); + +/********************************************************************//** + * @~chinese + * @brief 图像翻转 + * @param handle [IN] 设备句柄 + * @param pstFlipParam [IN][OUT] 图像翻转参数结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 该接口只支持MONO8/RGB24/BGR24格式数据的垂直和水平翻转。 + + * @~english + * @brief Flips images + * @param handle [IN] It refers to the device handle. + * @param pstFlipParam [IN][OUT] It refers to the structure of image flipping parameters. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API only support vertical and horizontal flipping of images in Mono 8, RGB 24, and BGR 24 formats. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_FlipImage(IN void* handle, IN OUT MV_CC_FLIP_IMAGE_PARAM* pstFlipParam); + +/********************************************************************//** + * @~chinese + * @brief 像素格式转换 + * @param handle [IN] 设备句柄 + * @param pstCvtParam [IN][OUT] 像素格式转换参数结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 通过该接口可以将从设备采集到的原始图像数据转换成用户所需的像素格式并存放在指定内存中。 \n + \li 该接口调用无接口顺序要求,有图像源数据就可以进行转换,可以先调用 MV_CC_GetOneFrameTimeout() 或者 MV_CC_RegisterImageCallBackEx() 设置回调函数,获取一帧图像数据,然后再通过该接口转换格式。如果设备当前采集图像是JPEG压缩的格式,则不支持调用该接口进行转换。 \n + \li 该接口支持转换的图像长乘宽至UINT_MAX。 \n + \li 像素格式转换能力的详情,如下表所示。第一列为输入像素格式,第一行为转换后的像素格式。“ √ ”代表可以转换为目标像素格式。 + | 输入格式\输出格式 | Mono8 | RGB24 | BGR24 | YUV422 | YV12 | YUV422 YUYV | + | ----------- | :-----: | :-----: | :-----: | :------: | :----: | :-----------: | + | Mono8 | × | √ | √ | √ | √ | × | + | Mono10 | √ | √ | √ | √ | √ | × | + | Mono10P | √ | √ | √ | √ | √ | × | + | Mono12 | √ | √ | √ | √ | √ | × | + | Mono12P | √ | √ | √ | √ | √ | × | + | BayerGR8 | √ | √ | √ | √ | √ | × | + | BayerRG8 | √ | √ | √ | √ | √ | × | + | BayerGB8 | √ | √ | √ | √ | √ | × | + | BayerBG8 | √ | √ | √ | √ | √ | × | + | BayerRBGG8 | × | √ | √ | × | × | × | + | BayerGR10 | √ | √ | √ | √ | √ | × | + | BayerRG10 | √ | √ | √ | √ | √ | × | + | BayerGB10 | √ | √ | √ | √ | √ | × | + | BayerBG10 | √ | √ | √ | √ | √ | × | + | BayerGR12 | √ | √ | √ | √ | √ | × | + | BayerRG12 | √ | √ | √ | √ | √ | × | + | BayerGB12 | √ | √ | √ | √ | √ | × | + | BayerBG12 | √ | √ | √ | √ | √ | × | + | BayerGR10P | √ | √ | √ | √ | √ | × | + | BayerRG10P | √ | √ | √ | √ | √ | × | + | BayerGB10P | √ | √ | √ | √ | √ | × | + | BayerBG10P | √ | √ | √ | √ | √ | × | + | BayerGR12P | √ | √ | √ | √ | √ | × | + | BayerRG12P | √ | √ | √ | √ | √ | × | + | BayerGB12P | √ | √ | √ | √ | √ | × | + | BayerBG12P | √ | √ | √ | √ | √ | × | + | RGB8P | √ | × | √ | √ | √ | × | + | BGR8P | √ | √ | × | √ | √ | × | + | YUV422P | √ | √ | √ | × | √ | × | + | YUV422 YUYV | √ | √ | √ | √ | √ | × | + + * @~english + * @brief Converts pixel format. + * @param handle [IN] It refers to the device handle. + * @param pstCvtParam [IN][OUT] It refers to the structure of pixel format conversion parameters. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to convert the collected original images to images in required pixel format and save them to specified memory. + This API requires no specific calling sequence. The conversion will be executed when there is any image data. + You can call MV_CC_GetOneFrameTimeout() or MV_CC_RegisterImageCallBackEx() to set the callback function and get one image frame, then call this API to convert the format. + If the collected image is in compressed JPEG format, it cannot be converted via this API. + this API support the parameter nWidth/nHeight/Length to UINT_MAX. + Comparing with the API MV_CC_ConvertPixelType, this API support the parameter nWidth/nHeight/Length to UINT_MAX. + + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ConvertPixelTypeEx(IN void* handle, IN OUT MV_CC_PIXEL_CONVERT_PARAM_EX* pstCvtParam); + +/********************************************************************//** + * @~chinese + * @brief 设置插值算法类型 + * @param handle [IN] 设备句柄 + * @param nBayerCvtQuality [IN] Bayer的插值方法 0-快速 1-均衡(默认为均衡) 2-最优 3-最优+ + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 设置内部图像转换接口的Bayer插值算法类型参数, MV_CC_ConvertPixelTypeEx() 、 MV_CC_GetImageForRGB() 和 MV_CC_GetImageForBGR() 接口内部使用的插值算法是该接口所设定的。 + + * @~english + * @brief Sets the interpolation method of Bayer format. + * @param handle [IN] It refers to the device handle. + * @param nBayerCvtQuality [IN] It refers to interpolation method. 0: fast; 1: equilibrated; 2: optimal (default); 3: optimal plus. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Call this API to set the Bayer interpolation algorithm type parameter for the APIs: MV_CC_ConvertPixelTypeEx() , MV_CC_GetImageForRGB() , and MV_CC_GetImageForBGR(). + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCvtQuality(IN void* handle, IN unsigned int nBayerCvtQuality); + +/********************************************************************//** + * @~chinese + * @brief 插值算法平滑使能设置 + * @param handle [IN] 设备句柄 + * @param bFilterEnable [IN] 平滑使能(默认关闭) + * @return 成功,返回#MV_OK;错误,返回错误码 + * @remarks 设置内部图像转换接口的贝尔插值平滑使能参数, MV_CC_ConvertPixelTypeEx() 、 MV_CC_SaveImageEx3() 和 MV_CC_SaveImageToFileEx() 内部使用的插值算法是该接口所设定的。 + + * @~english + * @brief Enables or disables the smoothing function of interpolation algorithm. + * @param handle [IN] It refers to the device handle. + * @param bFilterEnable [IN] Whether to enable the smoothing function of interpolation algorithm (disabled by default). + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is used to enable or disable the smoothing function of Bayer interpolation, and it determines the interpolation algorithm of the APIs: MV_CC_ConvertPixelTypeEx()、MV_CC_SaveImageToFileEx and MV_CC_SaveImageEx3(). + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBayerFilterEnable(IN void* handle, IN bool bFilterEnable); + +/********************************************************************//** + * @~chinese + * @brief 设置Bayer格式的Gamma值 + * @param handle [IN] 设备句柄 + * @param fBayerGammaValue [IN] Gamma值:0.1 ~ 4.0 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 设置该值后,在Bayer图像(Bayer8/10/12/16)转RGB/BGR图像(RGB24/48、RGBA32/64、BGR24/48、BGRA32/64)时起效。 \n 相关接口: MV_CC_ConvertPixelTypeEx() 、 MV_CC_SaveImageEx3() 、 MV_CC_SaveImageToFile() 。 + + * @~english + * @brief Sets the Gamma value in Bayer pattern. + * @param handle [IN] It refers to the device handle. + * @param fBayerGammaValue [IN] It refers to the Gamma value, range: [0.1, 4.0]. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks After setting this value, it takes effect when converting Bayer images (Bayer8/10/12/16) to RGB/BGR images (RGB24/48, RGBA32/64, BGR24/48, BGRA32/64). Related API: MV_CC_ConvertPixelTypeEx, MV_CC_SaveImageEx3, MV_CC_SaveImageToFileEx. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaValue(IN void* handle, IN float fBayerGammaValue); + +/********************************************************************//** + * @~chinese + * @brief 设置Mono8/Bayer8/10/12/16格式的Gamma值 + * @param handle [IN] 设备句柄 + * @param MvGvspPixelType enSrcPixelType [IN] 像素格式,支持Mono8, Bayer(Bayer8/10/12/16) + * @param fGammaValue [IN] Gamma值:0.1 ~ 4.0 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks \li 设置Mono8的gamma值后,在调用 MV_CC_ConvertPixelTypeEx() 将Mono8转成Mono8时gamma值起效。 \n + * \li 设置Bayer的gamma值后,在Bayer图像(Bayer8/10/12/16)转RGB/BGR图像(RGB24/48、RGBA32/64、BGR24/48、BGRA32/64)时起效。相关接口: MV_CC_ConvertPixelType() 、 MV_CC_SaveImageToFile() 、 MV_CC_SaveImageEx3() 。 + * \li 该接口兼容 MV_CC_SetBayerGammaValue() ,新增支持Mono8像素格式。 + + * @~english + * @brief Sets Gamma value of Mono 8 or Bayer 8/10/12/16 pattern. + * @param handle [IN] It refers to the device handle. + * @param MvGvspPixelType enSrcPixelType [IN] It refers to the pixel format. Supports PixelType_Gvsp_Mono8 and Bayer 8/10/12/16. + * @param fGammaValue [IN] It refers to the Gamma value, range: [0.1, 4.0]. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The Gamma value in Mono 8 pattern set via this API will be used when MV_CC_ConvertPixelType() is called to convert Mono 8 to Mono 8. + * @remarks The Gamma value in Bayer8/10/12/16 pattern set via this API will be used when calling MV_CC_ConvertPixelTypeEx() , MV_CC_SaveImageEx3() , or MV_CC_SaveImageToFileEx() to convert Bayer 8/10/12/16 format to RGB 24/48, RGBA 32/64, BGR 24/48 or BGRA 32/64. + * @remarks This API is compatible with MV_CC_SetBayerGammaValue() , and it supports Mono 8 pixel format. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetGammaValue(IN void* handle, IN enum MvGvspPixelType enSrcPixelType, IN float fGammaValue); + +/********************************************************************//** + * @~chinese + * @brief 设置Bayer格式的Gamma信息 + * @param handle [IN] 设备句柄 + * @param pstGammaParam [IN] Gamma信息 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 设置该值后,在Bayer图像(Bayer8/10/12/16)转RGB/BGR图像(RGB24/48、RGBA32/64、BGR24/48、BGRA32/64)时起效。 相关接口: MV_CC_ConvertPixelTypeEx() 、 MV_CC_SaveImageEx3() 、 MV_CC_SaveImageToFileEx() 。 + * @note 以相机实际支持情况为准。 + + * @~english + * @brief Sets the Gamma value of Bayer pattern. + * @param handle [IN] It refers to the device handle. + * @param pstGammaParam [IN] It refers to the Gamma information. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The Gamma value set by this API will be used when calling MV_CC_ConvertPixelTypeEx() , MV_CC_SaveImageEx3(), MV_CC_SaveImageToFileEx(), to convert Bayer 8/10/12/16 format to RGB24/48, BGR24/48, RGBA32/64, or BGRA32/64. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaParam(IN void* handle, IN MV_CC_GAMMA_PARAM* pstGammaParam); + +/********************************************************************//** + * @~chinese + * @brief 设置Bayer格式的CCM使能和矩阵,量化系数默认1024 + * @param handle [IN] 设备句柄 + * @param pstCCMParam [IN] CCM参数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 开启CCM并设置CCM矩阵后,在Bayer图像(Bayer8/10/12/16)转RGB/BGR图像(RGB24/48、RGBA32/64、BGR24/48、BGRA32/64)时起效。 相关接口: MV_CC_ConvertPixelTypeEx() 、 MV_CC_SaveImageEx3() 、 MV_CC_SaveImageToFileEx() 。 + + * @~english + * @brief Enables/disables CCM and sets CCM parameters in Bayer pattern. The default quantitative scale is 1024. + * @param handle [IN] It refers to the device handle. + * @param pstCCMParam [IN] It refers to the CCM parameters. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks After the API is called to enable CCM and set the CCM, the CCM parameters will take effect when MV_CC_ConvertPixelTypeEx() or MV_CC_SaveImageEx3() or MV_CC_SaveImageToFileEx() is called to convert Bayer 8/10/12/16 format to RGB 24/48, RGBA 32/64, BGR 24/48, or BGRA 32/64. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParam(IN void* handle, IN MV_CC_CCM_PARAM* pstCCMParam); + +/********************************************************************//** + * @~chinese + * @brief 设置Bayer格式的CCM使能和矩阵 + * @param handle [IN] 设备句柄 + * @param pstCCMParam [IN] CCM参数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 开启CCM并设置CCM矩阵后,在Bayer图像(Bayer8/10/12/16)转RGB/BGR图像(RGB24/48、RGBA32/64、BGR24/48、BGRA32/64)时起效。 相关接口: MV_CC_ConvertPixelTypeEx() 、 MV_CC_SaveImageEx3() 、 MV_CC_SaveImageToFileEx() 。 + + * @~english + * @brief Enables and disables CCM, and sets CCM parameters of Bayer pattern. + * @param handle [IN] It refers to the device handle. + * @param pstCCMParam [IN] It refers to the color correction parameter structure. + * @return Success, return MV_OK. Failure, return error code + * @remarks After the API is called to enable CCM and set the CCM, the CCM parameters will take effect when MV_CC_ConvertPixelTypeEx() or MV_CC_SaveImageEx3() or MV_CC_SaveImageToFileEx() is called to convert Bayer 8/10/12/16 format to RGB 24/48, RGBA 32/64, BGR 24/48, or BGRA 32/64. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParamEx(IN void* handle, IN MV_CC_CCM_PARAM_EX* pstCCMParam); + +/********************************************************************//** + * @~chinese + * @brief 图像对比度调节 + * @param handle [IN] 设备句柄 + * @param pstContrastParam [IN][OUT] 对比度调节参数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks + + * @~english + * @brief Adjusts image contrast. + * @param handle [IN] It refers to the device handle. + * @param pstContrastParam [IN][OUT] It refers to the contrast parameter structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ImageContrast(IN void* handle, IN OUT MV_CC_CONTRAST_PARAM* pstContrastParam); + +/********************************************************************//** + * @~chinese + * @brief 图像去紫边 + * @param handle [IN] 设备句柄 + * @param pstPurpleFringingParam [IN][OUT] 去紫边参数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 像素格式仅支持PixelType_Gvsp_RGB8_Packed和PixelType_Gvsp_BGR8_Packed + + * @~english + * @brief Corrects purple fringing of the image. + * @param handle [IN] It refers to the device handle. + * @param pstPurpleFringingParam [IN][OUT] It refers to purple fringing correction parameter. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API only supports processing images in PixelType_Gvsp_RGB8_Packed and PixelType_Gvsp_BGR8_Packed formats. + * ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_PurpleFringing(IN void* handle, IN MV_CC_PURPLE_FRINGING_PARAM* pstPurpleFringingParam); + +/********************************************************************//** + * @~chinese + * @brief 设置ISP参数 + * @param handle [IN] 设备句柄 + * @param pstParam [IN] ISP配置参数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Sets ISP parameters. + * @param handle [IN] It refers to the device handle. + * @param pstParam [IN][OUT] It refers to the ISP parameter structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetISPConfig(void* handle, IN MV_CC_ISP_CONFIG_PARAM* pstParam); + +/********************************************************************//** + * @~chinese + * @brief 对图像进行ISP算法处理 + * @param handle [IN] 设备句柄 + * @param pstInputImage [IN] 输入图像结构体 + * @param pstOutputImage [IN][OUT] 输出图像结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 需要先调用 MV_CC_SetISPConfig() 传入配置文件, 配置文件由ISP工具生成 + + * @~english + * @brief Processes the images with ISP algorithm. + * @param handle [IN] It refers to the device handle. + * @param pstInputImage [IN] It refers to the input image structure. + * @param pstOutputImage [IN][OUT] It refers to the output image structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Before calling this API, call MV_CC_SetISPConfig() to import configuration file generated by the ISP tool. + * ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ISPProcess(void* handle, IN MV_CC_IMAGE* pstInputImage, MV_CC_IMAGE* pstOutputImage); + +/********************************************************************//** + * @~chinese + * @brief 无损解码 + * @param handle [IN] 设备句柄 + * @param pstDecodeParam [IN][OUT] 无损解码参数结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 将从相机中取到的无损压缩码流解码成裸数据,同时支持解析当前相机实时图像的水印信息(如果输入的无损码流不是当前相机或者不是实时取流的,则水印解析可能异常); + 若解码失败,请检查以下情况: + \li CPU是否支持 SSE AVX指令集。 + \li 当前帧是否异常(丢包等),若存在,可能导致解码异常。 + \li 相机出图是否异常,即使不丢包也会异常。 + + * @~english + * @brief Decodes lossless compression stream into raw data. + * @param handle [IN] It refers to the device handle. + * @param pstDecodeParam [IN][OUT] It refers to the structure of lossless decoding parameters. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks Supports decoding the lossless compression stream of camera to raw data, and parsing the watermark of real-time images of the current camera. If the inputted lossless stream is not real-time or does not belong to the current camera, an exception may occur during watermark parsing. + If the decoding fails, check if it is one of the following circumstances: + (1) CPU does not support SSE AVX instruction set. + (2) IException occurs on the current frame (e.g., packet loss). + (3) Exception occurs on image generating from camera, even without packet loss. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_HB_Decode(IN void* handle, IN OUT MV_CC_HB_DECODE_PARAM* pstDecodeParam); + +/********************************************************************//** + * @~chinese + * @brief 开始录像 + * @param handle [IN] 设备句柄 + * @param pstRecordParam [IN] 录像参数结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @note 该接口最大支持Width×Height为8000×8000大小,最小支持96*96。若超出,会导致调用 MV_CC_InputOneFrame() 错误。 + + * @~english + * @brief Starts recording. + * @param handle [IN] It refers to the device handle. + * @param pstRecordParam [IN] It refers to the recording parameter structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The max. supported width × height is 8000*8000. The min. supported width × height is 96*96. If the value exceeds, an error will occur when calling MV_CC_InputOneFrame(). + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_StartRecord(IN void* handle, IN MV_CC_RECORD_PARAM* pstRecordParam); + +/********************************************************************//** + * @~chinese + * @brief 输入录像数据 + * @param handle [IN] 设备句柄 + * @param pstInputFrameInfo [IN] 录像数据结构体 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Inputs raw data for recording. + * @param handle [IN] It refers to the device handle. + * @param pstInputFrameInfo [IN] It refers to the record data structure. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_InputOneFrame(IN void* handle, IN MV_CC_INPUT_FRAME_INFO * pstInputFrameInfo); + +/********************************************************************//** + * @~chinese + * @brief 停止录像 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + + * @~english + * @brief Stops recording. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_StopRecord(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 重构图像(用于分时曝光功能) + * @param handle [IN] 设备句柄 + * @param pstReconstructParam [IN][OUT] 重构图像参数 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码"。 + * @remarks 图像分割功能可将多个不同曝光值所对应的图像交叠合并为1张图像。 \n + 使用时,需与线阵相机的“MultiLightControl”节点搭配。假设设置该节点为2,则相机会将2个不同曝光值所对应的两张图像交叠合并为1张图像(实际高度为2张图像的高度)发送给上层应用程序。 \n + 此时,调用该接口并传入分时曝光值nExposureNum为2,可将相机发送的1张图像分割为2张图像,并且这2张图像分别对应1个曝光值。 \n + 若使用普通相机或未打开线阵相机的“MultiLightControl”节点,且nExposureNum设置为n,则图像分割无意义,只是将图像按行分割为n张图像,每张图像的高度变为原图像的1/n。 \n + + * @~english + * @brief Reconstructs the image for multi-light control. + * @param handle [IN] It refers to the device handle. + * @param pstReconstructParam [IN][OUT] It refers to the image reconstruction parameters. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API should be used with "MultiLightControl" node of line scan camera. If the value of MultiLightControl node is 2, the camera will reconstruct 2 images with different exposure values into one image (with its height the sum of two images) and send it to the upper layer application. + If this API is called then and the value of nExposureNum is set to 2, the reconstructed image will be later divided to 2 images with two corresponding exposure values. + If line scan camera is not used or MultiLightControl node of line scan camera is disabled, and nExposureNum value is set to n, the image reconstructing function will not work. The image will be divided into n images by line, each of them with the height 1/n of the original image. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ReconstructImage(IN void* handle, IN OUT MV_RECONSTRUCT_IMAGE_PARAM* pstReconstructParam); + +/// @} + + + +/**************************Part12 ch: 支持串口通信的设备接口 | en: API for devices supporting serial communication ******************************************/ + +/// \addtogroup 串口控制相关 +/// @{ + +/********************************************************************//** + * @~chinese + * @brief 打开串口 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码" 。 + * @remarks 此接口适用于支持串口通信的相机 + + * @~english + * @brief Opens the serial port. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks This API is compatible with cameras supporting serial communication + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SerialPort_Open(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 向串口写数据,一次最大写512字节的数据 + * @param handle [IN] 设备句柄 + * @param pBuffer [IN] 数据 + * @param nLength [IN] 数据长度 + * @param pnWriteLen [OUT] 实际写成功的数据长度 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码" 。 + * @remarks 接口为阻塞模式,数据全部发送完成或者发送失败时返回 + + * @~english + * @brief Writes data to serial port, allowing a maximum of 512 bytes written at a time. + * @param handle [IN] It refers to the device handle. + * @param pBuffer [IN] It refers to the data buffer. + * @param nLength [IN] It refers to the data length. + * @param pnWriteLen [OUT] It refers to the actual written data length. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The API is in blocking mode, returning the result only when all data has been successfully transmitted or transmission fails. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SerialPort_Write(IN void* handle, IN const void *pBuffer, IN unsigned int nLength, OUT unsigned int* pnWriteLen); + +/********************************************************************//** + * @~chinese + * @brief 读串口数据 + * @param handle [IN] 设备句柄 + * @param pBuffer [IN] 数据 + * @param nLength [IN] 数据长度 + * @param pnReadLen [OUT] 实际读到的数据长度 + * @param nMsec [IN] 超时时间,单位:ms + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码" 。 + * @remarks 接口为阻塞模式,当有收到数据、到达超时时间、出现异常时,立即返回 + + * @~english + * @brief Reads the serial port data. + * @param handle [IN] It refers to the device handle. + * @param pBuffer [IN] It refers to the data buffer. + * @param nLength [IN] It refers to the data buffer length. + * @param pnReadLen [OUT] It refers to the reader data length. + * @param nMsec [IN] It refers to the timeout duration, unit: millisecond. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks The API is in blocking mode, returning the result only when data is received, timed out, or exception occurs. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SerialPort_Read(IN void* handle, IN void *pBuffer, IN unsigned int nLength, OUT unsigned int* pnReadLen, IN unsigned int nMsec); + +/********************************************************************//** + * @~chinese + * @brief 清空已接收的串口数据 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码" 。 + * @remarks + + * @~english + * @brief Clears the received serial port data. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SerialPort_ClearBuffer(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 关闭串口 + * @param handle [IN] 设备句柄 + * @return 成功,返回\ref 状态码 "MV_OK";失败,返回\ref 状态码 "状态码" 。 + * @remarks + + * @~english + * @brief Closes the serial port. + * @param handle [IN] It refers to the device handle. + * @return Returns MV_OK for success, and returns corresponding Error Code for failure. + * @remarks + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SerialPort_Close(IN void* handle); + +/// @} + +#ifdef __cplusplus +} +#endif + +#endif //_MV_CAMERA_CTRL_H_ diff --git a/third_party/hikrobot/include/MvErrorDefine.h b/third_party/hikrobot/include/MvErrorDefine.h new file mode 100644 index 0000000..ae1b00a --- /dev/null +++ b/third_party/hikrobot/include/MvErrorDefine.h @@ -0,0 +1,122 @@ + +#ifndef _MV_ERROR_DEFINE_H_ +#define _MV_ERROR_DEFINE_H_ + +#include "MvISPErrorDefine.h" + +/********************************************************************/ +/// \~chinese +/// \name 正确码定义 +/// @{ +/// \~english +/// \name Definition of correct code +/// @{ +#define MV_OK 0x00000000 ///< \~chinese 成功,无错误 \~english Successed, no error +/// @} + +/********************************************************************/ +/// \~chinese +/// \name 通用错误码定义:范围0x80000000-0x800000FF +/// @{ +/// \~english +/// \name Definition of General error code +/// @{ +#define MV_E_HANDLE 0x80000000 ///< \~chinese 错误或无效的句柄 \~english Error or invalid handle +#define MV_E_SUPPORT 0x80000001 ///< \~chinese 不支持的功能 \~english Not supported function +#define MV_E_BUFOVER 0x80000002 ///< \~chinese 缓存已满 \~english Buffer overflow +#define MV_E_CALLORDER 0x80000003 ///< \~chinese 函数调用顺序错误 \~english Function calling order error +#define MV_E_PARAMETER 0x80000004 ///< \~chinese 错误的参数 \~english Incorrect parameter +#define MV_E_RESOURCE 0x80000006 ///< \~chinese 资源申请失败 \~english Applying resource failed +#define MV_E_NODATA 0x80000007 ///< \~chinese 无数据 \~english No data +#define MV_E_PRECONDITION 0x80000008 ///< \~chinese 前置条件有误,或运行环境已发生变化 \~english Precondition error, or running environment changed +#define MV_E_VERSION 0x80000009 ///< \~chinese 版本不匹配 \~english Version mismatches +#define MV_E_NOENOUGH_BUF 0x8000000A ///< \~chinese 传入的内存空间不足 \~english Insufficient memory +#define MV_E_ABNORMAL_IMAGE 0x8000000B ///< \~chinese 异常图像,可能是丢包导致图像不完整 \~english Abnormal image, maybe incomplete image because of lost packet +#define MV_E_LOAD_LIBRARY 0x8000000C ///< \~chinese 动态导入DLL失败 \~english Load library failed +#define MV_E_NOOUTBUF 0x8000000D ///< \~chinese 没有可输出的缓存 \~english No Avaliable Buffer +#define MV_E_ENCRYPT 0x8000000E ///< \~chinese 加密错误 \~english Encryption error +#define MV_E_OPENFILE 0x8000000F ///< \~chinese 打开文件出现错误 \~english open file error +#define MV_E_BUF_IN_USE 0x80000010 ///< \~chinese 缓存地址已使用 \~english Buffer already in use +#define MV_E_BUF_INVALID 0x80000011 ///< \~chinese 无效的缓存地址 \~english Buffer address invalid +#define MV_E_NOALIGN_BUF 0x80000012 ///< \~chinese 缓存对齐异常 \~english Buffer alignmenterror error +#define MV_E_NOENOUGH_BUF_NUM 0x80000013 ///< \~chinese 缓存个数不足 \~english Insufficient cache count +#define MV_E_PORT_IN_USE 0x80000014 ///< \~chinese 串口被占用 \~english Port is in use +#define MV_E_IMAGE_DECODEC 0x80000015 ///< \~chinese 解码错误(SDK校验图像异常)\~english Decoding error (SDK verification image exception) +#define MV_E_UINT32_LIMIT 0x80000016 /// \~chinese 图像大小超过unsigned int返回,接口不支持 +#define MV_E_IMAGE_HEIGHT 0x80000017 /// \~chinese 图像高度异常(残帧丢弃) \~english image height anomaly (discard incomplete images) +#define MV_E_NOENOUGH_DDR 0x80000018 ///< \~chinese DDR缓存不足 \~english The DDR cache is Insufficient +#define MV_E_NOENOUGH_STREAM 0x80000019 ///< \~chinese 流通道不足 \~english The stream channel is Insufficient +#define MV_E_NORESPONSE 0x8000001A ///< \~chinese 设备无响应 \~english No response from device + +#define MV_E_UNKNOW 0x800000FF ///< \~chinese 未知的错误 \~english Unknown error +/// @} + +/********************************************************************/ +/// \~chinese +/// \name GenICam系列错误:范围0x80000100-0x800001FF +/// @{ +/// \~english +/// \name GenICam Series Error Codes: Range from 0x80000100 to 0x800001FF +/// @{ +#define MV_E_GC_GENERIC 0x80000100 ///< \~chinese 通用错误 \~english General error +#define MV_E_GC_ARGUMENT 0x80000101 ///< \~chinese 参数非法 \~english Illegal parameters +#define MV_E_GC_RANGE 0x80000102 ///< \~chinese 值超出范围 \~english The value is out of range +#define MV_E_GC_PROPERTY 0x80000103 ///< \~chinese 属性 \~english Property +#define MV_E_GC_RUNTIME 0x80000104 ///< \~chinese 运行环境有问题 \~english Running environment error +#define MV_E_GC_LOGICAL 0x80000105 ///< \~chinese 逻辑错误 \~english Logical error +#define MV_E_GC_ACCESS 0x80000106 ///< \~chinese 节点访问条件有误 \~english Node accessing condition error +#define MV_E_GC_TIMEOUT 0x80000107 ///< \~chinese 超时 \~english Timeout +#define MV_E_GC_DYNAMICCAST 0x80000108 ///< \~chinese 转换异常 \~english Transformation exception +#define MV_E_GC_UNKNOW 0x800001FF ///< \~chinese GenICam未知错误 \~english GenICam unknown error +/// @} + +/********************************************************************/ +/// \~chinese +/// \name GigE_STATUS对应的错误码:范围0x80000200-0x800002FF +/// @{ +/// \~english +/// \name GigE_STATUS Error Codes: Range from 0x80000200 to 0x800002FF +/// @{ +#define MV_E_NOT_IMPLEMENTED 0x80000200 ///< \~chinese 命令不被设备支持 \~english The command is not supported by device +#define MV_E_INVALID_ADDRESS 0x80000201 ///< \~chinese 访问的目标地址不存在 \~english The target address being accessed does not exist +#define MV_E_WRITE_PROTECT 0x80000202 ///< \~chinese 目标地址不可写 \~english The target address is not writable +#define MV_E_ACCESS_DENIED 0x80000203 ///< \~chinese 设备无访问权限 \~english No permission +#define MV_E_BUSY 0x80000204 ///< \~chinese 设备忙,或网络断开 \~english Device is busy, or network disconnected +#define MV_E_PACKET 0x80000205 ///< \~chinese 网络包数据错误 \~english Network data packet error +#define MV_E_NETER 0x80000206 ///< \~chinese 网络相关错误 \~english Network error +#define MV_E_SUPPORT_MODIFY_DEVICE_IP 0x8000020E ///< 在固定IP模式下不支持修改设备IP模式 \~english Current Mode Not Support Modify Ip +#define MV_E_KEY_VERIFICATION 0x8000020F ///< \~chinese 秘钥校验错误 \~english SwitchKey error +#define MV_E_IP_CONFLICT 0x80000221 ///< \~chinese 设备IP冲突 \~english Device IP conflict +/// @} + +/********************************************************************/ +/// \~chinese +/// \name USB_STATUS对应的错误码:范围0x80000300-0x800003FF +/// @{ +/// \~english +/// \name USB_STATUS Error Codes: Range from 0x80000300 to 0x800003FF +/// @{ +#define MV_E_USB_READ 0x80000300 ///< \~chinese 读usb出错 \~english Reading USB error +#define MV_E_USB_WRITE 0x80000301 ///< \~chinese 写usb出错 \~english Writing USB error +#define MV_E_USB_DEVICE 0x80000302 ///< \~chinese 设备异常 \~english Device exception +#define MV_E_USB_GENICAM 0x80000303 ///< \~chinese GenICam相关错误 \~english GenICam error +#define MV_E_USB_BANDWIDTH 0x80000304 ///< \~chinese 带宽不足 \~english Insufficient bandwidth +#define MV_E_USB_DRIVER 0x80000305 ///< \~chinese 驱动不匹配或者未装驱动 \~english Driver mismatch or unmounted drive +#define MV_E_USB_UNKNOW 0x800003FF ///< \~chinese USB未知的错误 \~english USB unknown error +/// @} + +/********************************************************************/ +/// \~chinese +/// \name 升级时对应的错误码:范围0x80000400-0x800004FF +/// @{ +/// \~english +/// \name Upgrade Error Codes: Range from 0x80000400 to 0x800004FF +/// @{ +#define MV_E_UPG_FILE_MISMATCH 0x80000400 ///< \~chinese 升级固件不匹配 \~english Firmware mismatches +#define MV_E_UPG_LANGUSGE_MISMATCH 0x80000401 ///< \~chinese 升级固件语言不匹配 \~english Firmware language mismatches +#define MV_E_UPG_CONFLICT 0x80000402 ///< \~chinese 升级冲突(设备已经在升级了再次请求升级即返回此错误) \~english Upgrading conflicted (repeated upgrading requests during device upgrade) +#define MV_E_UPG_INNER_ERR 0x80000403 ///< \~chinese 升级时设备内部出现错误 \~english Camera internal error during upgrade +#define MV_E_UPG_UNKNOW 0x800004FF ///< \~chinese 升级时未知错误 \~english Unknown error during upgrade +/// @} + +#endif //_MV_ERROR_DEFINE_H_ diff --git a/third_party/hikrobot/include/MvISPErrorDefine.h b/third_party/hikrobot/include/MvISPErrorDefine.h new file mode 100644 index 0000000..6f152a9 --- /dev/null +++ b/third_party/hikrobot/include/MvISPErrorDefine.h @@ -0,0 +1,98 @@ + +#ifndef _MV_ISP_ERROR_DEFINE_H_ +#define _MV_ISP_ERROR_DEFINE_H_ + +/************************************************************************ +* 来自ISP算法库的错误码 +************************************************************************/ +// 通用类型 +#define MV_ALG_OK 0x00000000 //处理正确 +#define MV_ALG_ERR 0x10000000 //不确定类型错误 + +// 能力检查 +#define MV_ALG_E_ABILITY_ARG 0x10000001 //能力集中存在无效参数 + +// 内存检查 +#define MV_ALG_E_MEM_NULL 0x10000002 //内存地址为空 +#define MV_ALG_E_MEM_ALIGN 0x10000003 //内存对齐不满足要求 +#define MV_ALG_E_MEM_LACK 0x10000004 //内存空间大小不够 +#define MV_ALG_E_MEM_SIZE_ALIGN 0x10000005 //内存空间大小不满足对齐要求 +#define MV_ALG_E_MEM_ADDR_ALIGN 0x10000006 //内存地址不满足对齐要求 + +// 图像检查 +#define MV_ALG_E_IMG_FORMAT 0x10000007 //图像格式不正确或者不支持 +#define MV_ALG_E_IMG_SIZE 0x10000008 //图像宽高不正确或者超出范围 +#define MV_ALG_E_IMG_STEP 0x10000009 //图像宽高与step参数不匹配 +#define MV_ALG_E_IMG_DATA_NULL 0x1000000A //图像数据存储地址为空 + +// 输入输出参数检查 +#define MV_ALG_E_CFG_TYPE 0x1000000B //设置或者获取参数类型不正确 +#define MV_ALG_E_CFG_SIZE 0x1000000C //设置或者获取参数的输入、输出结构体大小不正确 +#define MV_ALG_E_PRC_TYPE 0x1000000D //处理类型不正确 +#define MV_ALG_E_PRC_SIZE 0x1000000E //处理时输入、输出参数大小不正确 +#define MV_ALG_E_FUNC_TYPE 0x1000000F //子处理类型不正确 +#define MV_ALG_E_FUNC_SIZE 0x10000010 //子处理时输入、输出参数大小不正确 + +// 运行参数检查 +#define MV_ALG_E_PARAM_INDEX 0x10000011 //index参数不正确 +#define MV_ALG_E_PARAM_VALUE 0x10000012 //value参数不正确或者超出范围 +#define MV_ALG_E_PARAM_NUM 0x10000013 //param_num参数不正确 + +// 接口调用检查 +#define MV_ALG_E_NULL_PTR 0x10000014 //函数参数指针为空 +#define MV_ALG_E_OVER_MAX_MEM 0x10000015 //超过限定的最大内存 +#define MV_ALG_E_CALL_BACK 0x10000016 //回调函数出错 + +// 算法库加密相关检查 +#define MV_ALG_E_ENCRYPT 0x10000017 //加密错误 +#define MV_ALG_E_EXPIRE 0x10000018 //算法库使用期限错误 + +// 内部模块返回的基本错误类型 +#define MV_ALG_E_BAD_ARG 0x10000019 //参数范围不正确 +#define MV_ALG_E_DATA_SIZE 0x1000001A //数据大小不正确 +#define MV_ALG_E_STEP 0x1000001B //数据step不正确 + +// cpu指令集支持错误码 +#define MV_ALG_E_CPUID 0x1000001C //cpu不支持优化代码中的指令集 + +#define MV_ALG_WARNING 0x1000001D //警告 + +#define MV_ALG_E_TIME_OUT 0x1000001E //算法库超时 +#define MV_ALG_E_LIB_VERSION 0x1000001F //算法版本号出错 +#define MV_ALG_E_MODEL_VERSION 0x10000020 //模型版本号出错 +#define MV_ALG_E_GPU_MEM_ALLOC 0x10000021 //GPU内存分配错误 +#define MV_ALG_E_FILE_NON_EXIST 0x10000022 //文件不存在 +#define MV_ALG_E_NONE_STRING 0x10000023 //字符串为空 +#define MV_ALG_E_IMAGE_CODEC 0x10000024 //图像解码器错误 +#define MV_ALG_E_FILE_OPEN 0x10000025 //打开文件错误 +#define MV_ALG_E_FILE_READ 0x10000026 //文件读取错误 +#define MV_ALG_E_FILE_WRITE 0x10000027 //文件写错误 +#define MV_ALG_E_FILE_READ_SIZE 0x10000028 //文件读取大小错误 +#define MV_ALG_E_FILE_TYPE 0x10000029 //文件类型错误 +#define MV_ALG_E_MODEL_TYPE 0x1000002A //模型类型错误 +#define MV_ALG_E_MALLOC_MEM 0x1000002B //分配内存错误 +#define MV_ALG_E_BIND_CORE_FAILED 0x1000002C //线程绑核失败 + +// 降噪特有错误码 +#define MV_ALG_E_DENOISE_NE_IMG_FORMAT 0x10402001 //噪声特性图像格式错误 +#define MV_ALG_E_DENOISE_NE_FEATURE_TYPE 0x10402002 //噪声特性类型错误 +#define MV_ALG_E_DENOISE_NE_PROFILE_NUM 0x10402003 //噪声特性个数错误 +#define MV_ALG_E_DENOISE_NE_GAIN_NUM 0x10402004 //噪声特性增益个数错误 +#define MV_ALG_E_DENOISE_NE_GAIN_VAL 0x10402005 //噪声曲线增益值输入错误 +#define MV_ALG_E_DENOISE_NE_BIN_NUM 0x10402006 //噪声曲线柱数错误 +#define MV_ALG_E_DENOISE_NE_INIT_GAIN 0x10402007 //噪声估计初始化增益设置错误 +#define MV_ALG_E_DENOISE_NE_NOT_INIT 0x10402008 //噪声估计未初始化 +#define MV_ALG_E_DENOISE_COLOR_MODE 0x10402009 //颜色空间模式错误 +#define MV_ALG_E_DENOISE_ROI_NUM 0x1040200a //图像ROI个数错误 +#define MV_ALG_E_DENOISE_ROI_ORI_PT 0x1040200b //图像ROI原点错误 +#define MV_ALG_E_DENOISE_ROI_SIZE 0x1040200c //图像ROI大小错误 +#define MV_ALG_E_DENOISE_GAIN_NOT_EXIST 0x1040200d //输入的相机增益不存在(增益个数已达上限) +#define MV_ALG_E_DENOISE_GAIN_BEYOND_RANGE 0x1040200e //输入的相机增益不在范围内 +#define MV_ALG_E_DENOISE_NP_BUF_SIZE 0x1040200f //输入的噪声特性内存大小错误 + +// 去紫边特有错误码 +#define MV_ALG_E_PFC_ROI_PT 0x10405000 //去紫边算法ROI原点错误 +#define MV_ALG_E_PFC_ROI_SIZE 0x10405001 //去紫边算法ROI大小错误 +#define MV_ALG_E_PFC_KERNEL_SIZE 0x10405002 //去紫边算法滤波核尺寸错误 + +#endif //_MV_ISP_ERROR_DEFINE_H_ diff --git a/third_party/hikrobot/include/MvObsoleteInterfaces.h b/third_party/hikrobot/include/MvObsoleteInterfaces.h new file mode 100644 index 0000000..05759ee --- /dev/null +++ b/third_party/hikrobot/include/MvObsoleteInterfaces.h @@ -0,0 +1,2148 @@ + +#ifndef _MV_OBSOLETE_INTERFACES_H_ +#define _MV_OBSOLETE_INTERFACES_H_ + +#include "MvErrorDefine.h" +#include "CameraParams.h" +#include "ObsoleteCamParams.h" + +/** +* @brief 动态库导入导出定义 +* @brief Import and export definition of the dynamic library +*/ +#ifndef MV_CAMCTRL_API + + #if (defined (_WIN32) || defined(WIN64)) + #if defined(MV_CAMCTRL_EXPORTS) + #define MV_CAMCTRL_API __declspec(dllexport) + #else + #define MV_CAMCTRL_API __declspec(dllimport) + #endif + #else + #ifndef __stdcall + #define __stdcall + #endif + + #ifndef MV_CAMCTRL_API + #define MV_CAMCTRL_API + #endif + #endif + +#endif + +#ifndef IN + #define IN +#endif + +#ifndef OUT + #define OUT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/************************************************************************/ +/* 不建议使用的接口 */ +/* Interfaces not recommended */ +/************************************************************************/ +/************************************************************************ + * @fn MV_CC_GetImageInfo + * @brief 获取图像基本信息 + * @param handle [IN] 设备句柄 + * @param pstInfo [IN][OUT] 返回给调用者有关相机图像基本信息结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + + * @fn MV_CC_GetImageInfo + * @brief Get basic information of image + * @param handle [IN] Device handle + * @param pstInfo [IN][OUT] Structure pointer of image basic information + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetImageInfo(IN void* handle, IN OUT MV_IMAGE_BASIC_INFO* pstInfo); + +/************************************************************************ + * @fn MV_CC_GetTlProxy + * @brief 获取GenICam代理 + * @param handle [IN] 句柄地址 + * @return GenICam代理类指针 ,正常返回值非NULL;异常返回NULL + + * @fn MV_CC_GetTlProxy + * @brief Get GenICam proxy + * @param handle [IN] Handle address + * @return GenICam proxy pointer, normal, return non-NULL; exception, return NULL + ************************************************************************/ +MV_CAMCTRL_API void* __stdcall MV_CC_GetTlProxy(IN void* handle); + +/*********************************************************************** + * @fn MV_XML_GetRootNode + * @brief 获取根节点 + * @param handle [IN] 句柄 + * @param pstNode [OUT] 根节点信息结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_XML_GetRootNode + * @brief Get root node + * @param handle [IN] Handle + * @param pstNode [OUT] Root node information structure + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_XML_GetRootNode(IN void* handle, IN OUT MV_XML_NODE_FEATURE* pstNode); + +/*********************************************************************** + * @fn MV_XML_GetChildren + * @brief 从xml中获取指定节点的所有子节点,根节点为Root + * @param handle [IN] 句柄 + * @param pstNode [IN] 根节点信息结构体 + * @param pstNodesList [OUT] 节点列表结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_XML_GetChildren + * @brief Get all children node of specific node from xml, root node is Root + * @param handle [IN] Handle + * @param pstNode [IN] Root node information structure + * @param pstNodesList [OUT] Node information structure + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_XML_GetChildren(IN void* handle, IN MV_XML_NODE_FEATURE* pstNode, IN OUT MV_XML_NODES_LIST* pstNodesList); + +/*********************************************************************** + * @fn MV_XML_GetNodeFeature + * @brief 获得当前节点的属性 + * @param handle [IN] 句柄 + * @param pstNode [IN] 根节点信息结构体 + * @param pstFeature [OUT] 当前节点属性结构体, + pstFeature 具体结构体内容参考 MV_XML_FEATURE_x + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_XML_GetNodeFeature + * @brief Get current node feature + * @param handle [IN] Handle + * @param pstNode [IN] Root node information structure + * @param pstFeature [OUT] Current node feature structure + Details of pstFeature refer to MV_XML_FEATURE_x + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_XML_GetNodeFeature(IN void* handle, IN MV_XML_NODE_FEATURE* pstNode, IN OUT void* pstFeature); + +/*********************************************************************** + * @fn MV_XML_UpdateNodeFeature + * @brief 更新节点 + * @param handle [IN] 句柄 + * @param enType [IN] 节点类型 + * @param pstFeature [OUT] 当前节点属性结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_XML_UpdateNodeFeature + * @brief Update node + * @param handle [IN] Handle + * @param enType [IN] Node type + * @param pstFeature [OUT] Current node feature structure + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_XML_UpdateNodeFeature(IN void* handle, IN enum MV_XML_InterfaceType enType, IN void* pstFeature); + +// 有节点需要更新时的回调函数 +// 当调用MV_XML_UpdateNodeFeature接口更新节点属性时,注册的回调函数cbUpdate会在pstNodesList中返回与之相关联的节点 +/*********************************************************************** + * @fn MV_XML_RegisterUpdateCallBack + * @brief 注册更新回调 + * @param handle [IN] 句柄 + * @param cbUpdate [IN] 回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_XML_RegisterUpdateCallBack + * @brief Register update callback + * @param handle [IN] Handle + * @param cbUpdate [IN] Callback function pointer + * @param pUser [IN] User defined variable + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_XML_RegisterUpdateCallBack(IN void* handle, + IN void(__stdcall* cbUpdate)(enum MV_XML_InterfaceType enType, void* pstFeature, MV_XML_NODES_LIST* pstNodesList, void* pUser), + IN void* pUser); + +/************************************************************************/ +/* 弃用的接口(存在更优化的接口可替换) */ +/* Abandoned interface */ +/************************************************************************/ +/*********************************************************************** + * @fn MV_CC_GetOneFrame + * @brief 获取一帧图像,此函数为查询式获取,每次调用查询内部缓存有 + 无数据,有数据则范围数据,无数据返回错误码 + (该接口已弃用,建议改用 MV_CC_GetOneFrameTimeOut接口) + * @param handle [IN] 句柄 + * @param pData [OUT] 图像数据接收指针 + * @param nDataSize [IN] 接收缓存大小 + * @param pFrameInfo [OUT] 图像信息结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_CC_GetOneFrame + * @brief Get one frame data, this function is using query to get data, + query whether the internal cache has data, return data if there has, return error code if no data + (This interface is abandoned, it is recommended to use the MV_CC_GetOneFrameTimeOut) + * @param handle [IN] Handle + * @param pData [OUT] Recevied image data pointer + * @param nDataSize [IN] Recevied buffer size + * @param pFrameInfo [OUT] Image information structure + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetOneFrame(IN void* handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO* pFrameInfo); + +/*********************************************************************** + * @fn MV_CC_GetOneFrameEx + * @brief 获取一帧trunck数据,此函数为查询式获取,每次调用查询内部 + 缓存有无数据,有数据则范围数据,无数据返回错误码 + (该接口已弃用,建议改用 MV_CC_GetOneFrameTimeOut接口) + * @param handle [IN] 句柄 + * @param pData [IN][OUT] 图像数据接收指针 + * @param nDataSize [IN] 接收缓存大小 + * @param pFrameInfo [IN][OUT] 图像信息结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_CC_GetOneFrameEx + * @brief Get one frame of trunck data, this function is using query to get data, + query whether the internal cache has data, return data if there has, return error code if no data + (This interface is abandoned, it is recommended to use the MV_CC_GetOneFrameTimeOut) + * @param handle [IN] Handle + * @param pData [OUT] Recevied image data pointer + * @param nDataSize [IN] Recevied buffer size + * @param pFrameInfo [OUT] Image information structure + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetOneFrameEx(IN void* handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pFrameInfo); + +/*********************************************************************** + * @fn MV_CC_RegisterImageCallBack + * @brief 注册图像数据回调(该接口已弃用,建议改用 MV_CC_RegisterImageCallBackEx接口) + * @param handle [IN] 句柄 + * @param cbOutput [IN] 回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_CC_RegisterImageCallBack + * @brief Register image data callback (This interface is abandoned, it is recommended to use the MV_CC_RegisterImageCallBackEx) + * @param handle [IN] Handle + * @param cbOutput [IN] Callback function pointer + * @param pUser [IN] User defined variable + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBack(void* handle, + void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO* pFrameInfo, void* pUser), + void* pUser); + +/************************************************************************ + * @fn MV_CC_SaveImage + * @brief 保存图片(该接口仅支持Windows且已弃用,建议改用 MV_CC_SaveImageEx2接口) + * @param pSaveParam [IN][OUT] 保存图片参数结构体 + pData; // [IN] 输入数据缓存 + nDataLen; // [IN] 输入数据大小 + enPixelType; // [IN] 输入数据的像素格式 + nWidth; // [IN] 图像宽 + nHeight; // [IN] 图像高 + pImageBuffer; // [OUT] 输出图片缓存 + nImageLen; // [OUT] 输出图片大小 + nBufferSize; // [IN] 提供的输出缓冲区大小 + enImageType; // [IN] 输出图片格式 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_CC_SaveImage + * @brief Save image (This interface only supports on Windows, and is abandoned, it is recommended to use the MV_CC_SaveImageEx2) + * @param pSaveParam [IN][OUT] Save image parameters structure + pData; // [IN] Input data buffer + nDataLen; // [IN] Input data size + enPixelType; // [IN] Input data pixel format + nWidth; // [IN] Width + nHeight; // [IN] Height + pImageBuffer; // [OUT] Output image buffer + nImageLen; // [OUT] Output image size + nBufferSize; // [IN] Provided output buffer size + enImageType; // [IN] Output image type + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SaveImage(IN OUT MV_SAVE_IMAGE_PARAM* pSaveParam); + +/************************************************************************ + * @fn MV_CC_SaveImageEx + * @brief 保存图片,支持Bmp和Jpeg.编码质量在50-99之前 (该接口仅支持Windows且已弃用,建议改用 MV_CC_SaveImageEx2接口) + * @param pSaveParam [IN][OUT] 保存图片参数结构体 + pData; // [IN] 输入数据缓存 + nDataLen; // [IN] 输入数据大小 + enPixelType; // [IN] 输入数据的像素格式 + nWidth; // [IN] 图像宽 + nHeight; // [IN] 图像高 + pImageBuffer; // [OUT] 输出图片缓存 + nImageLen; // [OUT] 输出图片大小 + nBufferSize; // [IN] 提供的输出缓冲区大小 + enImageType; // [IN] 输出图片格式 + nJpgQuality; // [IN] 编码质量, (50-99] + nReserved[4]; + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_CC_SaveImageEx + * @brief Save image, support Bmp and Jpeg. Encoding quality, (50-99] + This interface only supports on Windows, and is abandoned, it is recommended to use the MV_CC_SaveImageEx2 + * @param pSaveParam [IN][OUT] Save image parameters structure + pData; // [IN] Input data buffer + nDataLen; // [IN] Input data size + enPixelType; // [IN] Pixel format of input data + nWidth; // [IN] Image width + nHeight; // [IN] Image height + pImageBuffer; // [OUT] Output image buffer + nImageLen; // [OUT] Output image size + nBufferSize; // [IN] Output buffer size provided + enImageType; // [IN] Output image format + nJpgQuality; // [IN] Encoding quality, (50-99] + nReserved[4]; + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SaveImageEx(IN OUT MV_SAVE_IMAGE_PARAM_EX* pSaveParam); + +/********************************************************************//** + * @~chinese + * @brief Bayer噪声估计(该接口已弃用,建议改用ISP Tool方式进行标定) + * @param handle [IN] 设备句柄 + * @param pstNoiseEstimateParam [IN][OUT] Bayer噪声估计参数结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 该接口只支持Bayer8/Bayer10/Bayer12格式,其它Bayer格式需先转成Bayer8/Bayer10/Bayer12格式。\n + 该接口只有在打开我司特定彩色相机后才可以正常使用,当相机被断开或者掉线后,继续使用该接口会报错。 + + * @~english + * @brief Noise estimate of Bayer format + * @param handle [IN] Device handle + * @param pstNoiseEstimateParam [IN][OUT] Noise estimate parameter structure + * @return Success, return MV_OK. Failure, return error code + * @remarks This API only support Bayer8/Bayer10/Bayer12 format, other Bayer format must Convert to Bayer8/Bayer10/Bayer12 format.\n + This API is only available when the camera is turned on, and when the camera is disconnected or disconnected, continuing to use This API will return an error. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_BayerNoiseEstimate(IN void* handle, IN OUT MV_CC_BAYER_NOISE_ESTIMATE_PARAM* pstNoiseEstimateParam); + +/********************************************************************//** + * @~chinese + * @brief Bayer空域降噪(该接口已弃用,建议改用ISP Tool方式进行降噪) + * @param handle [IN] 设备句柄 + * @param pstSpatialDenoiseParam [IN][OUT] Bayer空域降噪参数结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 该接口只支持Bayer8/Bayer10/Bayer12格式,其它Bayer格式需先转成Bayer8/Bayer10/Bayer12格式。\n + 该接口只有在打开我司特定彩色相机后才可以正常使用,当相机被断开或者掉线后,继续使用该接口会报错。 + + * @~english + * @brief Spatial Denoise of Bayer format + * @param handle [IN] Device handle + * @param pstSpatialDenoiseParam [IN][OUT] Spatial Denoise parameter structure + * @return Success, return MV_OK. Failure, return error code + * @remarks This API only support Bayer8/Bayer10/Bayer12 format, other Bayer format must Convert to Bayer8/Bayer10/Bayer12 format.\n + This API is only available when the camera is turned on, and when the camera is disconnected or disconnected, continuing to use This API will return an error. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_BayerSpatialDenoise(IN void* handle, IN OUT MV_CC_BAYER_SPATIAL_DENOISE_PARAM* pstSpatialDenoiseParam); + +/********************************************************************//** + * @~chinese + * @brief 设置Bayer格式的CLUT使能和信息(该接口已弃用,建议改用ISP Tool方式进行设置) + * @param handle [IN] 设备句柄 + * @param pstCLUTParam [IN] CLUT参数 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 开启CLUT并设置CLUT信息后,在调用MV_CC_ConvertPixelType、MV_CC_SaveImageEx2接口将Bayer8/10/12/16格式转成RGB24/48, RGBA32/64,BGR24/48,BGRA32/64时起效。 + + * @~english + * @brief Set CLUT param + * @param handle [IN] Device handle + * @param pstCLUTParam [IN] CLUT parameter structure + * @return Success, return MV_OK. Failure, return error code + * @remarks After enable the CLUT and set CLUT, It work in the calling MV_CC_ConvertPixelType\MV_CC_SaveImageEx2 API convert Bayer8/10/12/16 to RGB24/48, RGBA32/64,BGR24/48,BGRA32/64. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCLUTParam(IN void* handle, IN MV_CC_CLUT_PARAM* pstCLUTParam); + +/********************************************************************//** + * @~chinese + * @brief 图像锐化(该接口已弃用,建议改用ISP Tool方式进行锐化) + * @param handle [IN] 设备句柄 + * @param pstSharpenParam [IN] 锐化参数 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @~english + * @brief Image sharpen + * @param handle [IN] Device handle + * @param pstSharpenParam [IN] Sharpen parameter structure + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ImageSharpen(IN void* handle, IN OUT MV_CC_SHARPEN_PARAM* pstSharpenParam); + +/********************************************************************//** + * @~chinese + * @brief 色彩校正(包括CCM和CLUT)(该接口已弃用,建议改用ISP Tool方式进行校正) + * @param handle [IN] 设备句柄 + * @param pstColorCorrectParam [IN] 色彩校正参数 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 该接口支持单独CCM或者CLUT,也支持同时进行CCM和CLUT,用户可以通过CCM和CLUT信息中的使能开关进行选择。 + + * @~english + * @brief Color Correct(include CCM and CLUT) + * @param handle [IN] Device handle + * @param pstColorCorrectParam [IN] Color Correct parameter structure + * @return Success, return MV_OK. Failure, return error code + * @remarks This API supports CCM or CLUT alone, as well as CCM and CLUT at the same time. The user can select by means of the enable switch in CCM and CLUT information. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ColorCorrect(IN void* handle, IN OUT MV_CC_COLOR_CORRECT_PARAM* pstColorCorrectParam); + +/********************************************************************//** + * @~chinese + * @brief 噪声估计(该接口已弃用,建议改用ISP Tool方式进行标定) + * @param handle [IN] 设备句柄 + * @param pstNoiseEstimateParam [IN] 噪声估计参数 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 如果用户选择全图做噪声估计,nROINum可输入0,pstROIRect可置空。 + + * @~english + * @brief Noise Estimate + * @param handle [IN] Device handle + * @param pstNoiseEstimateParam [IN] Noise Estimate parameter structure + * @return Success, return MV_OK. Failure, return error code + * @remarks If the user selects the full image, nROINum can be typed with 0 and pstROIRect empty. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_NoiseEstimate(IN void* handle, IN OUT MV_CC_NOISE_ESTIMATE_PARAM* pstNoiseEstimateParam); + +/********************************************************************//** + * @~chinese + * @brief 空域降噪(该接口已弃用,建议改用ISP Tool方式进行降噪) + * @param handle [IN] 设备句柄 + * @param pstSpatialDenoiseParam [IN] 空域降噪参数 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @~english + * @brief Spatial Denoise + * @param handle [IN] Device handle + * @param pstSpatialDenoiseParam [IN] Spatial Denoise parameter structure + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SpatialDenoise(IN void* handle, IN OUT MV_CC_SPATIAL_DENOISE_PARAM* pstSpatialDenoiseParam); + + +/********************************************************************//** + * @~chinese + * @brief LSC标定 + * @param handle [IN] 设备句柄 + * @param pstLSCCalibParam [IN] 标定参数 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks + + * @~english + * @brief LSC Calib + * @param handle [IN] Device handle + * @param pstLSCCalibParam [IN] LSC Calib parameter structure + * @return Success, return MV_OK. Failure, return error code + * @remarks + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_LSCCalib(IN void* handle, IN OUT MV_CC_LSC_CALIB_PARAM* pstLSCCalibParam); + +/********************************************************************//** + * @~chinese + * @brief LSC校正 + * @param handle [IN] 设备句柄 + * @param pstLSCCorrectParam [IN] 校正参数 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @~english + * @brief LSC Correct + * @param handle [IN] Device handle + * @param pstLSCCorrectParam [IN] LSC Correct parameter structure + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_LSCCorrect(IN void* handle, IN OUT MV_CC_LSC_CORRECT_PARAM* pstLSCCorrectParam); + +/************************************************************************ + * @fn MV_GIGE_ForceIp + * @brief 强制IP(该接口已弃用,建议改用 MV_GIGE_ForceIpEx接口) + * @param handle:设备句柄 + * @param nIP [IN] 设置的IP + * @return 见返回错误码 + + * @fn MV_GIGE_ForceIp + * @brief Force IP (This interface is abandoned, it is recommended to use the MV_GIGE_ForceIpEx) + * @param handle Handle + * @param nIP [IN] IP to set + * @return Refer to error code +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_ForceIp(IN void* handle, unsigned int nIP); + +/************************************************************************ + * @fn MV_CC_RegisterEventCallBack + * @brief 注册事件回调(该接口已弃用,建议改用 MV_CC_RegisterEventCallBackEx接口),该接口只支持网口设备,不支持U口和GenTL设备 + * @param handle:设备句柄 + * @param cbEvent [IN] 事件回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 见返回错误码 + + * @fn MV_CC_RegisterEventCallBack + * @brief Register event callback (this interface has been deprecated and is recommended to be converted to the MV_CC_RegisterEventCallBackEx interface),only support GEV devices,don‘t support USB and GenTL Device. + * @param handle:设备句柄 + * @param cbEvent [IN] event callback pointer + * @param pUser [IN] User defined value + * @return 见返回错误码 +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterEventCallBack(void* handle, void(__stdcall* cbEvent)(unsigned int nExternalEventId, void* pUser), void* pUser); + +/*********************************************************************** + * @fn MV_CC_Display + * @brief 显示图像,注册显示窗口,内部自动显示(与MV_CC_GetImageBuffer不能同时使用,建议改用MV_CC_DisplayOneFrame接口) + * @param handle [IN] 句柄 + * @param hWnd [IN] 显示窗口句柄 + * @return 成功,返回MV_OK;错误,返回错误码 + + * @fn MV_CC_Display + * @brief Display one frame image, register display window, automatic display internally + * @param handle [IN] Handle + * @param hWnd [IN] Display Window Handle + * @return Success, return MV_OK. Failure, return error code + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_Display(IN void* handle, void* hWnd); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetIntValue(IN void* handle, + IN const char* strKey, + OUT MVCC_INTVALUE *pIntValue); + * @brief 获取Integer属性值(建议改用MV_CC_GetIntValueEx接口) + * @param void* handle [IN] 相机句柄 + * @param char* strKey [IN] 属性键值,如获取宽度信息则为"Width" + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机属性结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetIntValue(IN void* handle, + IN const char* strKey, + OUT MVCC_INTVALUE *pIntValue); + * @brief Get Integer value + * @param void* handle [IN] Handle + * @param char* strKey [IN] Key value, for example, using "Width" to get width + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of camera features + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetIntValue(IN void* handle,IN const char* strKey,OUT MVCC_INTVALUE *pIntValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetIntValue(IN void* handle, + IN const char* strKey, + IN unsigned int nValue); + * @brief 设置Integer型属性值(建议改用MV_CC_SetIntValueEx接口) + * @param void* handle [IN] 相机句柄 + * @param char* strKey [IN] 属性键值,如获取宽度信息则为"Width" + * const unsigned int nValue [IN] 想要设置的相机的属性值 + * @return 成功,返回MV_OK,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetIntValue(IN void* handle, + IN const char* strKey, + IN unsigned int nValue); + * @brief Set Integer value + * @param void* handle [IN] Handle + * @param char* strKey [IN] Key value, for example, using "Width" to set width + * const unsigned int nValue [IN] Feature value to set + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetIntValue(IN void* handle,IN const char* strKey,IN unsigned int nValue); + + +/************************************************************************/ +/* 相机参数获取和设置,此模块的所有接口已废弃,建议使用万能接口代替 */ +/* Get and set camara parameters, all interfaces of this module will be replaced by general interface*/ +/************************************************************************/ +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetWidth(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取图像宽度 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机宽度的信息结构体指针 + * 返回的pstValue结构体的意义 + * unsigned int nCurValue; // 代表相机当前的宽度值 + * unsigned int nMax; // 表示相机允许的最大可设置的宽度值 + * unsigned int nMin; // 表示相机允许的最小可设置的宽度值 + * unsigned int nInc; // 表示相机设置的宽度增量必须是nInc的倍数,否则无效 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + * 其他整型结构体参数的接口可参照此接口 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetWidth(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get image width + * @param void* handle [IN] Camera Handle + * MVCC_INTVALUE* pstValue [IN][OUT] Returns the information structure pointer about the camera's width for the caller + * The meaning of returns pstValue structure + * unsigned int nCurValue; // Represents the current width value of the camera + * unsigned int nMax; // Indicates the maximum settable width value allowed by the camera + * unsigned int nMin; // Indicates the minimum settable width value allowed by the camera + * unsigned int nInc; // Indicates that the width increment set by the camera must be a multiple of nInc, otherwise it is invalid + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + * Other Integer structure parameters interface can refer to this interface + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetWidth(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ +* @fn MV_CAMCTRL_API int __stdcall MV_CC_SetWidth(IN void* handle, IN const unsigned int nValue); +* @brief 设置图像宽度 +* @param void* handle [IN] 相机句柄 +* const unsigned int nValue [IN] 想要设置的相机宽度的值,注意此宽度值必须是MV_CC_GetWidth接口返回的pstValue中的nInc的倍数才能设置成功 +* @return 成功,返回MV_OK,并且相机宽度将会更改为相应值,失败,返回错误码 + +* @fn MV_CAMCTRL_API int __stdcall MV_CC_SetWidth(IN void* handle, IN const unsigned int nValue); + * @brief Set image width + * @param void* handle [IN] Camera Handle + * const unsigned int nValue [IN] To set the value of the camera width, note that the width value must be a multiple of nInc in the pstValue returned by the MV_CC_GetWidth interface + * @return Success, return MV_OK, and the camera width will change to the corresponding value. Failure, return error code +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetWidth(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetHeight(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取图像高度 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机高度的信息结构体指针 + * @return 成功,返回MV_OK,并将高度信息返回到结构体中,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetHeight(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get image height + * @param void* handle [IN] Camera handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Return pointer of information structure related to camera height to user + * @return Success, return MV_OK, and return height information to the structure. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetHeight(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetHeight(IN void* handle, IN const unsigned int nValue); + * @brief 设置图像高度 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的相机宽度的值,注意此宽度值必须是MV_CC_GetWidth接口返回的pstValue中的nInc的倍数才能设置成功 + * @return 成功,返回MV_OK,并且相机高度将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetHeight(IN void* handle, IN const unsigned int nValue); + * @brief Set image height + * @param void* handle [IN] Camera Handle + * const unsigned int nValue [IN] Camera height value to set, note that this value must be times of nInc of pstValue returned by MV_CC_GetWidth + * @return Success, return MV_OK, and the camera height will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetHeight(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAOIoffsetX(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取图像X偏移 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机X偏移的信息结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAOIoffsetX(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get image X offset + * @param void* handle [IN] Camera Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Return pointer of information structure related to camera X offset to user + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetAOIoffsetX(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAOIoffsetX(IN void* handle, IN const unsigned int nValue); + * @brief 设置图像AOI偏移 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的相机AOI的值 + * @return 成功,返回MV_OK,并且相机AOI偏移将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAOIoffsetX(IN void* handle, IN const unsigned int nValue); + * @brief Set image X offset + * @param void* handle [IN] Camera Handle + * const unsigned int nValue [IN] Camera X offset value to set + * @return Success, return MV_OK, and the camera X offset will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetAOIoffsetX(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAOIoffsetY(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取图像Y偏移 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机Y偏移的信息结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAOIoffsetY(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get image Y offset + * @param void* handle [IN] Camera Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Return pointer of information structure related to camera Y offset to user + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetAOIoffsetY(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAOIoffsetX(IN void* handle, IN const unsigned int nValue); + * @brief 设置图像AOI偏移 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的相机AOI的值 + * @return 成功,返回MV_OK,并且相机AOI偏移将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAOIoffsetY(IN void* handle, IN const unsigned int nValue); + * @brief Set image Y offset + * @param void* handle [IN] Camera Handle + * const unsigned int nValue [IN] Camera Y offset value to set + * @return Success, return MV_OK, and the camera Y offset will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetAOIoffsetY(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAutoExposureTimeLower(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取曝光下限 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机曝光值下限结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAutoExposureTimeLower(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get exposure lower limit + * @param void* handle [IN] Camera Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Return pointer of information structure related to camera exposure lower to user + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetAutoExposureTimeLower(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAutoExposureTimeLower(IN void* handle, IN const unsigned int nValue); + * @brief 设置曝光值下限 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的曝光值下限 + * @return 成功,返回MV_OK,并且相机曝光下限将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAutoExposureTimeLower(IN void* handle, IN const unsigned int nValue); + * @brief Set exposure lower limit + * @param void* handle [IN] Camera Handle + * const unsigned int nValue [IN] Exposure lower to set + * @return Success, return MV_OK, and the camera exposure time lower limit value will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetAutoExposureTimeLower(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAutoExposureTimeUpper(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取曝光上限 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机曝光值上限结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAutoExposureTimeUpper(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get exposure upper limit + * @param void* handle [IN] Camera Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Return pointer of information structure related to camera exposure upper to user + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetAutoExposureTimeUpper(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAutoExposureTimeUpper(IN void* handle, IN const unsigned int nValue); + * @brief 设置曝光值上限 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的曝光值上限 + * @return 成功,返回MV_OK,并且相机曝光上限将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAutoExposureTimeUpper(IN void* handle, IN const unsigned int nValue); + * @brief Set exposure upper limit + * @param void* handle [IN] Camera Handle + * const unsigned int nValue [IN] Exposure upper to set + * @return Success, return MV_OK, and the camera exposure time upper limit value will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetAutoExposureTimeUpper(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBrightness(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取亮度值 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机亮度结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBrightness(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get brightness + * @param void* handle [IN] Camera Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Return pointer of information structure related to camera brightness to user + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetBrightness(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBrightness(IN void* handle, IN const unsigned int nValue); + * @brief 设置亮度值 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的亮度值 + * @return 成功,返回MV_OK,并且相机亮度将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBrightness(IN void* handle, IN const unsigned int nValue); + * @brief Set brightness + * @param void* handle [IN] Camera Handle + * const unsigned int nValue [IN] Brightness upper to set + * @return Success, return MV_OK, and the camera brightness value will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBrightness(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetFrameRate(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief 获取帧率 + * @param void* handle [IN] 相机句柄 + * MVCC_FLOATVALUE* pstValue [IN][OUT] 返回给调用者有关相机帧率的信息结构体指针 + * 返回的pstValue结构体的意义 + * float fCurValue; // 表示相机当前的帧率 + * float fMax; // 表示相机允许设置的最大帧率 + * float fMin; // 表示相机允许设置的最小帧率 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + * 其他浮点型结构体参数的接口可参照此接口 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetFrameRate(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief Get Frame Rate + * @param void* handle [IN] Camera Handle + * MVCC_FLOATVALUE* pstValue [IN][OUT] Return pointer of information structure related to camera frame rate to user + * The meaning of returns pstValue structure + * float fCurValue; // Indicates the current frame rate of the camera + * float fMax; // Indicates the maximum frame rate allowed by the camera + * float fMin; // Indicates the minimum frame rate allowed by the camera + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + * Other interface of Float structure parameters can refer to this interface + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetFrameRate(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetFrameRate(IN void* handle, IN const float fValue); + * @brief 设置帧率 + * @param void* handle [IN] 相机句柄 + * const float fValue [IN] 想要设置的相机帧率 + * @return 成功,返回MV_OK,并且相机帧率将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetFrameRate(IN void* handle, IN const float fValue); + * @brief Set frame rate + * @param void* handle [IN] Camera Handle + * const float fValue [IN] Camera frame rate to set + * @return Success, return MV_OK, and camera frame rate will be changed to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetFrameRate(IN void* handle, IN const float fValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetGain(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief 获取增益 + * @param void* handle [IN] 相机句柄 + * MVCC_FLOATVALUE* pstValue [IN][OUT] 返回给调用者有关相机增益的信息结构体指针 + * 返回的pstValue结构体的意义 + * float fCurValue; // 表示相机当前的帧率 + * float fMax; // 表示相机允许设置的最大帧率 + * float fMin; // 表示相机允许设置的最小帧率 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + * 其他浮点型结构体参数的接口可参照此接口 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetGain(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief Get Gain + * @param void* handle [IN] Camera Handle + * MVCC_FLOATVALUE* pstValue [IN][OUT] Return pointer of information structure related to gain to user + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * float fCurValue; // Camera current gain + * float fMax; // The maximum gain camera allowed + * float fMin; // The minimum gain camera allowed + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + * Other interface of Float structure parameters can refer to this interface + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetGain(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetGain(IN void* handle, IN const float fValue); + * @brief 设置帧率 + * @param void* handle [IN] 相机句柄 + * const float fValue [IN] 想要设置的相机帧率 + * @return 成功,返回MV_OK,并且相机帧率将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetGain(IN void* handle, IN const float fValue); + * @brief Set Gain + * @param void* handle [IN] Camera Handle + * const float fValue [IN] Gain value to set + * @return Success, return MV_OK, and the camera gain value will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetGain(IN void* handle, IN const float fValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetExposureTime(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief 获取曝光时间 + * @param void* handle [IN] 相机句柄 + * MVCC_FLOATVALUE* pstValue [IN][OUT] 返回给调用者有关相机曝光时间的信息结构体指针 + * 返回的pstValue结构体的意义 + * float fCurValue; // 表示相机当前的帧率 + * float fMax; // 表示相机允许设置的最大帧率 + * float fMin; // 表示相机允许设置的最小帧率 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + * 其他浮点型结构体参数的接口可参照此接口 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetExposureTime(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief Get exposure time + * @param void* handle [IN] Camera Handle + * MVCC_FLOATVALUE* pstValue [IN][OUT] Return pointer of information structure related to exposure time to user + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * float fCurValue; // Camera current exposure time + * float fMax; // The maximum exposure time camera allowed + * float fMin; // The minimum exposure time camera allowed + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + * Other interface of Float structure parameters can refer to this interface + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetExposureTime(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetExposureTime(IN void* handle, IN const float fValue); + * @brief 设置曝光时间 + * @param void* handle [IN] 相机句柄 + * const float fValue [IN] 想要设置的相机帧率 + * @return 成功,返回MV_OK,并且相机帧率将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetExposureTime(IN void* handle, IN const float fValue); + * @brief Set exposure time + * @param void* handle [IN] Camera Handle + * const float fValue [IN] Exposure time to set + * @return Success, return MV_OK, and the camera exposure time value will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetExposureTime(IN void* handle, IN const float fValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetPixelFormat(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief 获取像素格式 + * @param void* handle [IN] 相机句柄 + * MVCC_ENUMVALUE* pstValue [IN][OUT] 返回给调用者的有关像素格式的信息结构体指针 + * 返回的pstValue结构体的意义 + * unsigned int nCurValue; // 相机当前的像素格式,是枚举类型,比如说PixelType_Gvsp_Mono8, 这里获得的是其整型值,具体数值参照PixelType.h的MvGvspPixelType枚举类型 + * unsigned int nSupportedNum; // 相机支持的像素格式的个数 + * unsigned int nSupportValue[MV_MAX_XML_SYMBOLIC_NUM]; // 相机所有支持的像素格式对应的整型值列表,后面要设置像素格式时,参数必须是这个数组中的一种,否则无效 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + 其他枚举类型参数接口可参照此接口,有关相应参数的枚举类型对应的整型值请查找PixelType.h 和 CameraParams.h中相应的定义 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetPixelFormat(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief Get Pixel Format + * @param void* handle [IN] Camera Handle + * MVCC_ENUMVALUE* pstValue [IN][OUT] Returns the information structure pointer about pixel format for the caller + * The meaning of returns pstValue structure + * unsigned int nCurValue; // The current pixel format of the camera, is the enumeration type, such as PixelType_Gvsp_Mono8, here is the integer value, the specific value please refer to MvGvspPixelType enumeration type in PixelType.h + * unsigned int nSupportedNum; // Number of pixel formats supported by the camera + * unsigned int nSupportValue[MV_MAX_XML_SYMBOLIC_NUM]; // The integer values list correspond to all supported pixel formats of the camera, followed by when set the pixel format, the parameter must be one of this list, otherwise invalid + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + Other interface of Enumeration structure parameters can refer to this interface, look for the corresponding definition in PixelType.h and CameraParams.h for the integer values of the enum type parameter + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetPixelFormat(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetPixelFormat(IN void* handle, IN const unsigned int nValue); + * @brief 设置像素格式 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 要设置的像素格式对应的整型值,调用此接口时可以直接填写枚举值,如MV_CC_SetPixelFormat(m_handle, PixelType_Gvsp_RGB8_Packed); + * @return 成功,返回MV_OK,并且相机像素格式将会更改为相应值,失败,返回错误码 + * + * 要设置的枚举类型必须是Get接口返回的nSupportValue[MV_MAX_XML_SYMBOLIC_NUM]中的一种,否则会失败 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetPixelFormat(IN void* handle, IN const unsigned int nValue); + * @brief Set Pixel Format + * @param void* handle [IN] Camera Handle + * const unsigned int nValue [IN] The corresponding integer value for pixel format to be set, when calling this interface can be directly filled in enumeration values, such as MV_CC_SetPixelFormat(m_handle, PixelType_Gvsp_RGB8_Packed); + * @return Success, return MV_OK, and the camera pixel format will change to the corresponding value. Failure, return error code + * + * Other interface of Enumeration structure parameters can refer to this interface, the enumeration type to be set must be one of the nSupportValue [MV_MAX_XML_SYMBOLIC_NUM] returned by the Get interface, otherwise it will fail + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetPixelFormat(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAcquisitionMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief 获取采集模式 + * @param void* handle [IN] 相机句柄 + * MVCC_ENUMVALUE* pstValue [IN][OUT] 返回给调用者的有关采集模式的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + 可参照接口MV_CC_GetPixelFormat,参考 CameraParam.h 中的 MV_CAM_ACQUISITION_MODE 定义 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAcquisitionMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief Get acquisition mode + * @param void* handle [IN] Handle + * MVCC_ENUMVALUE* pstValue [IN][OUT] Structure pointer of acquisition mode + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + Refer to MV_CC_GetPixelFormat and definition of MV_CAM_ACQUISITION_MODE in CameraParam.h + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetAcquisitionMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAcquisitionMode(IN void* handle, IN const unsigned int nValue); + * @brief 设置像素格式 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 要设置的采集模式对应的整型值 + * @return 成功,返回MV_OK,并且相机采集模式将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAcquisitionMode(IN void* handle, IN const unsigned int nValue); + * @brief Set acquisition mode + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Integer value to set corresponding to acquisition mode + * @return Success, return MV_OK, and the camera acquisition mode will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetAcquisitionMode(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetGainMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief 获取增益模式 + * @param void* handle [IN] 相机句柄 + * MVCC_ENUMVALUE* pstValue [IN][OUT] 返回给调用者的有关增益模式的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + 可参照接口MV_CC_GetPixelFormat,参考 CameraParam.h 中的 MV_CAM_GAIN_MODE 定义 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetGainMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief Get gain mode + * @param void* handle [IN] Handle + * MVCC_ENUMVALUE* pstValue [IN][OUT] Structure pointer of gain mode + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + Refer to MV_CC_GetPixelFormat and definition of MV_CAM_GAIN_MODE in CameraParam.h + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetGainMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetGainMode(IN void* handle, IN const unsigned int nValue); + * @brief 设置增益模式 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 要设置的增益模式对应的整型值 + * @return 成功,返回MV_OK,并且相机增益模式将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetGainMode(IN void* handle, IN const unsigned int nValue); + * @brief Set gain mode + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Integer value to set corresponding to gain mode + * @return Success, return MV_OK, and the camera gain mode will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetGainMode(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetExposureAutoMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief 获取自动曝光模式 + * @param void* handle [IN] 相机句柄 + * MVCC_ENUMVALUE* pstValue [IN][OUT] 返回给调用者的有关自动曝光模式的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + 可参照接口MV_CC_GetPixelFormat,参考 CameraParam.h 中的 MV_CAM_EXPOSURE_AUTO_MODE 定义 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetExposureAutoMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief Get auto exposure mode + * @param void* handle [IN] Handle + * MVCC_ENUMVALUE* pstValue [IN][OUT] Structure pointer of auto exposure mode + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + Refer to MV_CC_GetPixelFormat and definition of MV_CAM_EXPOSURE_AUTO_MODE in CameraParam.h + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetExposureAutoMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetExposureAutoMode(IN void* handle, IN const unsigned int nValue); + * @brief 设置自动曝光模式 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 要设置的自动曝光模式对应的整型值 + * @return 成功,返回MV_OK,并且相机自动曝光模式将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetExposureAutoMode(IN void* handle, IN const unsigned int nValue); + * @brief Set auto exposure mode + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Integer value to set corresponding to auto exposure mode + * @return Success, return MV_OK, and the camera auto exposure mode will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetExposureAutoMode(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief 获取触发模式 + * @param void* handle [IN] 相机句柄 + * MVCC_ENUMVALUE* pstValue [IN][OUT] 返回给调用者的有关触发模式的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + 可参照接口MV_CC_GetPixelFormat,参考 CameraParam.h 中的 MV_CAM_TRIGGER_MODE 定义 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief Get trigger mode + * @param void* handle [IN] Handle + * MVCC_ENUMVALUE* pstValue [IN][OUT] Structure pointer of trigger mode + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + Refer to MV_CC_GetPixelFormat and definition of MV_CAM_TRIGGER_MODE in CameraParam.h + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerMode(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerMode(IN void* handle, IN const unsigned int nValue); + * @brief 设置触发模式 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 要设置的触发模式对应的整型值 + * @return 成功,返回MV_OK,并且相机触发模式将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerMode(IN void* handle, IN const unsigned int nValue); + * @brief Set trigger mode + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Integer value to set corresponding to trigger mode + * @return Success, return MV_OK, and the camera trigger mode will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerMode(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerDelay(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief 获取触发延时 + * @param void* handle [IN] 相机句柄 + * MVCC_FLOATVALUE* pstValue [IN][OUT] 返回给调用者有关相机触发延时的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + * 可参照接口MV_CC_GetFrameRate + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerDelay(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief Get tigger delay + * @param void* handle [IN] Handle + * MVCC_FLOATVALUE* pstValue [IN][OUT] Structure pointer of trigger delay + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + * Refer to MV_CC_GetFrameRate + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerDelay(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerDelay(IN void* handle, IN const float fValue); + * @brief 设置触发延时 + * @param void* handle [IN] 相机句柄 + * const float fValue [IN] 想要设置的相机触发延时 + * @return 成功,返回MV_OK,并且相机触发延时将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerDelay(IN void* handle, IN const float fValue); + * @brief Set tigger delay + * @param void* handle [IN] Handle + * const float fValue [IN] Trigger delay to set + * @return Success, return MV_OK, and the camera trigger delay will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerDelay(IN void* handle, IN const float fValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerSource(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief 获取触发源 + * @param void* handle [IN] 相机句柄 + * MVCC_ENUMVALUE* pstValue [IN][OUT] 返回给调用者的有关触发源的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + 可参照接口MV_CC_GetPixelFormat,参考 CameraParam.h 中的 MV_CAM_TRIGGER_SOURCE 定义 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerSource(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief Get trigger source + * @param void* handle [IN] Handle + * MVCC_ENUMVALUE* pstValue [IN][OUT] Structure pointer of trigger source + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + Refer to MV_CC_GetPixelFormat and definition of MV_CAM_TRIGGER_SOURCE in CameraParam.h + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetTriggerSource(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerSource(IN void* handle, IN const unsigned int nValue); + * @brief 设置触发源 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 要设置的触发源对应的整型值 + * @return 成功,返回MV_OK,并且相机触发源将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerSource(IN void* handle, IN const unsigned int nValue); + * @brief Set trigger source + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Integer value to set corresponding to trigger source + * @return Success, return MV_OK, and the camera trigger source will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetTriggerSource(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_TriggerSoftwareExecute(IN void* handle); + * @brief 软触发一次(接口仅在已选择的触发源为软件触发时有效) + * @param void* handle [IN] 相机句柄 + * @return 成功,返回MV_OK, 失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_TriggerSoftwareExecute(IN void* handle); + * @brief Execute software trigger once (this interface only valid when the trigger source is set to software) + * @param void* handle [IN] Handle + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_TriggerSoftwareExecute(IN void* handle); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetGammaSelector(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief 获取Gamma类型 + * @param void* handle [IN] 相机句柄 + * MVCC_ENUMVALUE* pstValue [IN][OUT] 返回给调用者的有关Gamma类型的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + 可参照接口MV_CC_GetPixelFormat,参考 CameraParam.h 中的 MV_CAM_GAMMA_SELECTOR 定义 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetGammaSelector(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief Get Gamma mode + * @param void* handle [IN] Handle + * MVCC_ENUMVALUE* pstValue [IN][OUT] Structure pointer of gamma mode + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + Refer to MV_CC_GetPixelFormat and definition of MV_CAM_GAMMA_SELECTOR in CameraParam.h + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetGammaSelector(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetGammaSelector(IN void* handle, IN const unsigned int nValue); + * @brief 设置Gamma类型 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 要设置的Gamma类型对应的整型值 + * @return 成功,返回MV_OK,并且相机Gamma类型将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetGammaSelector(IN void* handle, IN const unsigned int nValue); + * @brief Set Gamma mode + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Integer value to set corresponding to gamma mode + * @return Success, return MV_OK, and the camera gamma mode will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetGammaSelector(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetGamma(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief 获取Gamma值 + * @param void* handle [IN] 相机句柄 + * MVCC_FLOATVALUE* pstValue [IN][OUT] 返回给调用者有关相机Gamma值的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + * 可参照接口MV_CC_GetFrameRate + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetGamma(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + * @brief Get Gamma value + * @param void* handle [IN] Handle + * MVCC_FLOATVALUE* pstValue [IN][OUT] Structure pointer of gamma value + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + * Refer to MV_CC_GetFrameRate + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetGamma(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetGamma(IN void* handle, IN const float fValue); + * @brief 设置Gamma值 + * @param void* handle [IN] 相机句柄 + * const float fValue [IN] 想要设置的相机Gamma值 + * @return 成功,返回MV_OK,并且相机Gamma值将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetGamma(IN void* handle, IN const float fValue); + * @brief Set Gamma value + * @param void* handle [IN] Handle + * const float fValue [IN] Gamma value to set + * @return Success, return MV_OK, and the camera gamma value will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetGamma(IN void* handle, IN const float fValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetSharpness(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取锐度 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机锐度结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetSharpness(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get sharpness + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of sharpness + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetSharpness(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetSharpness(IN void* handle, IN const unsigned int nValue); + * @brief 设置锐度 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的锐度 + * @return 成功,返回MV_OK,并且相机锐度将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetSharpness(IN void* handle, IN const unsigned int nValue); + * @brief Set sharpness + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Sharpness to set + * @return Success, return MV_OK, and the camera sharpness will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetSharpness(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetHue(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取灰度 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机灰度结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetHue(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get Hue + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of Hue + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetHue(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetHue(IN void* handle, IN const unsigned int nValue); + * @brief 设置灰度 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的灰度 + * @return 成功,返回MV_OK,并且相机灰度将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetHue(IN void* handle, IN const unsigned int nValue); + * @brief Set Hue + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Hue to set + * @return Success, return MV_OK, and the camera Hue will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetHue(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetSaturation(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取饱和度 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机饱和度结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetSaturation(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get Saturation + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of Saturation + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetSaturation(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetSaturation(IN void* handle, IN const unsigned int nValue); + * @brief 设置饱和度 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的饱和度 + * @return 成功,返回MV_OK,并且相机饱和度将会更改为相应值,失败,返回错误码 + +* @fn MV_CAMCTRL_API int __stdcall MV_CC_SetSaturation(IN void* handle, IN const unsigned int nValue); + * @brief Set Saturation + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Saturation to set + * @return Success, return MV_OK, and the camera Saturation will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetSaturation(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceWhiteAuto(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief 获取自动白平衡 + * @param void* handle [IN] 相机句柄 + * MVCC_ENUMVALUE* pstValue [IN][OUT] 返回给调用者的有关自动白平衡的信息结构体指针 + * @return 成功,返回MV_OK,并获得相应参数信息的结构体, 失败, 返回错误码 + * + 可参照接口MV_CC_GetPixelFormat,参考 CameraParam.h 中的 MV_CAM_BALANCEWHITE_AUTO 定义 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceWhiteAuto(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + * @brief Get Auto white balance + * @param void* handle [IN] Handle + * MVCC_ENUMVALUE* pstValue [IN][OUT] Structure pointer of auto white balance + * @return Success, return MV_OK, and get the structure of the corresponding parameters. Failure, return error code + * + Refer to MV_CC_GetPixelFormat and definition of MV_CAM_BALANCEWHITE_AUTO in CameraParam.h + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceWhiteAuto(IN void* handle, IN OUT MVCC_ENUMVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceWhiteAuto(IN void* handle, IN const unsigned int nValue); + * @brief 设置自动白平衡 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 要设置的自动白平衡对应的整型值 + * @return 成功,返回MV_OK,并且相机自动白平衡将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceWhiteAuto(IN void* handle, IN const unsigned int nValue); + * @brief Set Auto white balance + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Integer value to set corresponding to auto white balance + * @return Success, return MV_OK, and the camera auto white balance will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceWhiteAuto(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioRed(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取白平衡 红 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机白平衡 红结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioRed(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get white balance red + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of white balance red + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioRed(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioRed(IN void* handle, IN const unsigned int nValue); + * @brief 设置白平衡 红 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的白平衡 红 + * @return 成功,返回MV_OK,并且相机白平衡 红将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioRed(IN void* handle, IN const unsigned int nValue); + * @brief Set white balance red + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] White balance red to set + * @return Success, return MV_OK, and the camera white balance red will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioRed(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioGreen(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取白平衡 绿 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机白平衡 绿结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioGreen(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get white balance green + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of white balance green + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioGreen(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioGreen(IN void* handle, IN const unsigned int nValue); + * @brief 设置白平衡 绿 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的白平衡 绿 + * @return 成功,返回MV_OK,并且相机白平衡 绿将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioGreen(IN void* handle, IN const unsigned int nValue); + * @brief Set white balance green + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] White balance green to set + * @return Success, return MV_OK, and the camera white balance green will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioGreen(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioBlue(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取白平衡 蓝 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机白平衡 蓝结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioBlue(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get white balance blue + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of white balance blue + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceRatioBlue(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioBlue(IN void* handle, IN const unsigned int nValue); + * @brief 设置白平衡 蓝 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的白平衡 蓝 + * @return 成功,返回MV_OK,并且相机白平衡 蓝将会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioBlue(IN void* handle, IN const unsigned int nValue); + * @brief Set white balance blue + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] White balance blue to set + * @return Success, return MV_OK, and the camera white balance blue will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBalanceRatioBlue(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetFrameSpecInfoAbility(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取水印信息内包含的信息类型 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机水印信息内包含的信息类型结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetFrameSpecInfoAbility(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get information type included by frame stamp + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of information type included by frame stamp + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetFrameSpecInfoAbility(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetFrameSpecInfoAbility(IN void* handle, IN const unsigned int nValue); + * @brief 设置水印信息内包含的信息类型 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的水印信息内包含的信息类型 + * @return 成功,返回MV_OK,并且相机水印信息内包含的信息类型会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetFrameSpecInfoAbility(IN void* handle, IN const unsigned int nValue); + * @brief Set information type included by frame stamp + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Information type included by frame stamp to set + * @return Success, return MV_OK, and the camera information type included by frame stamp will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetFrameSpecInfoAbility(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetDeviceUserID(IN void* handle, IN OUT MVCC_STRINGVALUE* pstValue); + * @brief 获取设备自定义名字 + * @param void* handle [IN] 相机句柄 + * MVCC_STRINGVALUE* pstValue [IN OUT] 返回给调用者有关相机名字结构体指针 + * @return 成功,返回MV_OK,并且获取到相机的自定义名字,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetDeviceUserID(IN void* handle, IN OUT MVCC_STRINGVALUE* pstValue); + * @brief Get device user defined name + * @param void* handle [IN] Handle + * MVCC_STRINGVALUE* pstValue [IN OUT] Structure pointer of device name + * @return Success, return MV_OK, and get the camera user defined name. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetDeviceUserID(IN void* handle, IN OUT MVCC_STRINGVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetDeviceUserID(IN void* handle, IN const char* chValue); + * @brief 设置设备自定义名字 + * @param void* handle [IN] 相机句柄 + * IN const char* chValue [IN] 设备名字 + * @return 成功,返回MV_OK,并且设置设备自定义名字,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetDeviceUserID(IN void* handle, IN const char* chValue); + * @brief Set device user defined name + * @param void* handle [IN] Handle + * IN const char* chValue [IN] Device name + * @return Success, return MV_OK, and set the camera user defined name. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetDeviceUserID(IN void* handle, IN const char* chValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBurstFrameCount(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取一次触发的帧数 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机一次触发的帧数结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetBurstFrameCount(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get frame number trigger by once + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of frame number trigger by once + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetBurstFrameCount(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBurstFrameCount(IN void* handle, IN const unsigned int nValue); + * @brief 设置一次触发的帧数 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的一次触发的帧数 + * @return 成功,返回MV_OK,并且相机一次触发的帧数会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetBurstFrameCount(IN void* handle, IN const unsigned int nValue); + * @brief Set frame number trigger by once + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Frame number trigger by once to set + * @return Success, return MV_OK, and the camera frame number trigger by once will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetBurstFrameCount(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAcquisitionLineRate(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取行频 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机行频结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetAcquisitionLineRate(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get line rate + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of line rate + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetAcquisitionLineRate(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAcquisitionLineRate(IN void* handle, IN const unsigned int nValue); + * @brief 设置行频 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的行频 + * @return 成功,返回MV_OK,并且相机行频会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetAcquisitionLineRate(IN void* handle, IN const unsigned int nValue); + * @brief Set line rate + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Line rate to set + * @return Success, return MV_OK, and the camera line rate will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetAcquisitionLineRate(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetHeartBeatTimeout(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取心跳信息 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机心跳信息结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_GetHeartBeatTimeout(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get heartbeat information + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of heartbeat information + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetHeartBeatTimeout(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetHeartBeatTimeout(IN void* handle, IN const unsigned int nValue); + * @brief 设置心跳信息 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的心跳信息 + * @return 成功,返回MV_OK,并且相机心跳信息会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_CC_SetHeartBeatTimeout(IN void* handle, IN const unsigned int nValue); + * @brief Set heartbeat information + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Heartbeat information to set + * @return Success, return MV_OK, and the camera heartbeat information will change to the corresponding value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetHeartBeatTimeout(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCPSPacketSize(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取网络包大小 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机网络包大小结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCPSPacketSize(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get network packet size + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of network packet size + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCPSPacketSize(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCPSPacketSize(IN void* handle, IN const unsigned int nValue); + * @brief 设置网络包大小 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的网络包大小 + * @return 成功,返回MV_OK,并且相机网络包大小会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCPSPacketSize(IN void* handle, IN const unsigned int nValue); + * @brief Set network packet size + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Packet size to set + * @return Success, return MV_OK, and change packet size to setting value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCPSPacketSize(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCPD(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief 获取网络包发送间隔 + * @param void* handle [IN] 相机句柄 + * @param MVCC_INTVALUE* pstValue [IN][OUT] 返回给调用者有关相机网络包发送间隔结构体指针 + * @return 成功,返回MV_OK,失败,返回错误码 + * + * 可参照接口MV_CC_GetWidth + + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCPD(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + * @brief Get network packet sending delay + * @param void* handle [IN] Handle + * @param MVCC_INTVALUE* pstValue [IN][OUT] Structure pointer of network packet sending delay + * @return Success, return MV_OK. Failure, return error code + * + * Refer to MV_CC_GetWidth + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCPD(IN void* handle, IN OUT MVCC_INTVALUE* pstValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCPD(IN void* handle, IN const unsigned int nValue); + * @brief 设置网络包发送间隔 + * @param void* handle [IN] 相机句柄 + * const unsigned int nValue [IN] 想要设置的网络包发送间隔 + * @return 成功,返回MV_OK,并且相机网络包发送间隔会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCPD(IN void* handle, IN const unsigned int nValue); + * @brief Set network packet sending delay + * @param void* handle [IN] Handle + * const unsigned int nValue [IN] Packet delay to set + * @return Success, return MV_OK, and change packet delay to setting value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCPD(IN void* handle, IN const unsigned int nValue); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCDA(IN void* handle, unsigned int* pnIP); + * @brief 获取接收端IP地址,0xa9fe0102 表示 169.254.1.2 + * @param void* handle [IN] 相机句柄 + * @param unsigned int* pnIP [IN][OUT] 返回给调用者接收端IP地址 + * @return 成功,返回MV_OK,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCDA(IN void* handle, unsigned int* pnIP); + * @brief Get receiver IP address, 0xa9fe0102 indicates 169.254.1.2 + * @param void* handle [IN] Handle + * @param unsigned int* pnIP [IN][OUT] Receiver IP address + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCDA(IN void* handle, unsigned int* pnIP); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCDA(IN void* handle, unsigned int nIP); + * @brief 设置接收端IP地址 + * @param void* handle [IN] 相机句柄 + * unsigned int nIP [IN] 想要设置的接收端IP地址 + * @return 成功,返回MV_OK,并且相机接收端IP地址会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCDA(IN void* handle, unsigned int nIP); + * @brief Set receiver IP address + * @param void* handle [IN] Handel + * unsigned int nIP [IN] Receiver IP address to set + * @return Success, return MV_OK, and change receiver IP address to setting value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCDA(IN void* handle, unsigned int nIP); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCSP(IN void* handle, unsigned int* pnPort); + * @brief 获取发送端的端口号 + * @param void* handle [IN] 相机句柄 + * @param unsigned int* pnPort [IN][OUT] 返回给调用者发送端的端口号 + * @return 成功,返回MV_OK,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCSP(IN void* handle, unsigned int* pnPort); + * @brief Get transmitter port number + * @param void* handle [IN] Handle + * @param unsigned int* pnPort [IN][OUT] Transmitter port number + * @return Success, return MV_OK. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_GetGevSCSP(IN void* handle, unsigned int* pnPort); + +/************************************************************************ + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCSP(IN void* handle, unsigned int nPort); + * @brief 设置发送端的端口号 + * @param void* handle [IN] 相机句柄 + * unsigned int nPort [IN] 想要设置的发送端的端口号 + * @return 成功,返回MV_OK,并且相机发送端的端口号会更改为相应值,失败,返回错误码 + + * @fn MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCSP(IN void* handle, unsigned int nPort); + * @brief Set transmitter port number + * @param void* handle [IN] Handle + * unsigned int nPort [IN] Transmitter port number to set + * @return Success, return MV_OK, and change transmitter port number to setting value. Failure, return error code + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_GIGE_SetGevSCSP(IN void* handle, unsigned int nPort); + +/********************************************************************//** + * @~chinese + * @brief 设置设备波特率 + * @param handle [IN] 设备句柄 + * @param nBaudrate [IN] 设置的波特率值,数值参考CameraParams.h中宏定义,如#define MV_CAML_BAUDRATE_9600 0x00000001 + * @return 成功,返回MV_OK,失败,返回错误码 + * @remarks (该接口已弃用,建议改用 MV_CAML_SetDeviceBaudrate接口) + + * @~english + * @brief Set device baudrate using one of the CL_BAUDRATE_XXXX value + * @param handle [IN] Device handle + * @param nBaudrate [IN] baud rate to set. Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001 + * @return Success, return MV_OK. Failure, return error code + * @remarks (This interface is abandoned, it is recommended to use the MV_CAML_SetDeviceBaudrate) +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_SetDeviceBauderate(IN void* handle, unsigned int nBaudrate); + +/********************************************************************//** + * @~chinese + * @brief 获取设备波特率 + * @param handle [IN] 设备句柄 + * @param pnCurrentBaudrate [OUT] 波特率信息指针,数值参考CameraParams.h中宏定义,如#define MV_CAML_BAUDRATE_9600 0x00000001 + * @return 成功,返回MV_OK,失败,返回错误码 + * @remarks (该接口已弃用,建议改用 MV_CAML_GetDeviceBaudrate接口) + + * @~english + * @brief Returns the current device baudrate, using one of the CL_BAUDRATE_XXXX value + * @param handle [IN] Device handle + * @param pnCurrentBaudrate [OUT] Return pointer of baud rate to user. Refer to the 'CameraParams.h' for parameter definitions, for example, #define MV_CAML_BAUDRATE_9600 0x00000001 + * @return Success, return MV_OK. Failure, return error code + * @remarks (This interface is abandoned, it is recommended to use the MV_CAML_GetDeviceBaudrate) +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_GetDeviceBauderate(IN void* handle,unsigned int* pnCurrentBaudrate); + +/********************************************************************//** + * @~chinese + * @brief 获取设备与主机间连接支持的波特率 + * @param handle [IN] 设备句柄 + * @param pnBaudrateAblity [OUT] 支持的波特率信息的指针。所支持波特率的或运算结果,单个数值参考CameraParams.h中宏定义,如MV_CAML_BAUDRATE_9600 0x00000001 + * @return 成功,返回MV_OK,失败,返回错误码 + * @remarks (该接口已弃用,建议改用 MV_CAML_GetSupportBaudrates接口) + + * @~english + * @brief Returns supported baudrates of the combined device and host interface + * @param handle [IN] Device handle + * @param pnBaudrateAblity [OUT] 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, MV_CAML_BAUDRATE_9600 0x00000001 + * @return Success, return MV_OK. Failure, return error code + * @remarks (This interface is abandoned, it is recommended to use the MV_CAML_GetSupportBaudrates) +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CAML_GetSupportBauderates(IN void* handle,unsigned int* pnBaudrateAblity); + +/********************************************************************//** +* @~chinese +* @brief 注册流异常消息回调,在打开设备之后调用(只支持U3V相机,不支持GenTL设备) +* @param handle [IN] 设备句柄 +* @param cbException [IN] 异常回调函数指针 +* @param pUser [IN] 用户自定义变量 +* @return 成功,返回MV_OK,失败,返回错误码 + +* @~english +* @brief Register exception stream callBack, call after open device (only support U3V Camera, don't support GenTL Device) +* @param handle [IN] Device handle +* @param cbException [IN] Exception callback function pointer +* @param pUser [IN] User defined variable +* @return Success, return MV_OK. Failure, return error code +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_USB_RegisterStreamExceptionCallBack(IN void* handle, IN void(__stdcall* cbException)(MV_CC_STREAM_EXCEPTION_TYPE enExceptionType, void* pUser), IN void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 保存图片,支持Bmp和Jpeg. + * @param handle [IN] 设备句柄 + * @param pstSaveParam [IN][OUT] 保存图片参数结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 通过将接口可以将从设备采集到的原始图像数据转换成JPEG或者BMP等格式并存放在指定内存中,然后用户可以将转换之后的数据直接保存成图片文件。 + 该接口调用无接口顺序要求,有图像源数据就可以进行转换,可以先调用MV_CC_GetOneFrameTimeout或者MV_CC_RegisterImageCallBackEx设置回调函数,获取一帧图像数据,然后再通过该接口转换格式。 + MV_CC_SaveImageEx2比MV_CC_SaveImageEx增加参数handle,为了保证与其他接口的统一。 + + * @~english + * @brief Save image, support Bmp and Jpeg. + * @param handle [IN] Device handle + * @param pstSaveParam [IN][OUT] Save image parameters structure + * @return Success, return MV_OK. Failure, return error code + * @remarks Once there is image data, you can call this API to convert the data. + You can also call MV_CC_GetOneFrameTimeout or MV_CC_RegisterImageCallBackEx or MV_CC_GetImageBuffer to get one image frame and set the callback function, and then call this API to convert the format. + Comparing with the API MV_CC_SaveImageEx, this API added the parameter handle to ensure the unity with other API. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SaveImageEx2(IN void* handle, MV_SAVE_IMAGE_PARAM_EX* pstSaveParam); + + +/********************************************************************//** + * @~chinese + * @brief 保存图像到文件 + * @param handle [IN] 设备句柄 + * @param pstSaveFileParam [IN][OUT] 保存图片文件参数结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 该接口支持BMP/JPEG/PNG/TIFF。 + + * @~english + * @brief Save the image file. + * @param handle [IN] Device handle + * @param pstSaveFileParam [IN][OUT] Save the image file parameter structure + * @return Success, return MV_OK. Failure, return error code + * @remarks This API support BMP/JPEG/PNG/TIFF. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFile(IN void* handle, MV_SAVE_IMG_TO_FILE_PARAM* pstSaveFileParam); + + +/********************************************************************//** + * @~chinese + * @brief 像素格式转换 + * @param handle [IN] 设备句柄 + * @param pstCvtParam [IN][OUT] 像素格式转换参数结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 通过将接口可以将从设备采集到的原始图像数据转换成用户所需的像素格式并存放在指定内存中。 + 该接口调用无接口顺序要求,有图像源数据就可以进行转换,可以先调用MV_CC_GetOneFrameTimeout或者MV_CC_RegisterImageCallBackEx设置回调函数, + 获取一帧图像数据,然后再通过该接口转换格式。如果设备当前采集图像是JPEG压缩的格式,则不支持调用该接口进行转换。 + + * @~english + * @brief Pixel format conversion + * @param handle [IN] Device handle + * @param pstCvtParam [IN][OUT] Convert Pixel Type parameter structure + * @return Success, return MV_OK. Failure, return error code + * @remarks This API is used to transform the collected original data to pixel format and save to specified memory. + There is no order requirement to call this API, the transformation will execute when there is image data. + First call MV_CC_GetOneFrameTimeout or MV_CC_RegisterImageCallBackEx to set callback function, and get a frame of image data, + then call this API to transform the format. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_ConvertPixelType(IN void* handle, IN OUT MV_CC_PIXEL_CONVERT_PARAM* pstCvtParam); + +/********************************************************************//** +* @~chinese +* @brief 设置SDK日志路径 +* @param strSDKLogPath [IN] SDK日志路径 +* @return 成功,返回MV_OK;错误,返回错误码 +* @remarks 设置路径之后,可以指定路径存放日志, V2.4.1版本新增日志服务,开启服务之后该接口无效,默认日志服务为开启状态。 + +* @~english +* @brief Set SDK log path +* @param strSDKLogPath [IN] SDK log path +* @return Access, return true. Not access, return false +* @remarks For version V2.4.1, added log service, this API is invalid when the service is enabled.And The logging service is enabled by default + This API is used to set the log file storing path. +************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SetSDKLogPath(IN const char * strSDKLogPath); + +/********************************************************************//** + * @~chinese + * @brief 显示一帧图像 + * @param handle [IN] 设备句柄 + * @param pstDisplayInfo [IN] 图像信息 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 与设备类型无关,渲染模式为D3D时,支持的最大分辨率为16384 * 163840 + + * @~english + * @brief Display one frame image + * @param handle [IN] Device handle + * @param pstDisplayInfo [IN] Frame Info + * @return Success, return MV_OK. Failure, return error code + * @remarks Not related to device type,When the render mode is D3D, the maximum resolution supported is 16384 * 163840 + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_DisplayOneFrame(IN void* handle, IN MV_DISPLAY_FRAME_INFO* pstDisplayInfo); + +/********************************************************************//** + * @~chinese + * @brief 获取支持的传输层 + * @return 支持的传输层编号 + * @remarks 返回是设备的传输层,比如( MV_GIGE_DEVICE | MV_USB_DEVICE |MV_GENTL_XOF_DEVICE 等),不包含采集卡的类型 + + * @~english + * @brief Get supported Transport Layer + * @return Supported Transport Layer number + * @remarks The return is the transport layer of the device, such as (MV_GIGE-DEVICE | MV_USBDEVICE | MV_GENTL-XOF-DEVICE, etc.), excluding the type of Frame grabber + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_EnumerateTls(); + +/********************************************************************//** + * @~chinese + * @brief 创建设备句柄,不生成日志 + * @param handle [IN][OUT] 设备句柄 + * @param pstDevInfo [IN] 设备信息结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 根据输入的设备信息,创建库内部必须的资源和初始化内部模块 + 通过该接口创建句柄,调用SDK接口,不会默认生成SDK日志文件,如果需要生成日志文件可以通过MV_CC_CreateHandle创建句柄,日志文件自动生成 + + * @~english + * @brief Create Device Handle without log + * @param handle [IN][OUT] Device handle + * @param pstDevInfo [IN] Device Information Structure + * @return Success, return MV_OK. Failure, return error code + * @remarks Create required resources within library and initialize internal module according to input device information. + Create handle and call SDK interface through this interface, and SDK log file will not be created. To create logs, + create handle through MV_CC_CreateHandle, and log files will be automatically generated. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_CreateHandleWithoutLog(IN OUT void ** handle, IN const MV_CC_DEVICE_INFO* pstDevInfo); + +/********************************************************************//** + * @~chinese + * @brief 注册图像数据回调,RGB + * @param handle [IN] 设备句柄 + * @param cbOutput [IN] 回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用。图像数据采集有两种方式,两种方式不能复用: + 方式一:调用MV_CC_RegisterImageCallBackForRGB设置RGB24格式图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回。 + 方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetImageForRGB获取RGB24格式的帧数据, + 获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 + 该接口不支持MV_CAMERALINK_DEVICE 类型的设备。 + + * @~english + * @brief register image data callback, RGB + * @param handle [IN] Device handle + * @param cbOutput [IN] Callback function pointer + * @param pUser [IN] User defined variable + * @return Success, return MV_OK. Failure, return error code + * @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle.There are two image acquisition modes, the two modes cannot be reused: + Mode 1: Call MV_CC_RegisterImageCallBackForRGB to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function. + Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForRGB repeatedly in application layer to get frame data with RGB24 format. + When getting frame data, the upper application program should control the frequency of calling this API according to frame rate. + This interface does not support devices of type MV_CAMERALINK_DEVICE + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackForRGB(IN void* handle, + IN void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser), IN void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 注册图像数据回调,BGR + * @param handle [IN] 设备句柄 + * @param cbOutput [IN] 回调函数指针 + * @param pUser [IN] 用户自定义变量 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 通过该接口可以设置图像数据回调函数,在MV_CC_CreateHandle之后即可调用。图像数据采集有两种方式,两种方式不能复用: + 方式一:调用MV_CC_RegisterImageCallBackForBGR设置BGR24图像数据回调函数,然后调用MV_CC_StartGrabbing开始采集,采集的图像数据在设置的回调函数中返回。 + 方式二:调用MV_CC_StartGrabbing开始采集,然后在应用层循环调用MV_CC_GetImageForBGR获取BGR24格式的帧数据, + 获取帧数据时上层应用程序需要根据帧率控制好调用该接口的频率。 + 该接口不支持MV_CAMERALINK_DEVICE 类型的设备。 + + * @~english + * @brief register image data callback, BGR + * @param handle [IN] Device handle + * @param cbOutput [IN] Callback function pointer + * @param pUser [IN] User defined variable + * @return Success, return MV_OK. Failure, return error code + * @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle.There are two image acquisition modes, the two modes cannot be reused: + Mode 1: Call MV_CC_RegisterImageCallBackForBGR to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function. + Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForBGR repeatedly in application layer to get frame data with BGR24 format. + When getting frame data,the upper application program should control the frequency of calling this API according to frame rate. + This interface does not support devices of type MV_CAMERALINK_DEVICE + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_RegisterImageCallBackForBGR(IN void* handle, + IN void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser), IN void* pUser); + +/********************************************************************//** + * @~chinese + * @brief 获取一帧RGB数据,此函数为查询式获取,每次调用查询内部 + 缓存有无数据,有数据则获取数据,无数据返回错误码 + * @param handle [IN] 设备句柄 + * @param pData [IN][OUT] 图像数据接收指针 + * @param nDataSize [IN] 接收缓存大小 + * @param pstFrameInfo [IN][OUT] 图像信息结构体 + * @param nMsec [IN] 等待超时时间 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 每次调用该接口,将查询内部缓存是否有数据,如果有数据则转换成RGB24格式返回,如果没有数据则返回错误码。 + 因为图像转换成RGB24格式有耗时,所以当数据帧率过高时该接口可能会导致丢帧。调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。 + 该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。 + 该接口不支持MV_CAMERALINK_DEVICE设备。 + + * @~english + * @brief Get one frame of RGB data, 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 + * @param handle [IN] Device handle + * @param pData [IN][OUT] Image data receiving buffer + * @param nDataSize [IN] Buffer size + * @param pstFrameInfo [IN][OUT] Image information structure + * @param nMsec [IN] Waiting timeout + * @return Success, return MV_OK. Failure, return error code + * @remarks Each time the API is called, the internal cache is checked for data. If there is data, it will be transformed as RGB24 format for return, if there is no data, return error code. + As time-consuming exists when transform the image to RGB24 format,this API may cause frame loss when the data frame rate is too high. + Before calling this API to get image data frame, call MV_CC_StartGrabbing to start image acquisition. + This API can get frame data actively, the upper layer program should control the frequency of calling this API according to the frame rate. + This API is not supported by MV_CAMERALINK_DEVICE device. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetImageForRGB(IN void* handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, IN int nMsec); + +/********************************************************************//** + * @~chinese + * @brief 获取一帧BGR数据,此函数为查询式获取,每次调用查询内部 + 缓存有无数据,有数据则获取数据,无数据返回错误码 + * @param handle [IN] 设备句柄 + * @param pData [IN][OUT] 图像数据接收指针 + * @param nDataSize [IN] 接收缓存大小 + * @param pstFrameInfo [IN][OUT] 图像信息结构体 + * @param nMsec [IN] 等待超时时间 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 每次调用该接口,将查询内部缓存是否有数据,如果有数据则转换成BGR24格式返回,如果没有数据则返回错误码。 + 因为图像转换成BGR24格式有耗时,所以当数据帧率过高时该接口可能会导致丢帧.调用该接口获取图像数据帧之前需要先调用MV_CC_StartGrabbing启动图像采集。 + 该接口为主动式获取帧数据,上层应用程序需要根据帧率,控制好调用该接口的频率。 + 该接口不支持CameraLink设备。 + + * @~english + * @brief Get one frame of BGR data, 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 + * @param handle [IN] Device handle + * @param pData [IN][OUT] Image data receiving buffer + * @param nDataSize [IN] Buffer size + * @param pstFrameInfo [IN][OUT] Image information structure + * @param nMsec [IN] Waiting timeout + * @return Success, return MV_OK. Failure, return error code + * @remarks Before calling this API to set image data callback function, you should call this API MV_CC_CreateHandle. + There are two image acquisition modes, the two modes cannot be reused: + Mode 1: Call MV_CC_RegisterImageCallBackForBGR to set RGB24 format image data callback function, and then call MV_CC_StartGrabbing to start acquisition, the collected image data will be returned in the configured callback function. + Mode 2: Call MV_CC_StartGrabbing to start acquisition, and the call MV_CC_GetImageForBGR repeatedly in application layer to get frame data with BGR24 format. + When getting frame data, the upper application program should control the frequency of calling this API according to frame rate. + This API is not supported by CameraLink device. + ***********************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_GetImageForBGR(IN void* handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pstFrameInfo, IN int nMsec); + +/********************************************************************//** + * @~chinese + * @brief 打开获取或设置相机参数的GUI界面 + * @param handle [IN] 设备句柄 + * @return 成功,返回MV_OK,失败,返回错误码。 + * @remarks 通过MV_CC_OpenDevice连接设备后,可以通过该接口获取或设置设备参数。 + * @remarks 限制:在同一线程中多相机同时调用该接口,只能打开当前一个GUI界面,需要关闭当前相机GUI界面后,才可打开另一个相机的GUI界面(后续版本优化) + 该接口仅支持windows平台 + + * @~english + * @brief Open the GUI interface for getting or setting camera parameters + * @param handle [IN] Device handle + * @return Success, return MV_OK, Failure, return error code. + * @remarks After connecting to device through MV_CC_OpenDevice, use this interface to get or set device params. + * @remarks Limit: calling this interface multiple times in the same thread can only open one GUI interface. + You need to wait until the previous GUI interface is closed before opening the next GUI interface.(Subsequent version optimization) + This interface only supports windows platform. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_OpenParamsGUI(IN void* handle); + +/********************************************************************//** + * @~chinese + * @brief 保存3D点云数据,支持PLY、CSV和OBJ三种格式 + * @param handle [IN] 设备句柄 + * @param pstPointDataParam [IN][OUT] 保存点云数据参数结构体 + * @return 成功,返回MV_OK;错误,返回错误码 + * @remarks 3D数据格式保存成3D文件格式,支持PLY/CSV/OBJ, + 目前支持PixelType_Gvsp_Coord3D_ABC32、PixelType_Gvsp_Coord3D_ABC32f、PixelType_Gvsp_Coord3D_AB32、PixelType_Gvsp_Coord3D_AB32f、PixelType_Gvsp_Coord3D_AC32、PixelType_Gvsp_Coord3D_AC32f, + 暂不支持其他3D格式。 + + * @~english + * @brief Save 3D point data, support PLY、CSV and OBJ + * @param handle [IN] Device handle + * @param pstPointDataParam [IN][OUT] Save 3D point data parameters structure + * @return Success, return MV_OK. Failure, return error code + * @remarks Save the 3D data format to 3D file format,support PLY、CSV and OBJ, + only support PixelType_Gvsp_Coord3D_ABC32、PixelType_Gvsp_Coord3D_ABC32f、PixelType_Gvsp_Coord3D_AB32、PixelType_Gvsp_Coord3D_AB32f、PixelType_Gvsp_Coord3D_AC32、PixelType_Gvsp_Coord3D_AC32f + Other 3D format is not supported now. + ************************************************************************/ +MV_CAMCTRL_API int __stdcall MV_CC_SavePointCloudData(IN void* handle, IN OUT MV_SAVE_POINT_CLOUD_PARAM* pstPointDataParam); + + +#ifdef __cplusplus +} +#endif + +#endif //_MV_OBSOLETE_INTERFACES_H_ diff --git a/third_party/hikrobot/include/ObsoleteCamParams.h b/third_party/hikrobot/include/ObsoleteCamParams.h new file mode 100644 index 0000000..5d5fade --- /dev/null +++ b/third_party/hikrobot/include/ObsoleteCamParams.h @@ -0,0 +1,655 @@ + +#ifndef _MV_OBSOLETE_CAM_PARAMS_H_ +#define _MV_OBSOLETE_CAM_PARAMS_H_ + +#include "PixelType.h" + +/// \~chinese 输出帧的信息 \~english Output Frame Information +typedef struct _MV_FRAME_OUT_INFO_ +{ + unsigned short nWidth; ///< [OUT] \~chinese 图像宽 \~english Image Width + unsigned short nHeight; ///< [OUT] \~chinese 图像高 \~english Image Height + enum MvGvspPixelType enPixelType; ///< [OUT] \~chinese 像素格式 \~english Pixel Type + + unsigned int nFrameNum; ///< [OUT] \~chinese 帧号 \~english Frame Number + unsigned int nDevTimeStampHigh; ///< [OUT] \~chinese 时间戳高32位 \~english Timestamp high 32 bits + unsigned int nDevTimeStampLow; ///< [OUT] \~chinese 时间戳低32位 \~english Timestamp low 32 bits + unsigned int nReserved0; ///< [OUT] \~chinese 保留,8字节对齐 \~english Reserved, 8-byte aligned + int64_t nHostTimeStamp; ///< [OUT] \~chinese 主机生成的时间戳 \~english Host-generated timestamp + + unsigned int nFrameLen; + + unsigned int nLostPacket; // 本帧丢包数 + unsigned int nReserved[2]; +}MV_FRAME_OUT_INFO; + +/// \~chinese 保存图片参数 \~english Save image type +typedef struct _MV_SAVE_IMAGE_PARAM_T_ +{ + unsigned char* pData; ///< [IN] \~chinese 输入数据缓存 \~english Input Data Buffer + unsigned int nDataLen; ///< [IN] \~chinese 输入数据大小 \~english Input Data Size + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 输入像素格式 \~english Input Data Pixel Format + unsigned short nWidth; ///< [IN] \~chinese 图像宽 \~english Image Width + unsigned short nHeight; ///< [IN] \~chinese 图像高 \~english Image Height + + unsigned char* pImageBuffer; ///< [OUT] \~chinese 输出图片缓存 \~english Output Image Buffer + unsigned int nImageLen; ///< [OUT] \~chinese 输出图片大小 \~english Output Image Size + unsigned int nBufferSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Output buffer size provided + enum MV_SAVE_IAMGE_TYPE enImageType; ///< [IN] \~chinese 输出图片格式 \~english Output Image Format + +}MV_SAVE_IMAGE_PARAM; + +typedef struct _MV_IMAGE_BASIC_INFO_ +{ + unsigned short nWidthValue; + unsigned short nWidthMin; + unsigned int nWidthMax; + unsigned int nWidthInc; + + unsigned int nHeightValue; + unsigned int nHeightMin; + unsigned int nHeightMax; + unsigned int nHeightInc; + + float fFrameRateValue; + float fFrameRateMin; + float fFrameRateMax; + + unsigned int enPixelType; ///< [OUT] \~chinese 当前的像素格式 \~english Current pixel format + unsigned int nSupportedPixelFmtNum; ///< [OUT] \~chinese 支持的像素格式种类 \~english Support pixel format + unsigned int enPixelList[MV_MAX_XML_SYMBOLIC_NUM]; + unsigned int nReserved[8]; + +}MV_IMAGE_BASIC_INFO; + + +/// \~chinese 噪声特性类型 \~english Noise feature type +typedef enum _MV_CC_BAYER_NOISE_FEATURE_TYPE +{ + MV_CC_BAYER_NOISE_FEATURE_TYPE_INVALID = 0, ///< \~chinese 无效值 \~english Invalid + MV_CC_BAYER_NOISE_FEATURE_TYPE_PROFILE = 1, ///< \~chinese 噪声曲线 \~english Noise curve + MV_CC_BAYER_NOISE_FEATURE_TYPE_LEVEL = 2, ///< \~chinese 噪声水平 \~english Noise level + MV_CC_BAYER_NOISE_FEATURE_TYPE_DEFAULT = 1, ///< \~chinese 默认值 \~english Default + +}MV_CC_BAYER_NOISE_FEATURE_TYPE; + +/// \~chinese Bayer格式降噪特性信息 \~english Denoise profile info +typedef struct _MV_CC_BAYER_NOISE_PROFILE_INFO_T_ +{ + unsigned int nVersion; ///< \~chinese 版本 \~english version + MV_CC_BAYER_NOISE_FEATURE_TYPE enNoiseFeatureType; ///< \~chinese 噪声特性类型 \~english noise feature type + enum MvGvspPixelType enPixelType; ///< \~chinese 图像格式 \~english image format + int nNoiseLevel; ///< \~chinese 平均噪声水平 \~english noise level + unsigned int nCurvePointNum; ///< \~chinese 曲线点数 \~english curve point number + int* nNoiseCurve; ///< \~chinese 噪声曲线 \~english noise curve + int* nLumCurve; ///< \~chinese 亮度曲线 \~english luminance curve + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_BAYER_NOISE_PROFILE_INFO; + +/// \~chinese Bayer格式噪声估计参数 \~english Bayer noise estimate param +typedef struct _MV_CC_BAYER_NOISE_ESTIMATE_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽(大于等于8) \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高(大于等于8) \~english Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + + unsigned char* pSrcData; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入数据大小 \~english Input data size + + unsigned int nNoiseThreshold; ///< [IN] \~chinese 噪声阈值(0-4095) \~english Noise Threshold + + unsigned char* pCurveBuf; ///< [IN] \~chinese 用于存储噪声曲线和亮度曲线(需要外部分配,缓存大小:4096 * sizeof(int) * 2) \~english Buffer used to store noise and brightness curves, size:4096 * sizeof(int) * 2) + MV_CC_BAYER_NOISE_PROFILE_INFO stNoiseProfile; ///< [OUT] \~chinese 降噪特性信息 \~english Denoise profile + + unsigned int nThreadNum; ///< [IN] \~chinese 线程数量,0表示算法库根据硬件自适应;1表示单线程(默认);大于1表示线程数目 \~english Thread number, 0 means that the library is adaptive to the hardware, 1 means single thread(Default value), Greater than 1 indicates the number of threads + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_BAYER_NOISE_ESTIMATE_PARAM; + +/// \~chinese Bayer格式空域降噪参数 \~english Bayer spatial Denoise param +typedef struct _MV_CC_BAYER_SPATIAL_DENOISE_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽(大于等于8) \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高(大于等于8) \~english Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + + unsigned char* pSrcData; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入数据大小 \~english Input data size + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出降噪后的数据 \~english Output data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出降噪后的数据长度 \~english Output data length + + MV_CC_BAYER_NOISE_PROFILE_INFO stNoiseProfile; ///< [IN] \~chinese 降噪特性信息(来源于噪声估计) \~english Denoise profile + unsigned int nDenoiseStrength; ///< [IN] \~chinese 降噪强度(0-100) \~english nDenoise Strength + unsigned int nSharpenStrength; ///< [IN] \~chinese 锐化强度(0-32) \~english Sharpen Strength + unsigned int nNoiseCorrect; ///< [IN] \~chinese 噪声校正系数(0-1280) \~english Noise Correct + + unsigned int nThreadNum; ///< [IN] \~chinese 线程数量,0表示算法库根据硬件自适应;1表示单线程(默认);大于1表示线程数目 \~english Thread number, 0 means that the library is adaptive to the hardware, 1 means single thread(Default value), Greater than 1 indicates the number of threads + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_BAYER_SPATIAL_DENOISE_PARAM; + +/// \~chinese CLUT参数 \~english CLUT param +typedef struct _MV_CC_CLUT_PARAM_T_ +{ + bool bCLUTEnable; ///< [IN] \~chinese 是否启用CLUT \~english CLUT enable + unsigned int nCLUTScale; ///< [IN] \~chinese 量化系数(2的整数幂,最大65536) \~english Quantitative scale(Integer power of 2, <= 65536) + unsigned int nCLUTSize; ///< [IN] \~chinese CLUT大小,目前仅支持17 \~english CLUT size, currently only supports 17 + unsigned char* pCLUTBuf; ///< [IN] \~chinese 量化CLUT表 \~english CLUT buffer + unsigned int nCLUTBufLen; ///< [IN] \~chinese 量化CLUT缓存大小(nCLUTSize*nCLUTSize*nCLUTSize*sizeof(int)*3) \~english CLUT buffer length(nCLUTSize*nCLUTSize*nCLUTSize*sizeof(int)*3) + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_CLUT_PARAM; + +/// \~chinese 锐化结构体 \~english Sharpen structure +typedef struct _MV_CC_SHARPEN_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽度(最小8) \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高度(最小8) \~english Image Height + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcBufLen; ///< [IN] \~chinese 输入数据大小 \~english Input data length + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + + unsigned int nSharpenAmount; ///< [IN] \~chinese 锐度调节强度,[0,500] \~english Sharpen amount,[0,500] // [nSharpenAmount 作废, 使用 nSharpenPosAmount & nSharpenNegAmount 替代 ] + unsigned int nSharpenRadius; ///< [IN] \~chinese 锐度调节半径(半径越大,耗时越长),[1,21] \~english Sharpen radius(The larger the radius, the longer it takes),[1,21] + unsigned int nSharpenThreshold; ///< [IN] \~chinese 锐度调节阈值,[0,255] \~english Sharpen threshold,[0,255] + + + unsigned int nSharpenPosAmount; // [IN] 锐度调节正向强度,范围:[0, 500] + unsigned int nSharpenNegAmount; // [IN] 锐度调节负向强度,范围:[0, 500] + + unsigned int nRes[6]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_SHARPEN_PARAM; + +/// \~chinese 色彩校正结构体 \~english Color correct structure +typedef struct _MV_CC_COLOR_CORRECT_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽度 \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高度 \~english Image Height + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcBufLen; ///< [IN] \~chinese 输入数据大小 \~english Input data length + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + + unsigned int nImageBit; ///< [IN] \~chinese 有效图像位数(8,10,12,16) \~english Image bit(8 or 10 or 12 or 16) + MV_CC_GAMMA_PARAM stGammaParam; ///< [IN] \~chinese Gamma信息 \~english Gamma info + MV_CC_CCM_PARAM_EX stCCMParam; ///< [IN] \~chinese CCM信息 \~english CCM info + MV_CC_CLUT_PARAM stCLUTParam; ///< [IN] \~chinese CLUT信息 \~english CLUT info + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_COLOR_CORRECT_PARAM; + +/// \~chinese 矩形ROI结构体 \~english Rect ROI structure +typedef struct _MV_CC_RECT_I_ +{ + unsigned int nX; ///< \~chinese 矩形左上角X轴坐标 \~english X Position + unsigned int nY; ///< \~chinese 矩形左上角Y轴坐标 \~english Y Position + unsigned int nWidth; ///< \~chinese 矩形宽度 \~english Rect Width + unsigned int nHeight; ///< \~chinese 矩形高度 \~english Rect Height + +}MV_CC_RECT_I; + +/// \~chinese 噪声估计结构体 \~english Noise estimate structure +typedef struct _MV_CC_NOISE_ESTIMATE_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽度(最小8) \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高度(最小8) \~english Image Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcBufLen; ///< [IN] \~chinese 输入数据大小 \~english Input data length + + MV_CC_RECT_I* pstROIRect; ///< [IN] \~chinese 图像ROI \~english Image ROI + unsigned int nROINum; ///< [IN] \~chinese ROI个数 \~english ROI number + + ///< \~chinese Bayer域噪声估计参数,Mono8/RGB域无效 \~english Bayer Noise estimate param,Mono8/RGB formats are invalid + unsigned int nNoiseThreshold; ///< [IN] \~chinese 噪声阈值[0,4095] \~english Noise threshold[0,4095] + ///< \~chinese 建议值:8bit,0xE0;10bit,0x380;12bit,0xE00 \~english Suggestive value:8bit,0xE0;10bit,0x380;12bit,0xE00 + + unsigned char* pNoiseProfile; ///< [OUT] \~chinese 输出噪声特性 \~english Output Noise Profile + unsigned int nNoiseProfileSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nNoiseProfileLen; ///< [OUT] \~chinese 输出噪声特性长度 \~english Output Noise Profile length + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_NOISE_ESTIMATE_PARAM; + +/// \~chinese 空域降噪结构体 \~english Spatial denoise structure +typedef struct _MV_CC_SPATIAL_DENOISE_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽度(最小8) \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高度(最小8) \~english Image Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcBufLen; ///< [IN] \~chinese 输入数据大小 \~english Input data length + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出降噪后的数据 \~english Output data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出降噪后的数据长度 \~english Output data length + + unsigned char* pNoiseProfile; ///< [IN] \~chinese 输入噪声特性 \~english Input Noise Profile + unsigned int nNoiseProfileLen; ///< [IN] \~chinese 输入噪声特性长度 \~english Input Noise Profile length + + ///< \~chinese Bayer域空域降噪参数,Mono8/RGB域无效 \~english Bayer Spatial denoise param,Mono8/RGB formats are invalid + unsigned int nBayerDenoiseStrength; ///< [IN] \~chinese 降噪强度[0,100] \~english Denoise Strength[0,100] + unsigned int nBayerSharpenStrength; ///< [IN] \~chinese 锐化强度[0,32] \~english Sharpen Strength[0,32] + unsigned int nBayerNoiseCorrect; ///< [IN] \~chinese 噪声校正系数[0,1280] \~english Noise Correct[0,1280] + + ///< \~chinese Mono8/RGB域空域降噪参数,Bayer域无效 \~english Mono8/RGB Spatial denoise param,Bayer formats are invalid + unsigned int nNoiseCorrectLum; ///< [IN] \~chinese 亮度校正系数[1,2000] \~english Noise Correct Lum[1,2000] + unsigned int nNoiseCorrectChrom; ///< [IN] \~chinese 色调校正系数[1,2000] \~english Noise Correct Chrom[1,2000] + unsigned int nStrengthLum; ///< [IN] \~chinese 亮度降噪强度[0,100] \~english Strength Lum[0,100] + unsigned int nStrengthChrom; ///< [IN] \~chinese 色调降噪强度[0,100] \~english Strength Chrom[0,100] + unsigned int nStrengthSharpen; ///< [IN] \~chinese 锐化强度[1,1000] \~english Strength Sharpen[1,1000] + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_SPATIAL_DENOISE_PARAM; + +/// \~chinese LSC标定结构体 \~english LSC calib structure +typedef struct _MV_CC_LSC_CALIB_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽度[16,65535] \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高度[16-65535] \~english Image Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcBufLen; ///< [IN] \~chinese 输入数据长度 \~english Input data length + + unsigned char* pCalibBuf; ///< [OUT] \~chinese 输出标定表缓存 \~english Output calib buffer + unsigned int nCalibBufSize; ///< [IN] \~chinese 提供的标定表缓冲大小(nWidth*nHeight*sizeof(unsigned short)) \~english Provided output buffer size + unsigned int nCalibBufLen; ///< [OUT] \~chinese 输出标定表缓存长度 \~english Output calib buffer length + + unsigned int nSecNumW; ///< [IN] \~chinese 宽度分块数 \~english Width Sec num + unsigned int nSecNumH; ///< [IN] \~chinese 高度分块数 \~english Height Sec num + unsigned int nPadCoef; ///< [IN] \~chinese 边缘填充系数[1,5] \~english Pad Coef[1,5] + unsigned int nCalibMethod; ///< [IN] \~chinese 标定方式(0-中心为基准;1-最亮区域为基准;2-目标亮度为基准) \~english Calib method + unsigned int nTargetGray; ///< [IN] \~chinese 目标亮度(标定方式为2时有效) \~english Target Gray + ///< \~chinese 8位,范围:[0,255] \~english 8bit,range:[0,255] + ///< \~chinese 10位,范围:[0,1023] \~english 10bit,range:[0,1023] + ///< \~chinese 12位,范围:[0,4095] \~english 12bit,range:[0,4095] + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_LSC_CALIB_PARAM; + +/// \~chinese LSC校正结构体 \~english LSC correct structure +typedef struct _MV_CC_LSC_CORRECT_PARAM_T_ +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽度[16,65535] \~english Image Width + unsigned int nHeight; ///< [IN] \~chinese 图像高度[16,65535] \~english Image Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned char* pSrcBuf; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcBufLen; ///< [IN] \~chinese 输入数据长度 \~english Input data length + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + + unsigned char* pCalibBuf; ///< [IN] \~chinese 输入标定表缓存 \~english Input calib buffer + unsigned int nCalibBufLen; ///< [IN] \~chinese 输入标定表缓存长度 \~english Input calib buffer length + + unsigned int nRes[8]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_LSC_CORRECT_PARAM; + +/// \~chinese 某个节点对应的子节点个数最大值 \~english The maximum number of child nodes corresponding to a node +#define MV_MAX_XML_NODE_NUM_C 128 + +/// \~chinese 节点名称字符串最大长度 \~english The maximum length of node name string +#define MV_MAX_XML_NODE_STRLEN_C 64 + +/// \~chinese 节点String值最大长度 \~english The maximum length of Node String +#define MV_MAX_XML_STRVALUE_STRLEN_C 64 + +/// \~chinese 节点描述字段最大长度 \~english The maximum length of the node description field +#define MV_MAX_XML_DISC_STRLEN_C 512 + +/// \~chinese 最多的单元数 \~english The maximum number of units +#define MV_MAX_XML_ENTRY_NUM 10 + +/// \~chinese 父节点个数上限 \~english The maximum number of parent nodes +#define MV_MAX_XML_PARENTS_NUM 8 + +/// \~chinese 每个已经实现单元的名称长度 \~english The length of the name of each unit that has been implemented +#define MV_MAX_XML_SYMBOLIC_STRLEN_C 64 + +enum MV_XML_Visibility +{ + V_Beginner = 0, ///< Always visible + V_Expert = 1, ///< Visible for experts or Gurus + V_Guru = 2, ///< Visible for Gurus + V_Invisible = 3, ///< Not Visible + V_Undefined = 99 ///< Object is not yet initialized +}; + +/// \~chinese 单个节点基本属性 | en:Single Node Basic Attributes +typedef struct _MV_XML_NODE_FEATURE_ +{ + enum MV_XML_InterfaceType enType; ///< \~chinese 节点类型 \~english Node Type + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Is visibility + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 节点描述,目前暂不支持 \~english Node Description, NOT SUPPORT NOW + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 显示名称 \~english Display Name + char strName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 节点名 \~english Node Name + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 提示 \~english Notice + + unsigned int nReserved[4]; +}MV_XML_NODE_FEATURE; + +/// \~chinese 节点列表 | en:Node List +typedef struct _MV_XML_NODES_LIST_ +{ + unsigned int nNodeNum; ///< \~chinese 节点个数 \~english Node Number + MV_XML_NODE_FEATURE stNodes[MV_MAX_XML_NODE_NUM_C]; +}MV_XML_NODES_LIST; + +typedef struct _MV_XML_FEATURE_Value_ +{ + enum MV_XML_InterfaceType enType; ///< \~chinese 节点类型 \~english Node Type + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 节点描述,目前暂不支持 \~english Node Description, NOT SUPPORT NOW + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 显示名称 \~english Display Name + char strName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 节点名 \~english Node Name + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 提示 \~english Notice + unsigned int nReserved[4]; +}MV_XML_FEATURE_Value; + +typedef struct _MV_XML_FEATURE_Base_ +{ + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode +}MV_XML_FEATURE_Base; + +typedef struct _MV_XML_FEATURE_Integer_ +{ + char strName[MV_MAX_XML_NODE_STRLEN_C]; + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 目前暂不支持 \~english NOT SUPPORT NOW + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; + + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + int64_t nValue; ///< \~chinese 当前值 \~english Current Value + int64_t nMinValue; ///< \~chinese 最小值 \~english Min Value + int64_t nMaxValue; ///< \~chinese 最大值 \~english Max Value + int64_t nIncrement; ///< \~chinese 增量 \~english Increment + + unsigned int nReserved[4]; + +}MV_XML_FEATURE_Integer; + +typedef struct _MV_XML_FEATURE_Boolean_ +{ + char strName[MV_MAX_XML_NODE_STRLEN_C]; + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 目前暂不支持 \~english NOT SUPPORT NOW + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; + + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + bool bValue; ///< \~chinese 当前值 \~english Current Value + + unsigned int nReserved[4]; +}MV_XML_FEATURE_Boolean; + +typedef struct _MV_XML_FEATURE_Command_ +{ + char strName[MV_MAX_XML_NODE_STRLEN_C]; + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 目前暂不支持 \~english NOT SUPPORT NOW + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; + + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + + unsigned int nReserved[4]; +}MV_XML_FEATURE_Command; + +typedef struct _MV_XML_FEATURE_Float_ +{ + char strName[MV_MAX_XML_NODE_STRLEN_C]; + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 目前暂不支持 \~english NOT SUPPORT NOW + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; + + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + double dfValue; ///< \~chinese 当前值 \~english Current Value + double dfMinValue; ///< \~chinese 最小值 \~english Min Value + double dfMaxValue; ///< \~chinese 最大值 \~english Max Value + double dfIncrement; ///< \~chinese 增量 \~english Increment + + unsigned int nReserved[4]; +}MV_XML_FEATURE_Float; + +typedef struct _MV_XML_FEATURE_String_ +{ + char strName[MV_MAX_XML_NODE_STRLEN_C]; + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 目前暂不支持 \~english NOT SUPPORT NOW + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; + + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + char strValue[MV_MAX_XML_STRVALUE_STRLEN_C]; ///< \~chinese 当前值 \~english Current Value + + unsigned int nReserved[4]; +}MV_XML_FEATURE_String; + +typedef struct _MV_XML_FEATURE_Register_ +{ + char strName[MV_MAX_XML_NODE_STRLEN_C]; + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 目前暂不支持 \~english NOT SUPPORT NOW + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; + + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + int64_t nAddrValue; ///< \~chinese 当前值 \~english Current Value + + unsigned int nReserved[4]; +}MV_XML_FEATURE_Register; + +typedef struct _MV_XML_FEATURE_Category_ +{ + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 节点描述 目前暂不支持 \~english Node Description, NOT SUPPORT NOW + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 显示名称 \~english Display Name + char strName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 节点名 \~english Node Name + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 提示 \~english Notice + + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + + unsigned int nReserved[4]; +}MV_XML_FEATURE_Category; + +typedef struct _MV_XML_FEATURE_EnumEntry_ +{ + char strName[MV_MAX_XML_NODE_STRLEN_C]; + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 目前暂不支持 \~english NOT SUPPORT NOW + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; + int bIsImplemented; + int nParentsNum; + MV_XML_NODE_FEATURE stParentsList[MV_MAX_XML_PARENTS_NUM]; + + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + int64_t nValue; ///< \~chinese 当前值 \~english Current Value + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + int nReserved[8]; + +}MV_XML_FEATURE_EnumEntry; + +typedef struct _MV_XML_FEATURE_Enumeration_ +{ + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 节点描述 目前暂不支持 \~english Node Description, NOT SUPPORT NOW + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 显示名称 \~english Display Name + char strName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 节点名 \~english Node Name + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 提示 \~english Notice + + int nSymbolicNum; ///< \~chinese ymbolic数 \~english Symbolic Number + char strCurrentSymbolic[MV_MAX_XML_SYMBOLIC_STRLEN_C];///< \~chinese 当前Symbolic索引 \~english Current Symbolic Index + char strSymbolic[MV_MAX_XML_SYMBOLIC_NUM][MV_MAX_XML_SYMBOLIC_STRLEN_C]; + enum MV_XML_AccessMode enAccessMode; ////< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + int64_t nValue; ///< \~chinese 当前值 \~english Current Value + + unsigned int nReserved[4]; +}MV_XML_FEATURE_Enumeration; + +typedef struct _MV_XML_FEATURE_Port_ +{ + enum MV_XML_Visibility enVisivility; ///< \~chinese 是否可见 \~english Visible + char strDescription[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 节点描述,目前暂不支持 \~english Node Description, NOT SUPPORT NOW + char strDisplayName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 显示名称 \~english Display Name + char strName[MV_MAX_XML_NODE_STRLEN_C]; ///< \~chinese 节点名 \~english Node Name + char strToolTip[MV_MAX_XML_DISC_STRLEN_C]; ///< \~chinese 提示 \~english Notice + + enum MV_XML_AccessMode enAccessMode; ///< \~chinese 访问模式 \~english Access Mode + int bIsLocked; ///< \~chinese 是否锁定。0-否;1-是,目前暂不支持 \~english Locked. 0-NO; 1-YES, NOT SUPPORT NOW + + unsigned int nReserved[4]; +}MV_XML_FEATURE_Port; + +typedef struct _MV_XML_CAMERA_FEATURE_ +{ + enum MV_XML_InterfaceType enType; + union + { + MV_XML_FEATURE_Integer stIntegerFeature; + MV_XML_FEATURE_Float stFloatFeature; + MV_XML_FEATURE_Enumeration stEnumerationFeature; + MV_XML_FEATURE_String stStringFeature; + }SpecialFeature; + +}MV_XML_CAMERA_FEATURE; + + + +/// \~chinese 图片保存参数 \~english Save Image Parameters +typedef struct _MV_SAVE_IMAGE_PARAM_T_EX_ +{ + unsigned char* pData; ///< [IN] \~chinese 输入数据缓存 \~english Input Data Buffer + unsigned int nDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input Data length + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 输入数据的像素格式 \~english Input Data Pixel Format + unsigned short nWidth; ///< [IN] \~chinese 图像宽 \~english Image Width + unsigned short nHeight; ///< [IN] \~chinese 图像高 \~english Image Height + + unsigned char* pImageBuffer; ///< [OUT] \~chinese 输出图片缓存 \~english Output Image Buffer + unsigned int nImageLen; ///< [OUT] \~chinese 输出图片长度 \~english Output Image length + unsigned int nBufferSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Output buffer size provided + enum MV_SAVE_IAMGE_TYPE enImageType; ///< [IN] \~chinese 输出图片格式 \~english Output Image Format + unsigned int nJpgQuality; ///< [IN] \~chinese JPG编码质量(50-99],其它格式无效 \~english Encoding quality(50-99],Other formats are invalid + + unsigned int iMethodValue; ///< [IN] \~chinese 插值方法 0-快速 1-均衡(其它值默认为均衡) 2-最优 3-最优+ \~english Bayer interpolation method 0-Fast 1-Equilibrium 2-Optimal 3-Optimal+ + + unsigned int nReserved[3]; ///< \~chinese 预留 \~english Reserved + +}MV_SAVE_IMAGE_PARAM_EX; + + + +/// \~chinese 图片保存参数 \~english Save Image Parameters +typedef struct _MV_SAVE_IMG_TO_FILE_PARAM_ +{ + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese输入数据的像素格式 \~english The pixel format of the input data + unsigned char* pData; ///< [IN] \~chinese 输入数据缓存 \~english Input Data Buffer + unsigned int nDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input Data length + unsigned short nWidth; ///< [IN] \~chinese 图像宽 \~english Image Width + unsigned short nHeight; ///< [IN] \~chinese 图像高 \~english Image Height + enum MV_SAVE_IAMGE_TYPE enImageType; ///< [IN] \~chinese 输入图片格式 \~english Input Image Format + unsigned int nQuality; ///< [IN] \~chinese JPG编码质量(50-99],其它格式无效 \~english JPG Encoding quality(50-99],Other formats are invalid + char pImagePath[256]; ///< [IN] \~chinese 输入文件路径 \~english Input file path + + int iMethodValue; ///< [IN] \~chinese 插值方法 0-快速 1-均衡(其它值默认为均衡) 2-最优 3-最优+ \~english Bayer interpolation method 0-Fast 1-Equilibrium 2-Optimal 3-Optimal+ + + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved + +}MV_SAVE_IMG_TO_FILE_PARAM; + + +// \~chinese 像素转换结构体 \~english Pixel convert structure +typedef struct _MV_CC_PIXEL_CONVERT_PARAM_ +{ + unsigned short nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned short nHeight; ///< [IN] \~chinese 图像高 \~english Height + + enum MvGvspPixelType enSrcPixelType; ///< [IN] \~chinese 源像素格式 \~english Source pixel format + unsigned char* pSrcData; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input data length + + enum MvGvspPixelType enDstPixelType; ///< [IN] \~chinese 目标像素格式 \~english Destination pixel format + unsigned char* pDstBuffer; ///< [OUT] \~chinese 输出数据缓存 \~english Output data buffer + unsigned int nDstLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nDstBufferSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + + unsigned int nRes[4]; ///< \~chinese 预留 \~english Reserved + +}MV_CC_PIXEL_CONVERT_PARAM; + +/// \~chinese 保存的3D数据格式 \~english The saved format for 3D data +enum MV_SAVE_POINT_CLOUD_FILE_TYPE +{ + MV_PointCloudFile_Undefined = 0, ///< \~chinese 未定义的点云格式 \~english Undefined point cloud format + MV_PointCloudFile_PLY = 1, ///< \~chinese PLY点云格式 \~english The point cloud format named PLY + MV_PointCloudFile_CSV = 2, ///< \~chinese CSV点云格式 \~english The point cloud format named CSV + MV_PointCloudFile_OBJ = 3, ///< \~chinese OBJ点云格式 \~english The point cloud format named OBJ + +}; + +/// \~chinese 保存3D数据到缓存 \~english Save 3D data to buffer +typedef struct _MV_SAVE_POINT_CLOUD_PARAM_ +{ + unsigned int nLinePntNum; ///< [IN] \~chinese 行点数,即图像宽 \~english The number of points in each row,which is the width of the image + unsigned int nLineNum; ///< [IN] \~chinese 行数,即图像高 \~english The number of rows,which is the height of the image + + enum MvGvspPixelType enSrcPixelType; ///< [IN] \~chinese 输入数据的像素格式 \~english The pixel format of the input data + unsigned char* pSrcData; ///< [IN] \~chinese 输入数据缓存 \~english Input data buffer + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入数据长度 \~english Input data length + + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出像素数据缓存 \~english Output pixel data buffer + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小(nLinePntNum * nLineNum * (16*3 + 4) + 2048) \~english Output buffer size provided(nLinePntNum * nLineNum * (16*3 + 4) + 2048) + unsigned int nDstBufLen; ///< [OUT] \~chinese 输出像素数据缓存长度 \~english Output pixel data buffer size + enum MV_SAVE_POINT_CLOUD_FILE_TYPE enPointCloudFileType; ///< [IN] \~chinese 提供输出的点云文件类型 \~english Output point data file type provided + + unsigned int nReserved[8]; ///< \~chinese 保留字段 \~english Reserved + +}MV_SAVE_POINT_CLOUD_PARAM; + +/// \~chinese 显示帧信息 \~english Display frame information +typedef struct _MV_DISPLAY_FRAME_INFO_ +{ + void* hWnd; ///< [IN] \~chinese 窗口句柄 \~english HWND + unsigned char* pData; ///< [IN] \~chinese 显示的数据 \~english Data Buffer + unsigned int nDataLen; ///< [IN] \~chinese 数据长度 \~english Data Size + unsigned short nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned short nHeight; ///< [IN] \~chinese 图像高 \~english Height + enum MvGvspPixelType enPixelType; ///< [IN] \~chinese 像素格式 \~english Pixel format + + unsigned int enRenderMode; /// [IN] \~chinese 图像渲染方式 Windows:0-GDI(默认), 1-D3D, 2-OPENGL Linux: 0-OPENGL(默认) \~english Windows:0-GDI(default), 1-D3D, 2-OPENGL Linux: 0-OPENGL(default) + unsigned int nRes[3]; ///< \~chinese 保留 \~english Reserved + +}MV_DISPLAY_FRAME_INFO; + + + + +#endif /* _MV_OBSOLETE_CAM_PARAMS_H_ */ diff --git a/third_party/hikrobot/include/PixelType.h b/third_party/hikrobot/include/PixelType.h new file mode 100644 index 0000000..d2a8d04 --- /dev/null +++ b/third_party/hikrobot/include/PixelType.h @@ -0,0 +1,201 @@ + +#ifndef _MV_PIXEL_TYPE_H_ +#define _MV_PIXEL_TYPE_H_ + +/************************************************************************/ +/* GigE Vision (2.0.03) PIXEL FORMATS */ +/************************************************************************/ + +// Indicate if pixel is monochrome or RGB +#define MV_GVSP_PIX_MONO 0x01000000 +#define MV_GVSP_PIX_RGB 0x02000000 // deprecated in version 1.1 +#define MV_GVSP_PIX_COLOR 0x02000000 +#define MV_GVSP_PIX_CUSTOM 0x80000000 +#define MV_GVSP_PIX_COLOR_MASK 0xFF000000 + +// Indicate effective number of bits occupied by the pixel (including padding). +// This can be used to compute amount of memory required to store an image. +#define MV_PIXEL_BIT_COUNT(n) ((n) << 16) + +#define MV_GVSP_PIX_EFFECTIVE_PIXEL_SIZE_MASK 0x00FF0000 +#define MV_GVSP_PIX_EFFECTIVE_PIXEL_SIZE_SHIFT 16 + +// Pixel ID: lower 16-bit of the pixel formats +#define MV_GVSP_PIX_ID_MASK 0x0000FFFF +#define MV_GVSP_PIX_COUNT 0x46 // next Pixel ID available + +/// \addtogroup 像素格式定义 +///@{ + +///< \~chinese 图片格式定义 +enum MvGvspPixelType +{ + // Undefined pixel type +#ifdef WIN32 + PixelType_Gvsp_Undefined = 0xFFFFFFFF, ///< 未定义的像素类型 + +#else + PixelType_Gvsp_Undefined = -1, ///< 未定义的像素类型 + +#endif + // Mono buffer format defines + PixelType_Gvsp_Mono1p = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(1) | 0x0037), ///< Mono1p + PixelType_Gvsp_Mono2p = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(2) | 0x0038), ///< Mono2p + PixelType_Gvsp_Mono4p = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(4) | 0x0039), ///< Mono4p + PixelType_Gvsp_Mono8 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0001), ///< Mono8 + PixelType_Gvsp_Mono8_Signed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0002), ///< Mono8_Signed + PixelType_Gvsp_Mono10 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0003), ///< Mono10 + PixelType_Gvsp_Mono10_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0004), ///< Mono10_Packed + PixelType_Gvsp_Mono12 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0005), ///< Mono12 + PixelType_Gvsp_Mono12_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0006), ///< Mono12_Packed + PixelType_Gvsp_Mono14 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0025), ///< Mono14 + PixelType_Gvsp_Mono16 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0007), ///< Mono16 + + // Bayer buffer format defines + PixelType_Gvsp_BayerGR8 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0008), ///< BayerGR8 + PixelType_Gvsp_BayerRG8 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0009), ///< BayerRG8 + PixelType_Gvsp_BayerGB8 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000A), ///< BayerGB8 + PixelType_Gvsp_BayerBG8 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000B), ///< BayerBG8 + PixelType_Gvsp_BayerRBGG8 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0046), ///< BayerRBGG8 + PixelType_Gvsp_BayerGR10 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000C), ///< BayerGR10 + PixelType_Gvsp_BayerRG10 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000D), ///< BayerRG10 + PixelType_Gvsp_BayerGB10 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000E), ///< BayerGB10 + PixelType_Gvsp_BayerBG10 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000F), ///< BayerBG10 + PixelType_Gvsp_BayerGR12 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0010), ///< BayerGR12 + PixelType_Gvsp_BayerRG12 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0011), ///< BayerRG12 + PixelType_Gvsp_BayerGB12 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0012), ///< BayerGB12 + PixelType_Gvsp_BayerBG12 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0013), ///< BayerBG12 + PixelType_Gvsp_BayerGR10_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0026), ///< BayerGR10_Packed + PixelType_Gvsp_BayerRG10_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0027), ///< BayerRG10_Packed + PixelType_Gvsp_BayerGB10_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0028), ///< BayerGB10_Packed + PixelType_Gvsp_BayerBG10_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0029), ///< BayerBG10_Packed + PixelType_Gvsp_BayerGR12_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002A), ///< BayerGR12_Packed + PixelType_Gvsp_BayerRG12_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002B), ///< BayerRG12_Packed + PixelType_Gvsp_BayerGB12_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002C), ///< BayerGB12_Packed + PixelType_Gvsp_BayerBG12_Packed = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002D), ///< BayerBG12_Packed + PixelType_Gvsp_BayerGR16 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x002E), ///< BayerGR16 + PixelType_Gvsp_BayerRG16 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x002F), ///< BayerRG16 + PixelType_Gvsp_BayerGB16 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0030), ///< BayerGB16 + PixelType_Gvsp_BayerBG16 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0031), ///< BayerBG16 + + // RGB Packed buffer format defines + PixelType_Gvsp_RGB8_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0014), ///< RGB8_Packed + PixelType_Gvsp_BGR8_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0015), ///< BGR8_Packed + PixelType_Gvsp_RGBA8_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0016), ///< RGBA8_Packed + PixelType_Gvsp_BGRA8_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0017), ///< BGRA8_Packed + PixelType_Gvsp_RGB10_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0018), ///< RGB10_Packed + PixelType_Gvsp_BGR10_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0019), ///< BGR10_Packed + PixelType_Gvsp_RGB12_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x001A), ///< RGB12_Packed + PixelType_Gvsp_BGR12_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x001B), ///< BGR12_Packed + PixelType_Gvsp_RGB16_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0033), ///< RGB16_Packed + PixelType_Gvsp_BGR16_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x004B), ///< BGR16_Packed + PixelType_Gvsp_RGBA16_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0064), ///< RGBA16_Packed + PixelType_Gvsp_BGRA16_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0051), ///< BGRA16_Packed + PixelType_Gvsp_RGB10V1_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x001C), ///< RGB10V1_Packed + PixelType_Gvsp_RGB10V2_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x001D), ///< RGB10V2_Packed + PixelType_Gvsp_RGB12V1_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(36) | 0X0034), ///< RGB12V1_Packed + PixelType_Gvsp_RGB565_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0035), ///< RGB565_Packed + PixelType_Gvsp_BGR565_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0X0036), ///< BGR565_Packed + + // YUV Packed buffer format defines + PixelType_Gvsp_YUV411_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x001E), ///< YUV411_Packed + PixelType_Gvsp_YUV422_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x001F), ///< YUV422_Packed + PixelType_Gvsp_YUV422_YUYV_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0032), ///< YUV422_YUYV_Packed + PixelType_Gvsp_YUV444_Packed = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0020), ///< YUV444_Packed + PixelType_Gvsp_YCBCR8_CBYCR = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x003A), ///< YCBCR8_CBYCR + PixelType_Gvsp_YCBCR422_8 = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x003B), ///< YCBCR422_8 + PixelType_Gvsp_YCBCR422_8_CBYCRY = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0043), ///< YCBCR422_8_CBYCRY + PixelType_Gvsp_YCBCR411_8_CBYYCRYY = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x003C), ///< YCBCR411_8_CBYYCRYY + PixelType_Gvsp_YCBCR601_8_CBYCR = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x003D), ///< YCBCR601_8_CBYCR + PixelType_Gvsp_YCBCR601_422_8 = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x003E), ///< YCBCR601_422_8 + PixelType_Gvsp_YCBCR601_422_8_CBYCRY = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0044), ///< YCBCR601_422_8_CBYCRY + PixelType_Gvsp_YCBCR601_411_8_CBYYCRYY = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x003F), ///< YCBCR601_411_8_CBYYCRYY + PixelType_Gvsp_YCBCR709_8_CBYCR = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0040), ///< YCBCR709_8_CBYCR + PixelType_Gvsp_YCBCR709_422_8 = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0041), ///< YCBCR709_422_8 + PixelType_Gvsp_YCBCR709_422_8_CBYCRY = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0045), ///< YCBCR709_422_8_CBYCRY + PixelType_Gvsp_YCBCR709_411_8_CBYYCRYY = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x0042), ///< YCBCR709_411_8_CBYYCRYY + + // YUV420 + PixelType_Gvsp_YUV420SP_NV12 = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x8001), ///< YUV420SP_NV12 + PixelType_Gvsp_YUV420SP_NV21 = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x8002), ///< YUV420SP_NV21 + + // RGB Planar buffer format defines + PixelType_Gvsp_RGB8_Planar = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0021), ///< RGB8_Planar + PixelType_Gvsp_RGB10_Planar = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0022), ///< RGB10_Planar + PixelType_Gvsp_RGB12_Planar = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0023), ///< RGB12_Planar + PixelType_Gvsp_RGB16_Planar = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0024), ///< RGB16_Planar + + // 自定义的图片格式 + PixelType_Gvsp_Jpeg = (MV_GVSP_PIX_CUSTOM | MV_PIXEL_BIT_COUNT(24) | 0x0001), ///< Jpeg + + PixelType_Gvsp_Coord3D_ABC32f = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x00C0), ///< 0x026000C0X + PixelType_Gvsp_Coord3D_ABC32f_Planar = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x00C1), ///< 0x026000C1X + + PixelType_Gvsp_Coord3D_AC32f = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(40) | 0x00C2), ///< 该值被废弃,请参考PixelType_Gvsp_Coord3D_AC32f_64; the value is discarded + PixelType_Gvsp_COORD3D_DEPTH_PLUS_MASK = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(28) | 0x0001), ///< 该值被废弃; the value is discarded (已放入Chunkdata) + + PixelType_Gvsp_Coord3D_ABC32 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x3001), ///< Coord3D_ABC32 + PixelType_Gvsp_Coord3D_AB32f = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3002), ///< Coord3D_AB32f + PixelType_Gvsp_Coord3D_AB32 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3003), ///< Coord3D_AB32 + PixelType_Gvsp_Coord3D_AC32f_64 = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x00C2), ///< Coord3D_AC32f_64 + PixelType_Gvsp_Coord3D_AC32f_Planar = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x00C3), ///< Coord3D_AC32f_Planar + PixelType_Gvsp_Coord3D_AC32 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3004), ///< Coord3D_AC32 + PixelType_Gvsp_Coord3D_A32f = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x00BD), ///< Coord3D_A32f + PixelType_Gvsp_Coord3D_A32 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x3005), ///< Coord3D_A32 + PixelType_Gvsp_Coord3D_C32f = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x00BF), ///< Coord3D_C32f + PixelType_Gvsp_Coord3D_C32 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x3006), ///< Coord3D_C32 + PixelType_Gvsp_Coord3D_ABC16 = (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x00B9), ///< Coord3D_ABC16 + PixelType_Gvsp_Coord3D_C16 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x00B8), ///< Coord3D_C16 + + PixelType_Gvsp_Float32 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x0001), //0x81200001 + + //无损压缩像素格式定义 + PixelType_Gvsp_HB_Mono8 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0001), ///< HB_Mono8 + PixelType_Gvsp_HB_Mono10 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0003), ///< HB_Mono10 + PixelType_Gvsp_HB_Mono10_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0004), ///< HB_Mono10_Packed + PixelType_Gvsp_HB_Mono12 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0005), ///< HB_Mono12 + PixelType_Gvsp_HB_Mono12_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0006), ///< HB_Mono12_Packed + PixelType_Gvsp_HB_Mono16 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0007), ///< HB_Mono16 + PixelType_Gvsp_HB_BayerGR8 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0008), ///< HB_BayerGR8 + PixelType_Gvsp_HB_BayerRG8 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0009), ///< HB_BayerRG8 + PixelType_Gvsp_HB_BayerGB8 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000A), ///< HB_BayerGB8 + PixelType_Gvsp_HB_BayerBG8 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000B), ///< HB_BayerBG8 + PixelType_Gvsp_HB_BayerRBGG8 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0046), ///< HB_BayerRBGG8 + PixelType_Gvsp_HB_BayerGR10 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000C), ///< HB_BayerGR10 + PixelType_Gvsp_HB_BayerRG10 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000D), ///< HB_BayerRG10 + PixelType_Gvsp_HB_BayerGB10 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000E), ///< HB_BayerGB10 + PixelType_Gvsp_HB_BayerBG10 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000F), ///< HB_BayerBG10 + PixelType_Gvsp_HB_BayerGR12 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0010), ///< HB_BayerGR12 + PixelType_Gvsp_HB_BayerRG12 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0011), ///< HB_BayerRG12 + PixelType_Gvsp_HB_BayerGB12 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0012), ///< HB_BayerGB12 + PixelType_Gvsp_HB_BayerBG12 = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0013), ///< HB_BayerBG12 + PixelType_Gvsp_HB_BayerGR10_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0026), ///< HB_BayerGR10_Packed + PixelType_Gvsp_HB_BayerRG10_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0027), ///< HB_BayerRG10_Packed + PixelType_Gvsp_HB_BayerGB10_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0028), ///< HB_BayerGB10_Packed + PixelType_Gvsp_HB_BayerBG10_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0029), ///< HB_BayerBG10_Packed + PixelType_Gvsp_HB_BayerGR12_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002A), ///< HB_BayerGR12_Packed + PixelType_Gvsp_HB_BayerRG12_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002B), ///< HB_BayerRG12_Packed + PixelType_Gvsp_HB_BayerGB12_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002C), ///< HB_BayerGB12_Packed + PixelType_Gvsp_HB_BayerBG12_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002D), ///< HB_BayerBG12_Packed + PixelType_Gvsp_HB_YUV422_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x001F), ///< HB_YUV422_Packed + PixelType_Gvsp_HB_YUV422_YUYV_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0032), ///< HB_YUV422_YUYV_Packed + PixelType_Gvsp_HB_RGB8_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0014), ///< HB_RGB8_Packed + PixelType_Gvsp_HB_BGR8_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0015), ///< HB_BGR8_Packed + PixelType_Gvsp_HB_RGBA8_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0016), ///< HB_RGBA8_Packed + PixelType_Gvsp_HB_BGRA8_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0017), ///< HB_BGRA8_Packed + PixelType_Gvsp_HB_RGB16_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0033), ///< HB_RGB16_Packed + PixelType_Gvsp_HB_BGR16_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x004B), ///< HB_BGR16_Packed + PixelType_Gvsp_HB_RGBA16_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0064), ///< HB_RGBA16_Packed + PixelType_Gvsp_HB_BGRA16_Packed = (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0051), ///< HB_BGRA16_Packed + +}; +///@} + +#ifdef WIN32 +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif + +#endif /* _MV_PIXEL_TYPE_H_ */ diff --git a/third_party/hikrobot/src/MvCamera.cpp b/third_party/hikrobot/src/MvCamera.cpp new file mode 100644 index 0000000..c59bbf2 --- /dev/null +++ b/third_party/hikrobot/src/MvCamera.cpp @@ -0,0 +1,356 @@ +#include "MvCamera.h" + +CMvCamera::CMvCamera() +{ + m_hDevHandle = MV_NULL; +} + +CMvCamera::~CMvCamera() +{ + if (m_hDevHandle) + { + MV_CC_DestroyHandle(m_hDevHandle); + m_hDevHandle = MV_NULL; + } +} + +// ch:初始化SDK | en:Initialize SDK +int CMvCamera::InitSDK() +{ + return MV_CC_Initialize(); +} + +// ch:反初始化SDK | en:Finalize SDK +int CMvCamera::FinalizeSDK() +{ + return MV_CC_Finalize(); +} + +// ch:获取SDK版本号 | en:Get SDK Version +int CMvCamera::GetSDKVersion() +{ + return MV_CC_GetSDKVersion(); +} + +// ch:枚举设备 | en:Enumerate Device +int CMvCamera::EnumDevices(unsigned int nTLayerType, MV_CC_DEVICE_INFO_LIST* pstDevList) +{ + return MV_CC_EnumDevices(nTLayerType, pstDevList); +} + +// ch:判断设备是否可达 | en:Is the device accessible +bool CMvCamera::IsDeviceAccessible(MV_CC_DEVICE_INFO* pstDevInfo, unsigned int nAccessMode) +{ + return MV_CC_IsDeviceAccessible(pstDevInfo, nAccessMode); +} + +// ch:打开设备 | en:Open Device +int CMvCamera::Open(MV_CC_DEVICE_INFO* pstDeviceInfo) +{ + if (MV_NULL == pstDeviceInfo) + { + return MV_E_PARAMETER; + } + + if (m_hDevHandle) + { + return MV_E_CALLORDER; + } + + int nRet = MV_CC_CreateHandle(&m_hDevHandle, pstDeviceInfo); + if (MV_OK != nRet) + { + return nRet; + } + + nRet = MV_CC_OpenDevice(m_hDevHandle); + if (MV_OK != nRet) + { + MV_CC_DestroyHandle(m_hDevHandle); + m_hDevHandle = MV_NULL; + } + + return nRet; +} + +// ch:关闭设备 | en:Close Device +int CMvCamera::Close() +{ + if (MV_NULL == m_hDevHandle) + { + return MV_E_HANDLE; + } + + MV_CC_CloseDevice(m_hDevHandle); + + int nRet = MV_CC_DestroyHandle(m_hDevHandle); + m_hDevHandle = MV_NULL; + + return nRet; +} + +// ch:判断相机是否处于连接状态 | en:Is The Device Connected +bool CMvCamera::IsDeviceConnected() +{ + return MV_CC_IsDeviceConnected(m_hDevHandle); +} + +// ch:注册图像数据回调 | en:Register Image Data CallBack +int CMvCamera::RegisterImageCallBack(void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser), void* pUser) +{ + return MV_CC_RegisterImageCallBackEx(m_hDevHandle, cbOutput, pUser); +} + +int CMvCamera::RegisterImageCallBack2(void(__stdcall* cbOutput)(MV_FRAME_OUT* pstFrame, void *pUser, bool bAutoFree), void* pUser, bool bAutoFree) +{ + return MV_CC_RegisterImageCallBackEx2(m_hDevHandle, cbOutput, pUser, bAutoFree); +} + +// ch:开启抓图 | en:Start Grabbing +int CMvCamera::StartGrabbing() +{ + return MV_CC_StartGrabbing(m_hDevHandle); +} + +// ch:停止抓图 | en:Stop Grabbing +int CMvCamera::StopGrabbing() +{ + return MV_CC_StopGrabbing(m_hDevHandle); +} + +// ch:主动获取一帧图像数据 | en:Get one frame initiatively +int CMvCamera::GetImageBuffer(MV_FRAME_OUT* pFrame, int nMsec) +{ + return MV_CC_GetImageBuffer(m_hDevHandle, pFrame, nMsec); +} + +// ch:释放图像缓存 | en:Free image buffer +int CMvCamera::FreeImageBuffer(MV_FRAME_OUT* pFrame) +{ + return MV_CC_FreeImageBuffer(m_hDevHandle, pFrame); +} + +// ch:设置显示窗口句柄 | en:Set Display Window Handle +int CMvCamera::DisplayOneFrame(void* hwndDisplay,MV_CC_IMAGE* pImageInfo) +{ + return MV_CC_DisplayOneFrameEx2(m_hDevHandle, hwndDisplay, pImageInfo,0); + +} + +// ch:设置SDK内部图像缓存节点个数 | en:Set the number of the internal image cache nodes in SDK +int CMvCamera::SetImageNodeNum(unsigned int nNum) +{ + return MV_CC_SetImageNodeNum(m_hDevHandle, nNum); +} + +// ch:获取设备信息 | en:Get device information +int CMvCamera::GetDeviceInfo(MV_CC_DEVICE_INFO* pstDevInfo) +{ + return MV_CC_GetDeviceInfo(m_hDevHandle, pstDevInfo); +} + +// ch:获取GEV相机的统计信息 | en:Get detect info of GEV camera +int CMvCamera::GetGevAllMatchInfo(MV_MATCH_INFO_NET_DETECT* pMatchInfoNetDetect) +{ + if (MV_NULL == pMatchInfoNetDetect) + { + return MV_E_PARAMETER; + } + + MV_CC_DEVICE_INFO stDevInfo = {0}; + GetDeviceInfo(&stDevInfo); + if (stDevInfo.nTLayerType != MV_GIGE_DEVICE) + { + return MV_E_SUPPORT; + } + + MV_ALL_MATCH_INFO struMatchInfo = {0}; + + struMatchInfo.nType = MV_MATCH_TYPE_NET_DETECT; + struMatchInfo.pInfo = pMatchInfoNetDetect; + struMatchInfo.nInfoSize = sizeof(MV_MATCH_INFO_NET_DETECT); + memset(struMatchInfo.pInfo, 0, sizeof(MV_MATCH_INFO_NET_DETECT)); + + return MV_CC_GetAllMatchInfo(m_hDevHandle, &struMatchInfo); +} + +// ch:获取U3V相机的统计信息 | en:Get detect info of U3V camera +int CMvCamera::GetU3VAllMatchInfo(MV_MATCH_INFO_USB_DETECT* pMatchInfoUSBDetect) +{ + if (MV_NULL == pMatchInfoUSBDetect) + { + return MV_E_PARAMETER; + } + + MV_CC_DEVICE_INFO stDevInfo = {0}; + GetDeviceInfo(&stDevInfo); + if (stDevInfo.nTLayerType != MV_USB_DEVICE) + { + return MV_E_SUPPORT; + } + + MV_ALL_MATCH_INFO struMatchInfo = {0}; + + struMatchInfo.nType = MV_MATCH_TYPE_USB_DETECT; + struMatchInfo.pInfo = pMatchInfoUSBDetect; + struMatchInfo.nInfoSize = sizeof(MV_MATCH_INFO_USB_DETECT); + memset(struMatchInfo.pInfo, 0, sizeof(MV_MATCH_INFO_USB_DETECT)); + + return MV_CC_GetAllMatchInfo(m_hDevHandle, &struMatchInfo); +} + +// ch:获取和设置Int型参数,如 Width和Height +// en:Get Int type parameters, such as Width and Height +int CMvCamera::GetIntValue(IN const char* strKey, OUT MVCC_INTVALUE_EX *pIntValue) +{ + return MV_CC_GetIntValueEx(m_hDevHandle, strKey, pIntValue); +} + +int CMvCamera::SetIntValue(IN const char* strKey, IN int64_t nValue) +{ + return MV_CC_SetIntValueEx(m_hDevHandle, strKey, nValue); +} + +// ch:获取和设置Enum型参数,如 PixelFormat +// en:Get Enum type parameters, such as PixelFormat +int CMvCamera::GetEnumValue(IN const char* strKey, OUT MVCC_ENUMVALUE *pEnumValue) +{ + return MV_CC_GetEnumValue(m_hDevHandle, strKey, pEnumValue); +} + +int CMvCamera::SetEnumValue(IN const char* strKey, IN unsigned int nValue) +{ + return MV_CC_SetEnumValue(m_hDevHandle, strKey, nValue); +} + +int CMvCamera::SetEnumValueByString(IN const char* strKey, IN const char* sValue) +{ + return MV_CC_SetEnumValueByString(m_hDevHandle, strKey, sValue); +} + +int CMvCamera::GetEnumEntrySymbolic(IN const char* strKey, IN MVCC_ENUMENTRY* pstEnumEntry) +{ + return MV_CC_GetEnumEntrySymbolic(m_hDevHandle, strKey, pstEnumEntry); +} + +// ch:获取和设置Float型参数,如 ExposureTime和Gain +// en:Get Float type parameters, such as ExposureTime and Gain +int CMvCamera::GetFloatValue(IN const char* strKey, OUT MVCC_FLOATVALUE *pFloatValue) +{ + return MV_CC_GetFloatValue(m_hDevHandle, strKey, pFloatValue); +} + +int CMvCamera::SetFloatValue(IN const char* strKey, IN float fValue) +{ + return MV_CC_SetFloatValue(m_hDevHandle, strKey, fValue); +} + +// ch:获取和设置Bool型参数,如 ReverseX +// en:Get Bool type parameters, such as ReverseX +int CMvCamera::GetBoolValue(IN const char* strKey, OUT bool *pbValue) +{ + return MV_CC_GetBoolValue(m_hDevHandle, strKey, pbValue); +} + +int CMvCamera::SetBoolValue(IN const char* strKey, IN bool bValue) +{ + return MV_CC_SetBoolValue(m_hDevHandle, strKey, bValue); +} + +// ch:获取和设置String型参数,如 DeviceUserID +// en:Get String type parameters, such as DeviceUserID +int CMvCamera::GetStringValue(IN const char* strKey, MVCC_STRINGVALUE *pStringValue) +{ + return MV_CC_GetStringValue(m_hDevHandle, strKey, pStringValue); +} + +int CMvCamera::SetStringValue(IN const char* strKey, IN const char* strValue) +{ + return MV_CC_SetStringValue(m_hDevHandle, strKey, strValue); +} + +// ch:执行一次Command型命令,如 UserSetSave +// en:Execute Command once, such as UserSetSave +int CMvCamera::CommandExecute(IN const char* strKey) +{ + return MV_CC_SetCommandValue(m_hDevHandle, strKey); +} + +// ch:探测网络最佳包大小(只对GigE相机有效) | en:Detection network optimal package size(It only works for the GigE camera) +int CMvCamera::GetOptimalPacketSize(unsigned int* pOptimalPacketSize) +{ + if (MV_NULL == pOptimalPacketSize) + { + return MV_E_PARAMETER; + } + + int nRet = MV_CC_GetOptimalPacketSize(m_hDevHandle); + if (nRet < MV_OK) + { + return nRet; + } + + *pOptimalPacketSize = (unsigned int)nRet; + + return MV_OK; +} + +// ch:注册消息异常回调 | en:Register Message Exception CallBack +int CMvCamera::RegisterExceptionCallBack(void(__stdcall* cbException)(unsigned int nMsgType, void* pUser),void* pUser) +{ + return MV_CC_RegisterExceptionCallBack(m_hDevHandle, cbException, pUser); +} + +// ch:注册单个事件回调 | en:Register Event CallBack +int CMvCamera::RegisterEventCallBack(const char* pEventName, void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser), void* pUser) +{ + return MV_CC_RegisterEventCallBackEx(m_hDevHandle, pEventName, cbEvent, pUser); +} + +// ch:强制IP | en:Force IP +int CMvCamera::ForceIp(unsigned int nIP, unsigned int nSubNetMask, unsigned int nDefaultGateWay) +{ + return MV_GIGE_ForceIpEx(m_hDevHandle, nIP, nSubNetMask, nDefaultGateWay); +} + +// ch:配置IP方式 | en:IP configuration method +int CMvCamera::SetIpConfig(unsigned int nType) +{ + return MV_GIGE_SetIpConfig(m_hDevHandle, nType); +} + +// ch:设置网络传输模式 | en:Set Net Transfer Mode +int CMvCamera::SetNetTransMode(unsigned int nType) +{ + return MV_GIGE_SetNetTransMode(m_hDevHandle, nType); +} + +// ch:像素格式转换 | en:Pixel format conversion +int CMvCamera::ConvertPixelType(MV_CC_PIXEL_CONVERT_PARAM_EX* pstCvtParam) +{ + return MV_CC_ConvertPixelTypeEx(m_hDevHandle, pstCvtParam); +} + +// ch:保存图片 | en:save image +int CMvCamera::SaveImage(MV_SAVE_IMAGE_PARAM_EX3* pstParam) +{ + return MV_CC_SaveImageEx3(m_hDevHandle, pstParam); +} + +// ch:保存图片为文件 | en:Save the image as a file +int CMvCamera::SaveImageToFile(MV_CC_IMAGE* pstImage, MV_CC_SAVE_IMAGE_PARAM* pSaveImageParam, const char* pcImagePath) +{ + return MV_CC_SaveImageToFileEx2(m_hDevHandle, pstImage, pSaveImageParam, pcImagePath); +} + +// ch:绘制圆形辅助线 | en:Draw circle auxiliary line +int CMvCamera::DrawCircle(MVCC_CIRCLE_INFO* pCircleInfo) +{ + return MV_CC_DrawCircle(m_hDevHandle, pCircleInfo); +} + +// ch:绘制线形辅助线 | en:Draw lines auxiliary line +int CMvCamera::DrawLines(MVCC_LINES_INFO* pLinesInfo) +{ + return MV_CC_DrawLines(m_hDevHandle, pLinesInfo); +}