commit f61a9394ec5ef7b398197ca914080a34e5e2ec41 Author: leon <501646023@qq.com> Date: Mon Dec 16 12:27:03 2024 +0800 first commit diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9add9db --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,64 @@ +cmake_minimum_required(VERSION 3.24) + +PROJECT(lidar_camera) + +set(CMAKE_SOURCE_DIR "./") + + +message(STATUS "========================") +message(STATUS ${CMAKE_SYSTEM_NAME}) +message(STATUS ${CMAKE_SYSTEM_PROCESSOR}) +message(STATUS "========================") + + +find_package(OpenCV 4.10) +if(NOT OpenCV_FOUND) + message(FATAL_ERROR "OpenCV > 4.10 not found.") +endif() +MESSAGE(${OpenCV_VERSION}) + +# 检测操作系统和架构 +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(PLATFORM "linux/x64") + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + set(PLATFORM "linux/aarch64") + else() + message(FATAL_ERROR "Unsupported architecture on Linux") + endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(PLATFORM "windows/x64") + else() + message(FATAL_ERROR "Unsupported architecture on Windows") + endif() +else() + message(FATAL_ERROR "Unsupported operating system") +endif() + +# 输出当前系统和架构 +message(STATUS "operating system: ${PLATFORM}") + +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/output/") + +INCLUDE_DIRECTORIES( + "/include" + "/usr/include" +) +# LINK_DIRECTORIES( +# "/opt/HuarayTech/MVviewer/lib" +# "/opt/HuarayTech/MVviewer/bin" +# ) + +aux_source_directory(${CMAKE_SOURCE_DIR}/ SRCLIST) + +add_executable(${PROJECT_NAME} ${SRCLIST}) +target_link_libraries(${PROJECT_NAME} dl) +target_link_libraries(${PROJECT_NAME} pthread) +target_link_libraries(${PROJECT_NAME} "/lib" ${OpenCV_LIBS}) + +add_library(CameraDriver MODULE ${SRCLIST}) +target_link_libraries(CameraDriver dl) +target_link_libraries(CameraDriver pthread) +target_link_libraries(CameraDriver "/lib" ${OpenCV_LIBS}) + diff --git a/CameraDriver.cpp b/CameraDriver.cpp new file mode 100644 index 0000000..b7b53de --- /dev/null +++ b/CameraDriver.cpp @@ -0,0 +1,1174 @@ +#include "CameraDriver.h" + +extern "C"{ + +// ***********开始: 这部分处理与SDK操作相机无关,用于显示设备列表 *********** +// ***********BEGIN: These functions are not related to API call and used to display device info*********** +// 数据帧回调函数 +// Data frame callback function +static void onGetFrame(IMV_Frame* pFrame, void* pUser) +{ + if (pFrame == NULL) + { + printf("pFrame is NULL\n"); + return; + } + + printf("Get frame blockId = %llu\n", pFrame->frameInfo.blockId); + + return; +} + +static void displayDeviceInfo(IMV_DeviceList deviceInfoList) +{ + IMV_DeviceInfo* pDevInfo = NULL; + unsigned int cameraIndex = 0; + char vendorNameCat[11]; + char cameraNameCat[16]; + + // 打印Title行 + // Print title line + printf("\nIdx Type Vendor Model S/N DeviceUserID IP Address \n"); + printf("------------------------------------------------------------------------------\n"); + + for (cameraIndex = 0; cameraIndex < deviceInfoList.nDevNum; cameraIndex++) + { + pDevInfo = &deviceInfoList.pDevInfo[cameraIndex]; + // 设备列表的相机索引 最大表示字数:3 + // Camera index in device list, display in 3 characters + printf("%-3d", cameraIndex + 1); + + // 相机的设备类型(GigE,U3V,CL,PCIe) + // Camera type + switch (pDevInfo->nCameraType) + { + case typeGigeCamera:printf(" GigE");break; + case typeU3vCamera:printf(" U3V ");break; + case typeCLCamera:printf(" CL ");break; + case typePCIeCamera:printf(" PCIe");break; + default:printf(" ");break; + } + + // 制造商信息 最大表示字数:10 + // Camera vendor name, display in 10 characters + if (strlen(pDevInfo->vendorName) > 10) + { + memcpy(vendorNameCat, pDevInfo->vendorName, 7); + vendorNameCat[7] = '\0'; + strcat(vendorNameCat, "..."); + printf(" %-10.10s", vendorNameCat); + } + else + { + printf(" %-10.10s", pDevInfo->vendorName); + } + + // 相机的型号信息 最大表示字数:10 + // Camera model name, display in 10 characters + printf(" %-10.10s", pDevInfo->modelName); + + // 相机的序列号 最大表示字数:15 + // Camera serial number, display in 15 characters + printf(" %-15.15s", pDevInfo->serialNumber); + + // 自定义用户ID 最大表示字数:15 + // Camera user id, display in 15 characters + if (strlen(pDevInfo->cameraName) > 15) + { + memcpy(cameraNameCat, pDevInfo->cameraName, 12); + cameraNameCat[12] = '\0'; + strcat(cameraNameCat, "..."); + printf(" %-15.15s", cameraNameCat); + } + else + { + printf(" %-15.15s", pDevInfo->cameraName); + } + + // GigE相机时获取IP地址 + // IP address of GigE camera + if (pDevInfo->nCameraType == typeGigeCamera) + { + printf(" %s", pDevInfo->DeviceSpecificInfo.gigeDeviceInfo.ipAddress); + } + + printf("\n"); + } + + return; +} + +static char* trim(char* pStr) +{ + char* pDst = pStr; + char* pTemStr = NULL; + + if (pDst != NULL) + { + pTemStr = pDst + strlen(pStr) - 1; + while (*pDst == ' ') + { + pDst++; + } + while ((pTemStr > pDst) && (*pTemStr == ' ')) + { + *pTemStr-- = '\0'; + } + } + return pDst; +} + +static int isInputValid(char* pInpuStr) +{ + char numChar; + char* pStr = pInpuStr; + while (*pStr != '\0') + { + numChar = *pStr; + if ((numChar > '9') || (numChar < '0')) + { + return -1; + } + pStr++; + } + return 0; +} + +static unsigned int selectDevice(unsigned int cameraCnt) +{ + char inputStr[256]; + char* pTrimStr; + int inputIndex = -1; + int ret = -1; + char* find = NULL; + + printf("\nPlease input the camera index: "); + while (1) + { + memset(inputStr, 0, sizeof(inputStr)); + fgets(inputStr, sizeof(inputStr), stdin); + + // 清空输入缓存 + // clear flush + fflush(stdin); + + // fgets比gets多吃一个换行符号,取出换行符号 + // fgets eats one more line feed symbol than gets, and takes out the line feed symbol + find = strchr(inputStr, '\n'); + if (find) { *find = '\0'; } + + pTrimStr = trim(inputStr); + ret = isInputValid(pTrimStr); + if (ret == 0) + { + inputIndex = atoi(pTrimStr); + // 输入的序号从1开始 + // Input index starts from 1 + inputIndex -= 1; + if ((inputIndex >= 0) && (inputIndex < (int)cameraCnt)) + { + break; + } + } + + printf("Input invalid! Please input the camera index: "); + } + return (unsigned int)inputIndex; +} + +// ***********结束: 这部分处理与SDK操作相机无关,用于显示设备列表 *********** +// ***********END: These functions are not related to API call and used to display device info*********** +static int setSoftTriggerConf(void* libHandle, IMV_HANDLE devHandle) +{ + int ret = IMV_OK; + // 获取设置触发源为软触发函数地址 + DLL_SetEnumFeatureSymbol DLLSetEnumFeatureSymbol = (DLL_SetEnumFeatureSymbol)dlsym(libHandle, "IMV_SetEnumFeatureSymbol"); + if (NULL == DLLSetEnumFeatureSymbol) + { + printf("Get IMV_SetEnumFeatureSymbol address failed!\n"); + return ret; + } + + // 设置触发器 + // Set trigger selector to FrameStart + ret = DLLSetEnumFeatureSymbol(devHandle, "TriggerSelector", "FrameStart"); + if (IMV_OK != ret) + { + printf("Set triggerSelector value failed! ErrorCode[%d]\n", ret); + return ret; + } + + // 设置触发源为软触发 + // Set trigger source to Software + ret = DLLSetEnumFeatureSymbol(devHandle, "TriggerSource", "Software"); + if (IMV_OK != ret) + { + printf("Set triggerSource value failed! ErrorCode[%d]\n", ret); + return ret; + } + + // 设置触发模式 + // Set trigger mode to On + ret = DLLSetEnumFeatureSymbol(devHandle, "TriggerMode", "Off"); + if (IMV_OK != ret) + { + printf("Set triggerMode value failed! ErrorCode[%d]\n", ret); + return ret; + } + + return ret; +} + +// Image convert +static int imageConvert(void* libHandle, IMV_HANDLE devHandle, IMV_Frame frame, IMV_EPixelType convertFormat,void** data, int& w, int& h) +{ + IMV_PixelConvertParam stPixelConvertParam; + unsigned char* pDstBuf = NULL; + unsigned int nDstBufSize = 0; + int ret = IMV_OK; + FILE* hFile = NULL; + const char* pFileName = NULL; + const char* pConvertFormatStr = NULL; + + // 获取设置触发源为软触发函数地址 + DLL_PixelConvert DLLPixelConvert = (DLL_PixelConvert)dlsym(libHandle, "IMV_PixelConvert"); + if (NULL == DLLPixelConvert) + { + printf("Get IMV_PixelConvert address failed!\n"); + return -999; + } + + switch (convertFormat) + { + case gvspPixelRGB8: + nDstBufSize = sizeof(unsigned char) * frame.frameInfo.width * frame.frameInfo.height * 3; + pFileName = (const char*)"convertRGB8.bmp"; + pConvertFormatStr = (const char*)"RGB8"; + break; + case gvspPixelBGR8: + nDstBufSize = sizeof(unsigned char) * frame.frameInfo.width * frame.frameInfo.height * 3; + pFileName = (const char*)"convertBGR8.bmp"; + pConvertFormatStr = (const char*)"BGR8"; + break; + case gvspPixelBGRA8: + nDstBufSize = sizeof(unsigned char) * frame.frameInfo.width * frame.frameInfo.height * 4; + pFileName = (const char*)"convertBGRA8.bmp"; + pConvertFormatStr = (const char*)"BGRA8"; + break; + case gvspPixelMono8: + default: + nDstBufSize = sizeof(unsigned char) * frame.frameInfo.width * frame.frameInfo.height; + pFileName = (const char*)"convertMono8.bmp"; + pConvertFormatStr = (const char*)"Mono8"; + break; + } + + pDstBuf = (unsigned char*)malloc(nDstBufSize); + if (NULL == pDstBuf) + { + printf("malloc pDstBuf failed!\n"); + return -998; + } + + // 图像转换成BGR8 + // convert image to BGR8 + memset(&stPixelConvertParam, 0, sizeof(stPixelConvertParam)); + stPixelConvertParam.nWidth = frame.frameInfo.width; + stPixelConvertParam.nHeight = frame.frameInfo.height; + stPixelConvertParam.ePixelFormat = frame.frameInfo.pixelFormat; + stPixelConvertParam.pSrcData = frame.pData; + stPixelConvertParam.nSrcDataLen = frame.frameInfo.size; + stPixelConvertParam.nPaddingX = frame.frameInfo.paddingX; + stPixelConvertParam.nPaddingY = frame.frameInfo.paddingY; + stPixelConvertParam.eBayerDemosaic = demosaicNearestNeighbor; + stPixelConvertParam.eDstPixelFormat = convertFormat; + stPixelConvertParam.pDstBuf = pDstBuf; + stPixelConvertParam.nDstBufSize = nDstBufSize; + + ret = DLLPixelConvert(devHandle, &stPixelConvertParam); + if (IMV_OK == ret) + { + printf("image convert to %s successfully! nDstDataLen (%u)\n", + pConvertFormatStr, stPixelConvertParam.nDstBufSize); + memcpy(*data, stPixelConvertParam.pDstBuf, stPixelConvertParam.nHeight * stPixelConvertParam.nWidth * 3); + printf("memcpy success! %d - %d - %d \n", *data, stPixelConvertParam.nHeight, stPixelConvertParam.nWidth); + w = stPixelConvertParam.nWidth; + h = stPixelConvertParam.nHeight; + // cv::Mat im(h, w, CV_8UC3, pDstBuf); + // cv::imwrite("/home/caowei/catkin_ws/output1.png", im); + // cv::imwrite("output1.png", im); + } + else + { + printf("image convert to %s failed! ErrorCode[%d]\n", pConvertFormatStr, ret); + } + + if (pDstBuf) + { + free(pDstBuf); + pDstBuf = NULL; + } + return ret; +} + +static void sendToRos(IMV_Frame frame) +{ + IMV_FlipImageParam stFlipImageParam; + unsigned int nChannelNum = 0; + int ret = IMV_OK; + FILE* hFile = NULL; + + memset(&stFlipImageParam, 0, sizeof(stFlipImageParam)); + + if (gvspPixelBGR8 == frame.frameInfo.pixelFormat) + { + stFlipImageParam.pSrcData = frame.pData; + stFlipImageParam.nSrcDataLen = frame.frameInfo.width * frame.frameInfo.height * BGR_CHANNEL_NUM; + stFlipImageParam.ePixelFormat = frame.frameInfo.pixelFormat; + nChannelNum = BGR_CHANNEL_NUM; + } + else + { + printf("image convert to BGR8 failed! ErrorCode[%d]\n", ret); + } + + // 向ros发送/image消息 + do + { + + } while (false); + +} + +static int ret = IMV_OK; +static unsigned int cameraIndex = 0; +static IMV_HANDLE devHandle = NULL; +static void* libHandle = NULL; +static IMV_Frame frame; + + +static DLL_EnumDevices DLLEnumDevices = NULL; +static DLL_CreateHandle DLLCreateHandle = NULL; +static DLL_DestroyHandle DLLDestroyHandle = NULL; +static DLL_Open DLLOpen = NULL; +static DLL_AttachGrabbing DLLAttachGrabbing = NULL; +static DLL_StartGrabbing DLLStartGrabbing = NULL; +static DLL_StopGrabbing DLLStopGrabbing = NULL; +static DLL_Close DLLClose = NULL; +static DLL_GetFrame DLLGetFrame = NULL; +static DLL_ReleaseFrame DLLReleaseFrame = NULL; +static DLL_ClearFrameBuffer DLLClearFrameBuffer = NULL; +static DLL_ExecuteCommandFeature DLLExecuteCommandFeature = NULL; +static DLL_SetIntFeatureValue DLLSetIntFeatureValue = NULL; +static DLL_SetDoubleFeatureValue DLLSetDoubleFeatureValue = NULL; + +// static int setGrabMode(IMV_HANDLE devHandle, bool isContious) +// { +// int ret = IMV_OK; + +// // 设置触发器 +// // Set trigger selector to FrameStart +// ret = IMV_SetEnumFeatureSymbol(devHandle, "TriggerSelector", "FrameStart"); +// if (IMV_OK != ret) +// { +// printf("Set triggerSelector value failed! ErrorCode[%d]\n", ret); +// return ret; +// } + +// if (isContious) +// { +// // 关闭触发模式 +// // Set trigger mode to Off +// ret = IMV_SetEnumFeatureSymbol(devHandle, "TriggerMode", "Off"); +// if (IMV_OK != ret) +// { +// printf("Set triggerMode value failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// } +// else +// { +// // 设置触发源为软触发 +// // Set trigger source to Software +// ret = IMV_SetEnumFeatureSymbol(devHandle, "TriggerSource", "Software"); +// if (IMV_OK != ret) +// { +// printf("Set triggerSource value failed! ErrorCode[%d]\n", ret); +// return ret; +// } + +// // 设置触发模式 +// // Set trigger mode to On +// ret = IMV_SetEnumFeatureSymbol(devHandle, "TriggerMode", "On"); +// if (IMV_OK != ret) +// { +// printf("Set triggerMode value failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// } + +// return ret; +// } + +int camera_init() +{ + int ret = IMV_OK; + // Load SDK library +#ifdef _WIN32 + libHandle = 0; +#else + printf("Load MVSDKmd.so!\n"); + libHandle = dlopen("libMVSDK.so", RTLD_LAZY); +#endif + if (NULL == libHandle) + { + printf("Load MVSDKmd.so library failed!\n"); + return IMV_ERROR; + } + + // 获取发现设备接口函数地址 + // Get discover camera interface address + DLLEnumDevices = (DLL_EnumDevices)dlsym(libHandle, "IMV_EnumDevices"); + if (NULL == DLLEnumDevices) + { + printf("Get IMV_EnumDevices address failed!\n"); + return IMV_ERROR; + } + + + // 获取发现设备接口函数地址 + // Get discover camera interface address + //DLL_EnumDevices DLLEnumDevices = (DLL_EnumDevices)dlsym(libHandle, "IMV_EnumDevices"); + //if (NULL == DLLEnumDevices) + //{ + // printf("Get IMV_EnumDevices address failed!\n"); + // return 0; + //} + + // 获取创建设备句柄接口函数地址 + // Get create Device Handle interface address + DLLCreateHandle = (DLL_CreateHandle)dlsym(libHandle, "IMV_CreateHandle"); + if (NULL == DLLCreateHandle) + { + printf("Get IMV_CreateHandle address failed!\n"); + return IMV_ERROR; + } + + // 获取销毁设备句柄接口函数地址 + // Get destroy Device Handle interface address + DLLDestroyHandle = (DLL_DestroyHandle)dlsym(libHandle, "IMV_DestroyHandle"); + if (NULL == DLLDestroyHandle) + { + printf("Get IMV_DestroyHandle address failed!\n"); + return IMV_ERROR; + } + + // 获取打开相机接口函数地址 + // Get open camera interface address + DLLOpen = (DLL_Open)dlsym(libHandle, "IMV_Open"); + if (NULL == DLLOpen) + { + printf("Get IMV_Open address failed!\n"); + return IMV_ERROR; + } + + // 获取注册数据帧回调接口函数地址 + // Get register data frame callback interface address + DLLAttachGrabbing = (DLL_AttachGrabbing)dlsym(libHandle, "IMV_AttachGrabbing"); + if (NULL == DLLAttachGrabbing) + { + printf("Get IMV_AttachGrabbing address failed!\n"); + return IMV_ERROR; + } + + // 获取开始拉流接口函数地址 + // Get start grabbing interface address + DLLStartGrabbing = (DLL_StartGrabbing)dlsym(libHandle, "IMV_StartGrabbing"); + if (NULL == DLLStartGrabbing) + { + printf("Get IMV_StartGrabbing address failed!\n"); + return IMV_ERROR; + } + + // 获取停止拉流接口函数地址 + // Get stop grabbing interface address + DLLStopGrabbing = (DLL_StopGrabbing)dlsym(libHandle, "IMV_StopGrabbing"); + if (NULL == DLLStopGrabbing) + { + printf("Get IMV_StopGrabbing address failed!\n"); + return IMV_ERROR; + } + + // 获取 + // 获取关闭相机接口函数地址 + // Get close camera interface address + DLLClose = (DLL_Close)dlsym(libHandle, "IMV_Close"); + if (NULL == DLLClose) + { + printf("Get IMV_Close address failed!\n"); + return IMV_ERROR; + } + + // 获取获取一帧图像函数地址 + DLLGetFrame = (DLL_GetFrame)dlsym(libHandle, "IMV_GetFrame"); + if (NULL == DLLGetFrame) + { + printf("Get IMV_GetFrame address failed!\n"); + return IMV_ERROR; + } + + DLLReleaseFrame = (DLL_ReleaseFrame)dlsym(libHandle, "IMV_ReleaseFrame"); + if (NULL == DLLReleaseFrame) + { + printf("Get IMV_ReleaseFrame address failed!\n"); + return IMV_ERROR; + } + + DLLClearFrameBuffer = (DLL_ClearFrameBuffer)dlsym(libHandle, "IMV_ClearFrameBuffer"); + if (NULL == DLLClearFrameBuffer) + { + printf("Get IMV_ClearFrameBuffer address failed!\n"); + return IMV_ERROR; + } + + DLLExecuteCommandFeature = (DLL_ExecuteCommandFeature)dlsym(libHandle, "IMV_ExecuteCommandFeature"); + if (NULL == DLLExecuteCommandFeature) + { + printf("Get IMV_ExecuteCommandFeature address failed!\n"); + return IMV_ERROR; + } + + DLLSetIntFeatureValue = (DLL_SetIntFeatureValue)dlsym(libHandle, "IMV_SetIntFeatureValue"); + if (NULL == DLLSetIntFeatureValue) + { + printf("Get IMV_SetIntFeatureValue address failed!\n"); + return IMV_ERROR; + } + + DLLSetDoubleFeatureValue = (DLL_SetDoubleFeatureValue)dlsym(libHandle, "IMV_SetDoubleFeatureValue"); + if (NULL == DLLSetDoubleFeatureValue) + { + printf("Get IMV_SetDoubleFeatureValue address failed!\n"); + return IMV_ERROR; + } + + ////////////////////// 检查接口结束 + // 发现设备 + // discover camera + IMV_DeviceList deviceInfoList; + ret = DLLEnumDevices(&deviceInfoList, interfaceTypeAll); + if (IMV_OK != ret) + { + printf("Enumeration devices failed! ErrorCode[%d]\n", ret); + return ret; + } + + if (deviceInfoList.nDevNum < 1) + { + printf("no camera\n"); + return IMV_ERROR; + } + + // 打印相机基本信息(序号,类型,制造商信息,型号,序列号,用户自定义ID,IP地址) + // Print camera info (Index, Type, Vendor, Model, Serial number, DeviceUserID, IP Address) + + displayDeviceInfo(deviceInfoList); + // 选择需要连接的相机 + // Select one camera to connect to + // cameraIndex = selectDevice(deviceInfoList.nDevNum); + cameraIndex = 0; // 第一个相机 + + // 创建设备句柄 + // Create Device Handle + ret = DLLCreateHandle(&devHandle, modeByIndex, (void*)&cameraIndex); + if (IMV_OK != ret) + { + printf("Create devHandle failed! ErrorCode[%d]\n", ret); + return IMV_ERROR; + } + + return ret; +} + +int camera_start(int epx_time) +{ + int ret = IMV_OK; + + // 打开相机 + ret = DLLOpen(devHandle); + if (IMV_OK != ret) + { + printf("Open camera failed! ErrorCode[%d]\n", ret); + return ret; + } + + //设置软触发模式 + ret = setSoftTriggerConf(libHandle, devHandle); + if (IMV_OK != ret) + { + printf("setSoftTriggerConf failed! ErrorCode[%d]\n", ret); + return ret; + } + + + ret = DLLSetIntFeatureValue(devHandle, "Width", 9344); + if (IMV_OK != ret) + { + printf("Set feature value Width failed! ErrorCode[%d]\n", ret); + return ret; + } + + ret = DLLSetIntFeatureValue(devHandle, "Height", 7000); + if (IMV_OK != ret) + { + printf("Set feature value Height failed! ErrorCode[%d]\n", ret); + return ret; + } + + ret = DLLSetIntFeatureValue(devHandle, "OffsetX", 0); + if (IMV_OK != ret) + { + printf("Set feature value OffsetX failed! ErrorCode[%d]\n", ret); + return ret; + } + + ret = DLLSetIntFeatureValue(devHandle, "OffsetY", 0); + if (IMV_OK != ret) + { + printf("Set feature value OffsetY failed! ErrorCode[%d]\n", ret); + return ret; + } + + // 设置属性值曝光 + // Set feature value + ret = DLLSetDoubleFeatureValue(devHandle, "ExposureTime", epx_time); + if (IMV_OK != ret) + { + printf("Set feature value failed! ErrorCode[%d]\n", ret); + return ret; + } + + // // 设置软触发模式 + // ret = setGrabMode(devHandle, false); + // if (IMV_OK != ret) + // { + // printf("Set grabbing mode failed! ErrorCode[%d]\n", ret); + // return ret; + // } + + // 开始拉流 + ret = DLLStartGrabbing(devHandle); + if (IMV_OK != ret) + { + printf("Start grabbing failed! ErrorCode[%d]\n", ret); + return ret; + } + + return ret; +} + + +int camera_cap(void** data, int& w, int& h, int time_out) +{ + int ret = IMV_OK; + sleep(500); + // 清除帧数据缓存 + ret = DLLClearFrameBuffer(devHandle); + if (IMV_OK != ret) + { + printf("Clear frame buffer failed! ErrorCode[%d]\n", ret); + return ret; + } + + /////////////////////////获取一帧图像//////////////////////////// + // 执行软触发 + // ret = DLLExecuteCommandFeature(devHandle, "TriggerSoftware"); + // if (IMV_OK != ret) + // { + // printf("Execute TriggerSoftware failed! ErrorCode[%d]\n", ret); + // return ret; + // } + + // sleep(500); + + // 获取一帧图像, TIMEOUT 5000ms + ret = DLLGetFrame(devHandle, &frame, time_out); + // ret = DLLGetFrame(devHandle, &frame, 5000); + // if (IMV_OK != ret && -101 != ret) + if (IMV_OK != ret) + { + printf("Get frame failed! ErrorCode[%d]\n", ret); + return ret; + } + + printf("width %d\n", frame.frameInfo.width); + printf("Height %d\n", frame.frameInfo.height); + + ret = imageConvert(libHandle, devHandle, frame, gvspPixelBGR8, data, w, h); + if (IMV_OK != ret) + { + printf("imageConvert failed! ErrorCode[%d]\n", ret); + return ret; + } + + // printf("11111111111111\n", ret); + // cv::Mat im(frame.frameInfo.height, frame.frameInfo.width, CV_8UC3, frame.pData); + // cv::imwrite("/home/caowei/catkin_ws/output.png", im); + // cv::imwrite("output.png", im); + // printf("22222222222222\n", ret); + // // 向ros送 /image消息 + // sendToRos(frame); + // 释放图像缓存 + ret = DLLReleaseFrame(devHandle, &frame); + if (IMV_OK != ret) + { + printf("Release frame failed! ErrorCode[%d]\n", ret); + return ret; + } + sleep(500); + //////////////////////////////////////////////////////////////// + + // // 取图2秒 + // // get frame 2 seconds + // sleep(2000); + // 停止拉流 + // Stop grabbing + + // 等待流碎片走完 + // sleep(2000); +} + +int camera_stop() +{ + int ret = IMV_OK; + ret = DLLStopGrabbing(devHandle); + if (IMV_OK != ret) + { + printf("Stop grabbing failed! ErrorCode[%d]\n", ret); + return ret; + } + return ret; + + + // 关闭相机 + // Close camera + ret = DLLClose(devHandle); + if (IMV_OK != ret) + { + printf("Close camera failed! ErrorCode[%d]\n", ret); + return ret; + } + + // 待修改 + + // 销毁设备句柄 + // Destroy Device Handle + if (NULL != devHandle) + { + // 销毁设备句柄 + // Destroy Device Handle + DLLDestroyHandle(devHandle); + } + + if (NULL != libHandle) + { + dlclose(libHandle); + } + + // printf("end...\n"); + return ret; +} + +int main() +{ + char* data = (char*)malloc(9344*7000*3); + int w, h; + + ret = camera_init(); + if (ret != IMV_OK) return ret; + + ret = camera_start(12 * 10000); + if (ret != IMV_OK) return ret; + + int index = 5; + while (true) + { + ret = camera_cap((void**) &data, w, h, 5000); + if (ret != IMV_OK) return ret; + + cv::Mat im(h,w, CV_8UC3, data); + // cv::imwrite("/home/caowei/catkin_ws/output.png", im); + cv::imwrite("output.png", im); + index --; + if (index == 0) + break; + } + + // ret = camera_cap((void**) &data, w, h, 5000); + // if (ret != IMV_OK) return ret; + + // cv::Mat im(h,w, CV_8UC3, data); + // // cv::imwrite("/home/caowei/catkin_ws/output.png", im); + // cv::imwrite("output.png", im); + + // ret = camera_cap((void**) & data, w, h, 5000); + // if (ret != IMV_OK) return ret; + + // cv::Mat im2(h,w, CV_8UC3, data); + // // cv::imwrite("/home/caowei/catkin_ws/output2.png", im2); + // cv::imwrite("output2.png", im2); + + camera_stop(); + + if (data) + free(data); + return ret; +} +// +// +//int main() +//{ +// int ret = IMV_OK; +// unsigned int cameraIndex = 0; +// IMV_HANDLE devHandle = NULL; +// void* libHandle = NULL; +// DLL_DestroyHandle DLLDestroyHandle = NULL; +// IMV_Frame frame; +// +// // 加载SDK库 +// // Load SDK library +//#ifdef _WIN32 +// libHandle = 0; +//#else +// libHandle = dlopen("libMVSDK.so", RTLD_LAZY); +//#endif +// +// if (NULL == libHandle) +// { +// printf("Load MVSDKmd.dll library failed!\n"); +// return 0; +// } +// +// // 获取发现设备接口函数地址 +// // Get discover camera interface address +// DLLEnumDevices = (DLL_EnumDevices)dlsym(libHandle, "IMV_EnumDevices"); +// if (NULL == DLLEnumDevices) +// { +// printf("Get IMV_EnumDevices address failed!\n"); +// return 0; +// } +// +// // 获取创建设备句柄接口函数地址 +// // Get create Device Handle interface address +// DLLCreateHandle = (DLL_CreateHandle)dlsym(libHandle, "IMV_CreateHandle"); +// if (NULL == DLLCreateHandle) +// { +// printf("Get IMV_CreateHandle address failed!\n"); +// return 0; +// } +// +// // 获取销毁设备句柄接口函数地址 +// // Get destroy Device Handle interface address +// DLLDestroyHandle = (DLL_DestroyHandle)dlsym(libHandle, "IMV_DestroyHandle"); +// if (NULL == DLLDestroyHandle) +// { +// printf("Get IMV_DestroyHandle address failed!\n"); +// return 0; +// } +// +// // 获取打开相机接口函数地址 +// // Get open camera interface address +// DLLOpen = (DLL_Open)dlsym(libHandle, "IMV_Open"); +// if (NULL == DLLOpen) +// { +// printf("Get IMV_Open address failed!\n"); +// return 0; +// } +// +// // 获取注册数据帧回调接口函数地址 +// // Get register data frame callback interface address +// DLLAttachGrabbing = (DLL_AttachGrabbing)dlsym(libHandle, "IMV_AttachGrabbing"); +// if (NULL == DLLAttachGrabbing) +// { +// printf("Get IMV_AttachGrabbing address failed!\n"); +// return 0; +// } +// +// // 获取开始拉流接口函数地址 +// // Get start grabbing interface address +// DLLStartGrabbing = (DLL_StartGrabbing)dlsym(libHandle, "IMV_StartGrabbing"); +// if (NULL == DLLStartGrabbing) +// { +// printf("Get IMV_StartGrabbing address failed!\n"); +// return 0; +// } +// +// // 获取停止拉流接口函数地址 +// // Get stop grabbing interface address +// DLLStopGrabbing = (DLL_StopGrabbing)dlsym(libHandle, "IMV_StopGrabbing"); +// if (NULL == DLLStopGrabbing) +// { +// printf("Get IMV_StopGrabbing address failed!\n"); +// return 0; +// } +// +// // 获取 +// +// // 获取关闭相机接口函数地址 +// // Get close camera interface address +// DLLClose = (DLL_Close)dlsym(libHandle, "IMV_Close"); +// if (NULL == DLLClose) +// { +// printf("Get IMV_Close address failed!\n"); +// return 0; +// } +// +// // 获取获取一帧图像函数地址 +// DLLGetFrame = (DLL_GetFrame)dlsym(libHandle, "IMV_GetFrame"); +// if (NULL == DLLGetFrame) +// { +// printf("Get IMV_GetFrame address failed!\n"); +// return 0; +// } +// +// DLLReleaseFrame = (DLL_ReleaseFrame)dlsym(libHandle, "IMV_ReleaseFrame"); +// if (NULL == DLLReleaseFrame) +// { +// printf("Get IMV_ReleaseFrame address failed!\n"); +// return 0; +// } +// +// DLLClearFrameBuffer = (DLL_ClearFrameBuffer)dlsym(libHandle, "IMV_ClearFrameBuffer"); +// if (NULL == DLLClearFrameBuffer) +// { +// printf("Get IMV_ClearFrameBuffer address failed!\n"); +// return 0; +// } +// +// DLLExecuteCommandFeature = (DLL_ExecuteCommandFeature)dlsym(libHandle, "IMV_ExecuteCommandFeature"); +// if (NULL == DLLExecuteCommandFeature) +// { +// printf("Get IMV_ExecuteCommandFeature address failed!\n"); +// return 0; +// } +// +// DLLSetIntFeatureValue = (DLL_SetIntFeatureValue)dlsym(libHandle, "IMV_SetIntFeatureValue"); +// if (NULL == DLLSetIntFeatureValue) +// { +// printf("Get IMV_SetIntFeatureValue address failed!\n"); +// return 0; +// } +// +// DLLSetDoubleFeatureValue = (DLL_SetDoubleFeatureValue)dlsym(libHandle, "IMV_SetDoubleFeatureValue"); +// if (NULL == DLLSetDoubleFeatureValue) +// { +// printf("Get IMV_SetDoubleFeatureValue address failed!\n"); +// return 0; +// } +// +// +//////////////////////// 检查接口结束 +// // 发现设备 +// // discover camera +// IMV_DeviceList deviceInfoList; +// ret = DLLEnumDevices(&deviceInfoList, interfaceTypeAll); +// if (IMV_OK != ret) +// { +// printf("Enumeration devices failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// +// if (deviceInfoList.nDevNum < 1) +// { +// printf("no camera\n"); +// return 0; +// } +// +// // 打印相机基本信息(序号,类型,制造商信息,型号,序列号,用户自定义ID,IP地址) +// // Print camera info (Index, Type, Vendor, Model, Serial number, DeviceUserID, IP Address) +// +// displayDeviceInfo(deviceInfoList); +// // 选择需要连接的相机 +// // Select one camera to connect to +// // cameraIndex = selectDevice(deviceInfoList.nDevNum); +// cameraIndex = 0; // 第一个相机 +// +// // 创建设备句柄 +// // Create Device Handle +// ret = DLLCreateHandle(&devHandle, modeByIndex, (void*)&cameraIndex); +// if (IMV_OK != ret) +// { +// printf("Create devHandle failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// +// // 打开相机 +// ret = DLLOpen(devHandle); +// if (IMV_OK != ret) +// { +// printf("Open camera failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// +// // 设置软触发模式 +// ret = setSoftTriggerConf(libHandle, devHandle); +// if (IMV_OK != ret) +// { +// printf("setSoftTriggerConf failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// +// ret = DLLSetIntFeatureValue(devHandle, "Width", 9344); +// if (IMV_OK != ret) +// { +// printf("Set feature value Width failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// +// ret = DLLSetIntFeatureValue(devHandle, "Height", 7000); +// if (IMV_OK != ret) +// { +// printf("Set feature value Height failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// +// ret = DLLSetIntFeatureValue(devHandle, "OffsetX", 0); +// if (IMV_OK != ret) +// { +// printf("Set feature value OffsetX failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// +// ret = DLLSetIntFeatureValue(devHandle, "OffsetY", 0); +// if (IMV_OK != ret) +// { +// printf("Set feature value OffsetY failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// +// // 设置属性值曝光 +// // Set feature value +// ret = DLLSetDoubleFeatureValue(devHandle, "ExposureTime", 12*10000); +// if (IMV_OK != ret) +// { +// printf("Set feature value failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// +// // // 非多线程,不需要注册回调 +// // // 注册数据帧回调函数 +// // // Register data frame callback function +// // ret = DLLAttachGrabbing(devHandle, onGetFrame, NULL); +// // if (IMV_OK != ret) +// // { +// // printf("Attach grabbing failed! ErrorCode[%d]\n", ret); +// // return 0; +// // } +// +// // 开始拉流 +// // Start grabbing +// ret = DLLStartGrabbing(devHandle); +// if (IMV_OK != ret) +// { +// printf("Start grabbing failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// +// /////////////////////////获取一帧图像//////////////////////////// +// +// // 清除帧数据缓存 +// // Clear frame buffer +// ret = DLLClearFrameBuffer(devHandle); +// if (IMV_OK != ret) +// { +// printf("Clear frame buffer failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// +// // 执行软触发 +// // Execute soft trigger +// ret = DLLExecuteCommandFeature(devHandle, "TriggerSoftware"); +// if (IMV_OK != ret) +// { +// printf("Execute TriggerSoftware failed! ErrorCode[%d]\n", ret); +// return ret; +// } +// +// +// // 获取一帧图像, TIMEOUT 5000ms +// ret = DLLGetFrame(devHandle, &frame, 5000); +// if (IMV_OK != ret) +// { +// printf("Get frame failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// +// printf("width %d\n", frame.frameInfo.width); +// printf("Height %d\n", frame.frameInfo.height); +// +// ret = imageConvert(libHandle, devHandle, frame, gvspPixelBGR8); +// if (IMV_OK != ret) +// { +// printf("imageConvert failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// // printf("11111111111111\n", ret); +// // cv::Mat im(frame.frameInfo.width, frame.frameInfo.height, CV_8UC3, frame.pData); +// // cv::imwrite("/home/caowei/catkin_ws/output.png", im); +// // cv::imwrite("output.png", im); +// // printf("22222222222222\n", ret); +// // // 向ros送 /image消息 +// // sendToRos(frame); +// +// // 释放图像缓存 +// ret = DLLReleaseFrame(devHandle, &frame); +// if (IMV_OK != ret) +// { +// printf("Release frame failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// //////////////////////////////////////////////////////////////// +// +// // // 取图2秒 +// // // get frame 2 seconds +// // sleep(2000); +// +// // 停止拉流 +// // Stop grabbing +// ret = DLLStopGrabbing(devHandle); +// if (IMV_OK != ret) +// { +// printf("Stop grabbing failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// +// // 关闭相机 +// // Close camera +// ret = DLLClose(devHandle); +// if (IMV_OK != ret) +// { +// printf("Close camera failed! ErrorCode[%d]\n", ret); +// return 0; +// } +// +// // 销毁设备句柄 +// // Destroy Device Handle +// if (NULL != devHandle) +// { +// // 销毁设备句柄 +// // Destroy Device Handle +// DLLDestroyHandle(devHandle); +// } +// +// if (NULL != libHandle) +// { +// dlclose(libHandle); +// } +// +// printf("end...\n"); +// // getchar(); +// +// return 0; +//} + +} \ No newline at end of file diff --git a/CameraDriver.h b/CameraDriver.h new file mode 100644 index 0000000..1cc0acb --- /dev/null +++ b/CameraDriver.h @@ -0,0 +1,99 @@ +#include +#include +#include +#ifndef _WIN32 +#include +#include +#include +#endif // !_WIN32 +#include "IMVApi.h" +#include "IMVDefines.h" + +#include +#include + +extern "C"{ + +#define MONO_CHANNEL_NUM 1 +#define RGB_CHANNEL_NUM 3 +#define BGR_CHANNEL_NUM 3 + +#define sleep(ms) usleep(1000 * ms) + +typedef const char* (IMV_CALL * DLL_GetVersion) (); +typedef int (IMV_CALL * DLL_EnumDevices) (OUT IMV_DeviceList *pDeviceList, IN unsigned int interfaceType); +typedef int (IMV_CALL * DLL_EnumDevicesByUnicast) (OUT IMV_DeviceList *pDeviceList, IN const char* pIpAddress); +typedef int (IMV_CALL * DLL_CreateHandle) (OUT IMV_HANDLE* handle, IN IMV_ECreateHandleMode mode, IN void* pIdentifier); +typedef int (IMV_CALL * DLL_DestroyHandle) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_GetDeviceInfo) (IN IMV_HANDLE handle, OUT IMV_DeviceInfo *pDevInfo); +typedef int (IMV_CALL * DLL_Open) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_OpenEx) (IN IMV_HANDLE handle, IN IMV_ECameraAccessPermission accessPermission); +typedef bool (IMV_CALL * DLL_IsOpen) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_Close) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_GIGE_ForceIpAddress) (IN IMV_HANDLE handle, IN const char* pIpAddress, IN const char* pSubnetMask, IN const char* pGateway); +typedef int (IMV_CALL * DLL_GIGE_GetAccessPermission) (IN IMV_HANDLE handle, IMV_ECameraAccessPermission* pAccessPermission); +typedef int (IMV_CALL * DLL_GIGE_SetAnswerTimeout) (IN IMV_HANDLE handle, IN unsigned int timeout); +typedef int (IMV_CALL * DLL_DownLoadGenICamXML) (IN IMV_HANDLE handle, IN const char* pFullFileName); +typedef int (IMV_CALL * DLL_SaveDeviceCfg) (IN IMV_HANDLE handle, IN const char* pFullFileName); +typedef int (IMV_CALL * DLL_LoadDeviceCfg) (IN IMV_HANDLE handle, IN const char* pFullFileName, OUT IMV_ErrorList* pErrorList); +typedef int (IMV_CALL * DLL_WriteUserPrivateData) (IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength); +typedef int (IMV_CALL * DLL_ReadUserPrivateData) (IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength); +typedef int (IMV_CALL * DLL_WriteUARTData) (IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength); +typedef int (IMV_CALL * DLL_ReadUARTData) (IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength); +typedef int (IMV_CALL * DLL_SubscribeConnectArg) (IN IMV_HANDLE handle, IN IMV_ConnectCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_SubscribeParamUpdateArg) (IN IMV_HANDLE handle, IN IMV_ParamUpdateCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_SubscribeStreamArg) (IN IMV_HANDLE handle, IN IMV_StreamCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_SubscribeMsgChannelArg) (IN IMV_HANDLE handle, IN IMV_MsgChannelCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_SetBufferCount) (IN IMV_HANDLE handle, IN unsigned int nSize); +typedef int (IMV_CALL * DLL_ClearFrameBuffer) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_GIGE_SetInterPacketTimeout) (IN IMV_HANDLE handle, IN unsigned int nTimeout); +typedef int (IMV_CALL * DLL_GIGE_SetSingleResendMaxPacketNum) (IN IMV_HANDLE handle, IN unsigned int maxPacketNum); +typedef int (IMV_CALL * DLL_GIGE_SetMaxLostPacketNum) (IN IMV_HANDLE handle, IN unsigned int maxLostPacketNum); +typedef int (IMV_CALL * DLL_StartGrabbing) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_StartGrabbingEx) (IN IMV_HANDLE handle, IN uint64_t maxImagesGrabbed, IN IMV_EGrabStrategy strategy); +typedef bool (IMV_CALL * DLL_IsGrabbing) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_StopGrabbing) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_AttachGrabbing) (IN IMV_HANDLE handle, IN IMV_FrameCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_GetFrame) (IN IMV_HANDLE handle, OUT IMV_Frame* pFrame, IN unsigned int timeoutMS); +typedef int (IMV_CALL * DLL_ReleaseFrame) (IN IMV_HANDLE handle, IN IMV_Frame* pFrame); +typedef int (IMV_CALL * DLL_CloneFrame) (IN IMV_HANDLE handle, IN IMV_Frame* pFrame, OUT IMV_Frame* pCloneFrame); +typedef int (IMV_CALL * DLL_GetChunkDataByIndex) (IN IMV_HANDLE handle, IN IMV_Frame* pFrame, IN unsigned int index, OUT IMV_ChunkDataInfo *pChunkDataInfo); +typedef int (IMV_CALL * DLL_GetStatisticsInfo) (IN IMV_HANDLE handle, OUT IMV_StreamStatisticsInfo* pStreamStatsInfo); +typedef int (IMV_CALL * DLL_ResetStatisticsInfo) (IN IMV_HANDLE handle); +typedef bool (IMV_CALL * DLL_FeatureIsAvailable) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef bool (IMV_CALL * DLL_FeatureIsReadable) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef bool (IMV_CALL * DLL_FeatureIsWriteable) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef bool (IMV_CALL * DLL_FeatureIsStreamable) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef bool (IMV_CALL * DLL_FeatureIsValid) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef int (IMV_CALL * DLL_GetIntFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); +typedef int (IMV_CALL * DLL_GetIntFeatureMin) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); +typedef int (IMV_CALL * DLL_GetIntFeatureMax) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); +typedef int (IMV_CALL * DLL_GetIntFeatureInc) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); +typedef int (IMV_CALL * DLL_SetIntFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN int64_t intValue); +typedef int (IMV_CALL * DLL_GetDoubleFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); +typedef int (IMV_CALL * DLL_GetDoubleFeatureMin) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); +typedef int (IMV_CALL * DLL_GetDoubleFeatureMax) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); +typedef int (IMV_CALL * DLL_SetDoubleFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN double doubleValue); +typedef int (IMV_CALL * DLL_GetBoolFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT bool* pBoolValue); +typedef int (IMV_CALL * DLL_SetBoolFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN bool boolValue); +typedef int (IMV_CALL * DLL_GetEnumFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT uint64_t* pEnumValue); +typedef int (IMV_CALL * DLL_SetEnumFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN uint64_t enumValue); +typedef int (IMV_CALL * DLL_GetEnumFeatureSymbol) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pEnumSymbol); +typedef int (IMV_CALL * DLL_SetEnumFeatureSymbol) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pEnumSymbol); +typedef int (IMV_CALL * DLL_GetEnumFeatureEntryNum) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT unsigned int* pEntryNum); +typedef int (IMV_CALL * DLL_GetEnumFeatureEntrys) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_EnumEntryList* pEnumEntryList); +typedef int (IMV_CALL * DLL_GetStringFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pStringValue); +typedef int (IMV_CALL * DLL_SetStringFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pStringValue); +typedef int (IMV_CALL * DLL_ExecuteCommandFeature) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef int (IMV_CALL * DLL_PixelConvert) (IN IMV_HANDLE handle, IN_OUT IMV_PixelConvertParam* pstPixelConvertParam); +typedef int (IMV_CALL * DLL_OpenRecord) (IN IMV_HANDLE handle, IN IMV_RecordParam *pstRecordParam); +typedef int (IMV_CALL * DLL_InputOneFrame) (IN IMV_HANDLE handle, IN IMV_RecordFrameInfoParam *pstRecordFrameInfoParam); +typedef int (IMV_CALL * DLL_CloseRecord) (IN IMV_HANDLE handle); + + +int camera_init(); +int camera_start(int epx_time = 12 * 10000); +int camera_stop(); +int camera_cap(void** data, int& w, int& h, int time_out); + +} \ No newline at end of file diff --git a/CameraPublisher.cpp.bak b/CameraPublisher.cpp.bak new file mode 100644 index 0000000..0dc3d4c --- /dev/null +++ b/CameraPublisher.cpp.bak @@ -0,0 +1,798 @@ +#include +#include +#include +#include +#include +#include +#include "IMVApi.h" +#include "IMVDefines.h" + +#include +#include + +extern "C"{ + +#define MONO_CHANNEL_NUM 1 +#define RGB_CHANNEL_NUM 3 +#define BGR_CHANNEL_NUM 3 + +#define sleep(ms) usleep(1000 * ms) + +typedef const char* (IMV_CALL * DLL_GetVersion) (); +typedef int (IMV_CALL * DLL_EnumDevices) (OUT IMV_DeviceList *pDeviceList, IN unsigned int interfaceType); +typedef int (IMV_CALL * DLL_EnumDevicesByUnicast) (OUT IMV_DeviceList *pDeviceList, IN const char* pIpAddress); +typedef int (IMV_CALL * DLL_CreateHandle) (OUT IMV_HANDLE* handle, IN IMV_ECreateHandleMode mode, IN void* pIdentifier); +typedef int (IMV_CALL * DLL_DestroyHandle) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_GetDeviceInfo) (IN IMV_HANDLE handle, OUT IMV_DeviceInfo *pDevInfo); +typedef int (IMV_CALL * DLL_Open) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_OpenEx) (IN IMV_HANDLE handle, IN IMV_ECameraAccessPermission accessPermission); +typedef bool (IMV_CALL * DLL_IsOpen) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_Close) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_GIGE_ForceIpAddress) (IN IMV_HANDLE handle, IN const char* pIpAddress, IN const char* pSubnetMask, IN const char* pGateway); +typedef int (IMV_CALL * DLL_GIGE_GetAccessPermission) (IN IMV_HANDLE handle, IMV_ECameraAccessPermission* pAccessPermission); +typedef int (IMV_CALL * DLL_GIGE_SetAnswerTimeout) (IN IMV_HANDLE handle, IN unsigned int timeout); +typedef int (IMV_CALL * DLL_DownLoadGenICamXML) (IN IMV_HANDLE handle, IN const char* pFullFileName); +typedef int (IMV_CALL * DLL_SaveDeviceCfg) (IN IMV_HANDLE handle, IN const char* pFullFileName); +typedef int (IMV_CALL * DLL_LoadDeviceCfg) (IN IMV_HANDLE handle, IN const char* pFullFileName, OUT IMV_ErrorList* pErrorList); +typedef int (IMV_CALL * DLL_WriteUserPrivateData) (IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength); +typedef int (IMV_CALL * DLL_ReadUserPrivateData) (IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength); +typedef int (IMV_CALL * DLL_WriteUARTData) (IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength); +typedef int (IMV_CALL * DLL_ReadUARTData) (IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength); +typedef int (IMV_CALL * DLL_SubscribeConnectArg) (IN IMV_HANDLE handle, IN IMV_ConnectCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_SubscribeParamUpdateArg) (IN IMV_HANDLE handle, IN IMV_ParamUpdateCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_SubscribeStreamArg) (IN IMV_HANDLE handle, IN IMV_StreamCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_SubscribeMsgChannelArg) (IN IMV_HANDLE handle, IN IMV_MsgChannelCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_SetBufferCount) (IN IMV_HANDLE handle, IN unsigned int nSize); +typedef int (IMV_CALL * DLL_ClearFrameBuffer) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_GIGE_SetInterPacketTimeout) (IN IMV_HANDLE handle, IN unsigned int nTimeout); +typedef int (IMV_CALL * DLL_GIGE_SetSingleResendMaxPacketNum) (IN IMV_HANDLE handle, IN unsigned int maxPacketNum); +typedef int (IMV_CALL * DLL_GIGE_SetMaxLostPacketNum) (IN IMV_HANDLE handle, IN unsigned int maxLostPacketNum); +typedef int (IMV_CALL * DLL_StartGrabbing) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_StartGrabbingEx) (IN IMV_HANDLE handle, IN uint64_t maxImagesGrabbed, IN IMV_EGrabStrategy strategy); +typedef bool (IMV_CALL * DLL_IsGrabbing) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_StopGrabbing) (IN IMV_HANDLE handle); +typedef int (IMV_CALL * DLL_AttachGrabbing) (IN IMV_HANDLE handle, IN IMV_FrameCallBack proc, IN void* pUser); +typedef int (IMV_CALL * DLL_GetFrame) (IN IMV_HANDLE handle, OUT IMV_Frame* pFrame, IN unsigned int timeoutMS); +typedef int (IMV_CALL * DLL_ReleaseFrame) (IN IMV_HANDLE handle, IN IMV_Frame* pFrame); +typedef int (IMV_CALL * DLL_CloneFrame) (IN IMV_HANDLE handle, IN IMV_Frame* pFrame, OUT IMV_Frame* pCloneFrame); +typedef int (IMV_CALL * DLL_GetChunkDataByIndex) (IN IMV_HANDLE handle, IN IMV_Frame* pFrame, IN unsigned int index, OUT IMV_ChunkDataInfo *pChunkDataInfo); +typedef int (IMV_CALL * DLL_GetStatisticsInfo) (IN IMV_HANDLE handle, OUT IMV_StreamStatisticsInfo* pStreamStatsInfo); +typedef int (IMV_CALL * DLL_ResetStatisticsInfo) (IN IMV_HANDLE handle); +typedef bool (IMV_CALL * DLL_FeatureIsAvailable) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef bool (IMV_CALL * DLL_FeatureIsReadable) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef bool (IMV_CALL * DLL_FeatureIsWriteable) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef bool (IMV_CALL * DLL_FeatureIsStreamable) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef bool (IMV_CALL * DLL_FeatureIsValid) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef int (IMV_CALL * DLL_GetIntFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); +typedef int (IMV_CALL * DLL_GetIntFeatureMin) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); +typedef int (IMV_CALL * DLL_GetIntFeatureMax) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); +typedef int (IMV_CALL * DLL_GetIntFeatureInc) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); +typedef int (IMV_CALL * DLL_SetIntFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN int64_t intValue); +typedef int (IMV_CALL * DLL_GetDoubleFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); +typedef int (IMV_CALL * DLL_GetDoubleFeatureMin) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); +typedef int (IMV_CALL * DLL_GetDoubleFeatureMax) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); +typedef int (IMV_CALL * DLL_SetDoubleFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN double doubleValue); +typedef int (IMV_CALL * DLL_GetBoolFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT bool* pBoolValue); +typedef int (IMV_CALL * DLL_SetBoolFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN bool boolValue); +typedef int (IMV_CALL * DLL_GetEnumFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT uint64_t* pEnumValue); +typedef int (IMV_CALL * DLL_SetEnumFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN uint64_t enumValue); +typedef int (IMV_CALL * DLL_GetEnumFeatureSymbol) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pEnumSymbol); +typedef int (IMV_CALL * DLL_SetEnumFeatureSymbol) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pEnumSymbol); +typedef int (IMV_CALL * DLL_GetEnumFeatureEntryNum) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT unsigned int* pEntryNum); +typedef int (IMV_CALL * DLL_GetEnumFeatureEntrys) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_EnumEntryList* pEnumEntryList); +typedef int (IMV_CALL * DLL_GetStringFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pStringValue); +typedef int (IMV_CALL * DLL_SetStringFeatureValue) (IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pStringValue); +typedef int (IMV_CALL * DLL_ExecuteCommandFeature) (IN IMV_HANDLE handle, IN const char* pFeatureName); +typedef int (IMV_CALL * DLL_PixelConvert) (IN IMV_HANDLE handle, IN_OUT IMV_PixelConvertParam* pstPixelConvertParam); +typedef int (IMV_CALL * DLL_OpenRecord) (IN IMV_HANDLE handle, IN IMV_RecordParam *pstRecordParam); +typedef int (IMV_CALL * DLL_InputOneFrame) (IN IMV_HANDLE handle, IN IMV_RecordFrameInfoParam *pstRecordFrameInfoParam); +typedef int (IMV_CALL * DLL_CloseRecord) (IN IMV_HANDLE handle); + + + +// ***********开始: 这部分处理与SDK操作相机无关,用于显示设备列表 *********** +// ***********BEGIN: These functions are not related to API call and used to display device info*********** +// 数据帧回调函数 +// Data frame callback function +static void onGetFrame(IMV_Frame* pFrame, void* pUser) +{ + if (pFrame == NULL) + { + printf("pFrame is NULL\n"); + return; + } + + printf("Get frame blockId = %llu\n", pFrame->frameInfo.blockId); + + return; +} + +static void displayDeviceInfo(IMV_DeviceList deviceInfoList) +{ + IMV_DeviceInfo* pDevInfo = NULL; + unsigned int cameraIndex = 0; + char vendorNameCat[11]; + char cameraNameCat[16]; + + // 打印Title行 + // Print title line + printf("\nIdx Type Vendor Model S/N DeviceUserID IP Address \n"); + printf("------------------------------------------------------------------------------\n"); + + for (cameraIndex = 0; cameraIndex < deviceInfoList.nDevNum; cameraIndex++) + { + pDevInfo = &deviceInfoList.pDevInfo[cameraIndex]; + // 设备列表的相机索引 最大表示字数:3 + // Camera index in device list, display in 3 characters + printf("%-3d", cameraIndex + 1); + + // 相机的设备类型(GigE,U3V,CL,PCIe) + // Camera type + switch (pDevInfo->nCameraType) + { + case typeGigeCamera:printf(" GigE");break; + case typeU3vCamera:printf(" U3V ");break; + case typeCLCamera:printf(" CL ");break; + case typePCIeCamera:printf(" PCIe");break; + default:printf(" ");break; + } + + // 制造商信息 最大表示字数:10 + // Camera vendor name, display in 10 characters + if (strlen(pDevInfo->vendorName) > 10) + { + memcpy(vendorNameCat, pDevInfo->vendorName, 7); + vendorNameCat[7] = '\0'; + strcat(vendorNameCat, "..."); + printf(" %-10.10s", vendorNameCat); + } + else + { + printf(" %-10.10s", pDevInfo->vendorName); + } + + // 相机的型号信息 最大表示字数:10 + // Camera model name, display in 10 characters + printf(" %-10.10s", pDevInfo->modelName); + + // 相机的序列号 最大表示字数:15 + // Camera serial number, display in 15 characters + printf(" %-15.15s", pDevInfo->serialNumber); + + // 自定义用户ID 最大表示字数:15 + // Camera user id, display in 15 characters + if (strlen(pDevInfo->cameraName) > 15) + { + memcpy(cameraNameCat, pDevInfo->cameraName, 12); + cameraNameCat[12] = '\0'; + strcat(cameraNameCat, "..."); + printf(" %-15.15s", cameraNameCat); + } + else + { + printf(" %-15.15s", pDevInfo->cameraName); + } + + // GigE相机时获取IP地址 + // IP address of GigE camera + if (pDevInfo->nCameraType == typeGigeCamera) + { + printf(" %s", pDevInfo->DeviceSpecificInfo.gigeDeviceInfo.ipAddress); + } + + printf("\n"); + } + + return; +} + +static char* trim(char* pStr) +{ + char* pDst = pStr; + char* pTemStr = NULL; + + if (pDst != NULL) + { + pTemStr = pDst + strlen(pStr) - 1; + while (*pDst == ' ') + { + pDst++; + } + while ((pTemStr > pDst) && (*pTemStr == ' ')) + { + *pTemStr-- = '\0'; + } + } + return pDst; +} + +static int isInputValid(char* pInpuStr) +{ + char numChar; + char* pStr = pInpuStr; + while (*pStr != '\0') + { + numChar = *pStr; + if ((numChar > '9') || (numChar < '0')) + { + return -1; + } + pStr++; + } + return 0; +} + +static unsigned int selectDevice(unsigned int cameraCnt) +{ + char inputStr[256]; + char* pTrimStr; + int inputIndex = -1; + int ret = -1; + char* find = NULL; + + printf("\nPlease input the camera index: "); + while (1) + { + memset(inputStr, 0, sizeof(inputStr)); + fgets(inputStr, sizeof(inputStr), stdin); + + // 清空输入缓存 + // clear flush + fflush(stdin); + + // fgets比gets多吃一个换行符号,取出换行符号 + // fgets eats one more line feed symbol than gets, and takes out the line feed symbol + find = strchr(inputStr, '\n'); + if (find) { *find = '\0'; } + + pTrimStr = trim(inputStr); + ret = isInputValid(pTrimStr); + if (ret == 0) + { + inputIndex = atoi(pTrimStr); + // 输入的序号从1开始 + // Input index starts from 1 + inputIndex -= 1; + if ((inputIndex >= 0) && (inputIndex < (int)cameraCnt)) + { + break; + } + } + + printf("Input invalid! Please input the camera index: "); + } + return (unsigned int)inputIndex; +} + +// ***********结束: 这部分处理与SDK操作相机无关,用于显示设备列表 *********** +// ***********END: These functions are not related to API call and used to display device info*********** +static int setSoftTriggerConf(void* libHandle, IMV_HANDLE devHandle) +{ + int ret = IMV_OK; + // 获取设置触发源为软触发函数地址 + DLL_SetEnumFeatureSymbol DLLSetEnumFeatureSymbol = (DLL_SetEnumFeatureSymbol)dlsym(libHandle, "IMV_SetEnumFeatureSymbol"); + if (NULL == DLLSetEnumFeatureSymbol) + { + printf("Get IMV_SetEnumFeatureSymbol address failed!\n"); + return ret; + } + + // 设置触发源为软触发 + // Set trigger source to Software + ret = DLLSetEnumFeatureSymbol(devHandle, "TriggerSource", "Software"); + if (IMV_OK != ret) + { + printf("Set triggerSource value failed! ErrorCode[%d]\n", ret); + return ret; + } + + // 设置触发器 + // Set trigger selector to FrameStart + ret = DLLSetEnumFeatureSymbol(devHandle, "TriggerSelector", "FrameStart"); + if (IMV_OK != ret) + { + printf("Set triggerSelector value failed! ErrorCode[%d]\n", ret); + return ret; + } + + // 设置触发模式 + // Set trigger mode to On + ret = DLLSetEnumFeatureSymbol(devHandle, "TriggerMode", "On"); + if (IMV_OK != ret) + { + printf("Set triggerMode value failed! ErrorCode[%d]\n", ret); + return ret; + } + + return ret; +} + +// Image convert +static int imageConvert(void* libHandle, IMV_HANDLE devHandle, IMV_Frame frame, IMV_EPixelType convertFormat) +{ + IMV_PixelConvertParam stPixelConvertParam; + unsigned char* pDstBuf = NULL; + unsigned int nDstBufSize = 0; + int ret = IMV_OK; + FILE* hFile = NULL; + const char* pFileName = NULL; + const char* pConvertFormatStr = NULL; + + // 获取设置触发源为软触发函数地址 + DLL_PixelConvert DLLPixelConvert = (DLL_PixelConvert)dlsym(libHandle, "IMV_PixelConvert"); + if (NULL == DLLPixelConvert) + { + printf("Get IMV_PixelConvert address failed!\n"); + return ret; + } + + switch (convertFormat) + { + case gvspPixelRGB8: + nDstBufSize = sizeof(unsigned char) * frame.frameInfo.width * frame.frameInfo.height * 3; + pFileName = (const char*)"convertRGB8.bmp"; + pConvertFormatStr = (const char*)"RGB8"; + break; + + case gvspPixelBGR8: + nDstBufSize = sizeof(unsigned char) * frame.frameInfo.width * frame.frameInfo.height * 3; + pFileName = (const char*)"convertBGR8.bmp"; + pConvertFormatStr = (const char*)"BGR8"; + break; + case gvspPixelBGRA8: + nDstBufSize = sizeof(unsigned char) * frame.frameInfo.width * frame.frameInfo.height * 4; + pFileName = (const char*)"convertBGRA8.bmp"; + pConvertFormatStr = (const char*)"BGRA8"; + break; + case gvspPixelMono8: + default: + nDstBufSize = sizeof(unsigned char) * frame.frameInfo.width * frame.frameInfo.height; + pFileName = (const char*)"convertMono8.bmp"; + pConvertFormatStr = (const char*)"Mono8"; + break; + } + + pDstBuf = (unsigned char*)malloc(nDstBufSize); + if (NULL == pDstBuf) + { + printf("malloc pDstBuf failed!\n"); + return -1; + } + + // 图像转换成BGR8 + // convert image to BGR8 + memset(&stPixelConvertParam, 0, sizeof(stPixelConvertParam)); + stPixelConvertParam.nWidth = frame.frameInfo.width; + stPixelConvertParam.nHeight = frame.frameInfo.height; + stPixelConvertParam.ePixelFormat = frame.frameInfo.pixelFormat; + stPixelConvertParam.pSrcData = frame.pData; + stPixelConvertParam.nSrcDataLen = frame.frameInfo.size; + stPixelConvertParam.nPaddingX = frame.frameInfo.paddingX; + stPixelConvertParam.nPaddingY = frame.frameInfo.paddingY; + stPixelConvertParam.eBayerDemosaic = demosaicNearestNeighbor; + stPixelConvertParam.eDstPixelFormat = convertFormat; + stPixelConvertParam.pDstBuf = pDstBuf; + stPixelConvertParam.nDstBufSize = nDstBufSize; + + + ret = DLLPixelConvert(devHandle, &stPixelConvertParam); + if (IMV_OK == ret) + { + printf("image convert to %s successfully! nDstDataLen (%u)\n", + pConvertFormatStr, stPixelConvertParam.nDstBufSize); + + cv::Mat im(stPixelConvertParam.nHeight, stPixelConvertParam.nWidth, CV_8UC3, stPixelConvertParam.pDstBuf); + + // // for test + // // 内参矩阵 + // cv::Mat cameraMatrix = (cv::Mat_(3, 3) << 11057.154, 0, 4538.85, 0, 11044.943, 3350.918, 0, 0, 1); + // // 设置畸变系数 + // cv::Mat distCoeffs = (cv::Mat_(1, 5) << 0.311583980, -14.5864013, -0.00630134677, -0.00466401902, 183.662957); + // // 准备输出图像 + // cv::Mat undistortedImg; + // // 使用cv::undistort函数进行校正 + // cv::undistort(im, undistortedImg, cameraMatrix, distCoeffs); + + + cv::imwrite("/home/caowei/catkin_ws/output.png", im); + cv::imwrite("output.png", im); + + // hFile = fopen(pFileName, "wb"); + // if (hFile != NULL) + // { + // fwrite((void*)pDstBuf, 1, stPixelConvertParam.nDstBufSize, hFile); + // fclose(hFile); + // } + // else + // { + // // 如果打开失败,请用root权限执行 + // // If opefailed, Run as root + // printf("Open file (%s) failed!\n", pFileName); + // } + } + else + { + printf("image convert to %s failed! ErrorCode[%d]\n", pConvertFormatStr, ret); + } + + if (pDstBuf) + { + free(pDstBuf); + pDstBuf = NULL; + } + + return IMV_OK; +} + +static void sendToRos(IMV_Frame frame) +{ + IMV_FlipImageParam stFlipImageParam; + unsigned int nChannelNum = 0; + int ret = IMV_OK; + FILE* hFile = NULL; + + memset(&stFlipImageParam, 0, sizeof(stFlipImageParam)); + + if (gvspPixelBGR8 == frame.frameInfo.pixelFormat) + { + stFlipImageParam.pSrcData = frame.pData; + stFlipImageParam.nSrcDataLen = frame.frameInfo.width * frame.frameInfo.height * BGR_CHANNEL_NUM; + stFlipImageParam.ePixelFormat = frame.frameInfo.pixelFormat; + nChannelNum = BGR_CHANNEL_NUM; + } + else + { + printf("image convert to BGR8 failed! ErrorCode[%d]\n", ret); + } + + // 向ros发送/image消息 + do + { + + } while (false); + +} + + +int main() +{ + int ret = IMV_OK; + unsigned int cameraIndex = 0; + IMV_HANDLE devHandle = NULL; + void* libHandle = NULL; + DLL_DestroyHandle DLLDestroyHandle = NULL; + IMV_Frame frame; + + // 加载SDK库 + // Load SDK library + libHandle = dlopen("libMVSDK.so", RTLD_LAZY); + if (NULL == libHandle) + { + printf("Load MVSDKmd.dll library failed!\n"); + return 0; + } + + // 获取发现设备接口函数地址 + // Get discover camera interface address + DLL_EnumDevices DLLEnumDevices = (DLL_EnumDevices)dlsym(libHandle, "IMV_EnumDevices"); + if (NULL == DLLEnumDevices) + { + printf("Get IMV_EnumDevices address failed!\n"); + return 0; + } + + // 获取创建设备句柄接口函数地址 + // Get create Device Handle interface address + DLL_CreateHandle DLLCreateHandle = (DLL_CreateHandle)dlsym(libHandle, "IMV_CreateHandle"); + if (NULL == DLLCreateHandle) + { + printf("Get IMV_CreateHandle address failed!\n"); + return 0; + } + + // 获取销毁设备句柄接口函数地址 + // Get destroy Device Handle interface address + DLLDestroyHandle = (DLL_DestroyHandle)dlsym(libHandle, "IMV_DestroyHandle"); + if (NULL == DLLDestroyHandle) + { + printf("Get IMV_DestroyHandle address failed!\n"); + return 0; + } + + // 获取打开相机接口函数地址 + // Get open camera interface address + DLL_Open DLLOpen = (DLL_Open)dlsym(libHandle, "IMV_Open"); + if (NULL == DLLOpen) + { + printf("Get IMV_Open address failed!\n"); + return 0; + } + + // 获取注册数据帧回调接口函数地址 + // Get register data frame callback interface address + DLL_AttachGrabbing DLLAttachGrabbing = (DLL_AttachGrabbing)dlsym(libHandle, "IMV_AttachGrabbing"); + if (NULL == DLLAttachGrabbing) + { + printf("Get IMV_AttachGrabbing address failed!\n"); + return 0; + } + + // 获取开始拉流接口函数地址 + // Get start grabbing interface address + DLL_StartGrabbing DLLStartGrabbing = (DLL_StartGrabbing)dlsym(libHandle, "IMV_StartGrabbing"); + if (NULL == DLLStartGrabbing) + { + printf("Get IMV_StartGrabbing address failed!\n"); + return 0; + } + + // 获取停止拉流接口函数地址 + // Get stop grabbing interface address + DLL_StopGrabbing DLLStopGrabbing = (DLL_StopGrabbing)dlsym(libHandle, "IMV_StopGrabbing"); + if (NULL == DLLStopGrabbing) + { + printf("Get IMV_StopGrabbing address failed!\n"); + return 0; + } + + // 获取 + + // 获取关闭相机接口函数地址 + // Get close camera interface address + DLL_Close DLLClose = (DLL_Close)dlsym(libHandle, "IMV_Close"); + if (NULL == DLLClose) + { + printf("Get IMV_Close address failed!\n"); + return 0; + } + + // 获取获取一帧图像函数地址 + DLL_GetFrame DLLGetFrame = (DLL_GetFrame)dlsym(libHandle, "IMV_GetFrame"); + if (NULL == DLLGetFrame) + { + printf("Get IMV_GetFrame address failed!\n"); + return 0; + } + + DLL_ReleaseFrame DLLReleaseFrame = (DLL_ReleaseFrame)dlsym(libHandle, "IMV_ReleaseFrame"); + if (NULL == DLLReleaseFrame) + { + printf("Get IMV_ReleaseFrame address failed!\n"); + return 0; + } + + DLL_ClearFrameBuffer DLLClearFrameBuffer = (DLL_ClearFrameBuffer)dlsym(libHandle, "IMV_ClearFrameBuffer"); + if (NULL == DLLClearFrameBuffer) + { + printf("Get IMV_ClearFrameBuffer address failed!\n"); + return 0; + } + + DLL_ExecuteCommandFeature DLLExecuteCommandFeature = (DLL_ExecuteCommandFeature)dlsym(libHandle, "IMV_ExecuteCommandFeature"); + if (NULL == DLLExecuteCommandFeature) + { + printf("Get IMV_ExecuteCommandFeature address failed!\n"); + return 0; + } + + DLL_SetIntFeatureValue DLLSetIntFeatureValue = (DLL_SetIntFeatureValue)dlsym(libHandle, "IMV_SetIntFeatureValue"); + if (NULL == DLLSetIntFeatureValue) + { + printf("Get IMV_SetIntFeatureValue address failed!\n"); + return 0; + } + + DLL_SetDoubleFeatureValue DLLSetDoubleFeatureValue = (DLL_SetDoubleFeatureValue)dlsym(libHandle, "IMV_SetDoubleFeatureValue"); + if (NULL == DLLSetDoubleFeatureValue) + { + printf("Get IMV_SetDoubleFeatureValue address failed!\n"); + return 0; + } + + + +////////////////////// 检查接口结束 + // 发现设备 + // discover camera + IMV_DeviceList deviceInfoList; + ret = DLLEnumDevices(&deviceInfoList, interfaceTypeAll); + if (IMV_OK != ret) + { + printf("Enumeration devices failed! ErrorCode[%d]\n", ret); + return 0; + } + + if (deviceInfoList.nDevNum < 1) + { + printf("no camera\n"); + return 0; + } + + // 打印相机基本信息(序号,类型,制造商信息,型号,序列号,用户自定义ID,IP地址) + // Print camera info (Index, Type, Vendor, Model, Serial number, DeviceUserID, IP Address) + + displayDeviceInfo(deviceInfoList); + // 选择需要连接的相机 + // Select one camera to connect to + // cameraIndex = selectDevice(deviceInfoList.nDevNum); + cameraIndex = 0; // 第一个相机 + + // 创建设备句柄 + // Create Device Handle + ret = DLLCreateHandle(&devHandle, modeByIndex, (void*)&cameraIndex); + if (IMV_OK != ret) + { + printf("Create devHandle failed! ErrorCode[%d]\n", ret); + return 0; + } + + // 打开相机 + ret = DLLOpen(devHandle); + if (IMV_OK != ret) + { + printf("Open camera failed! ErrorCode[%d]\n", ret); + return 0; + } + + // 设置软触发模式 + ret = setSoftTriggerConf(libHandle, devHandle); + if (IMV_OK != ret) + { + printf("setSoftTriggerConf failed! ErrorCode[%d]\n", ret); + return 0; + } + + ret = DLLSetIntFeatureValue(devHandle, "Width", 9344); + if (IMV_OK != ret) + { + printf("Set feature value Width failed! ErrorCode[%d]\n", ret); + return ret; + } + + ret = DLLSetIntFeatureValue(devHandle, "Height", 7000); + if (IMV_OK != ret) + { + printf("Set feature value Height failed! ErrorCode[%d]\n", ret); + return ret; + } + + ret = DLLSetIntFeatureValue(devHandle, "OffsetX", 0); + if (IMV_OK != ret) + { + printf("Set feature value OffsetX failed! ErrorCode[%d]\n", ret); + return ret; + } + + ret = DLLSetIntFeatureValue(devHandle, "OffsetY", 0); + if (IMV_OK != ret) + { + printf("Set feature value OffsetY failed! ErrorCode[%d]\n", ret); + return ret; + } + + // 设置属性值曝光 + // Set feature value + ret = DLLSetDoubleFeatureValue(devHandle, "ExposureTime", 12*10000); + if (IMV_OK != ret) + { + printf("Set feature value failed! ErrorCode[%d]\n", ret); + return ret; + } + + // // 非多线程,不需要注册回调 + // // 注册数据帧回调函数 + // // Register data frame callback function + // ret = DLLAttachGrabbing(devHandle, onGetFrame, NULL); + // if (IMV_OK != ret) + // { + // printf("Attach grabbing failed! ErrorCode[%d]\n", ret); + // return 0; + // } + + // 开始拉流 + // Start grabbing + ret = DLLStartGrabbing(devHandle); + if (IMV_OK != ret) + { + printf("Start grabbing failed! ErrorCode[%d]\n", ret); + return 0; + } + + /////////////////////////获取一帧图像//////////////////////////// + + // 清除帧数据缓存 + // Clear frame buffer + ret = DLLClearFrameBuffer(devHandle); + if (IMV_OK != ret) + { + printf("Clear frame buffer failed! ErrorCode[%d]\n", ret); + return ret; + } + + // 执行软触发 + // Execute soft trigger + ret = DLLExecuteCommandFeature(devHandle, "TriggerSoftware"); + if (IMV_OK != ret) + { + printf("Execute TriggerSoftware failed! ErrorCode[%d]\n", ret); + return ret; + } + +sleep(2000); + // 获取一帧图像, TIMEOUT 5000ms + ret = DLLGetFrame(devHandle, &frame, 5000); + if (IMV_OK != ret) + { + printf("Get frame failed! ErrorCode[%d]\n", ret); + return 0; + } + + printf("width %d\n", frame.frameInfo.width); + printf("Height %d\n", frame.frameInfo.height); + + ret = imageConvert(libHandle, devHandle, frame, gvspPixelBGR8); + if (IMV_OK != ret) + { + printf("imageConvert failed! ErrorCode[%d]\n", ret); + return 0; + } + // printf("11111111111111\n", ret); + // cv::Mat im(frame.frameInfo.width, frame.frameInfo.height, CV_8UC3, frame.pData); + // cv::imwrite("/home/caowei/catkin_ws/output.png", im); + // cv::imwrite("output.png", im); + // printf("22222222222222\n", ret); + // // 向ros送 /image消息 + // sendToRos(frame); + + // 释放图像缓存 + ret = DLLReleaseFrame(devHandle, &frame); + if (IMV_OK != ret) + { + printf("Release frame failed! ErrorCode[%d]\n", ret); + return 0; + } + //////////////////////////////////////////////////////////////// + + // // 取图2秒 + // // get frame 2 seconds + // sleep(2000); + + // 停止拉流 + // Stop grabbing + ret = DLLStopGrabbing(devHandle); + if (IMV_OK != ret) + { + printf("Stop grabbing failed! ErrorCode[%d]\n", ret); + return 0; + } + + // 关闭相机 + // Close camera + ret = DLLClose(devHandle); + if (IMV_OK != ret) + { + printf("Close camera failed! ErrorCode[%d]\n", ret); + return 0; + } + + // 销毁设备句柄 + // Destroy Device Handle + if (NULL != devHandle) + { + // 销毁设备句柄 + // Destroy Device Handle + DLLDestroyHandle(devHandle); + } + + if (NULL != libHandle) + { + dlclose(libHandle); + } + + printf("end...\n"); + // getchar(); + + return 0; +} + +} \ No newline at end of file diff --git a/IMVApi.h b/IMVApi.h new file mode 100644 index 0000000..e7fb265 --- /dev/null +++ b/IMVApi.h @@ -0,0 +1,1071 @@ +/// \mainpage +/// \~chinese +/// \htmlinclude mainpage_chs.html +/// \~english +/// \htmlinclude mainpage_eng.html + +#ifndef __IMV_API_H__ +#define __IMV_API_H__ + +#include "IMVDefines.h" + +/// \~chinese +/// \brief 动态库导入导出定义 +/// \~english +/// \brief Dynamic library import and export definition +#if (defined (_WIN32) || defined(WIN64)) + #ifdef IMV_API_DLL_BUILD + #define IMV_API _declspec(dllexport) + #else + #define IMV_API _declspec(dllimport) + #endif + + #define IMV_CALL __stdcall +#else + #define IMV_API + #define IMV_CALL +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/// \~chinese +/// \brief 获取版本信息 +/// \return 成功时返回版本信息,失败时返回NULL +/// \~english +/// \brief get version information +/// \return Success, return version info. Failure, return NULL +IMV_API const char* IMV_CALL IMV_GetVersion(void); + +/// \~chinese +/// \brief 枚举设备 +/// \param pDeviceList [OUT] 设备列表 +/// \param interfaceType [IN] 待枚举的接口类型, 类型可任意组合,如 interfaceTypeGige | interfaceTypeUsb3 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 1、当interfaceType = interfaceTypeAll 时,枚举所有接口下的在线设备\n +/// 2、当interfaceType = interfaceTypeGige 时,枚举所有GigE网口下的在线设备\n +/// 3、当interfaceType = interfaceTypeUsb3 时,枚举所有USB接口下的在线设备\n +/// 4、当interfaceType = interfaceTypeCL 时,枚举所有CameraLink接口下的在线设备\n +/// 5、该接口下的interfaceType支持任意接口类型的组合,如,若枚举所有GigE网口和USB3接口下的在线设备时, +/// 可将interfaceType设置为 interfaceType = interfaceTypeGige | interfaceTypeUsb3,其它接口类型组合以此类推 +/// \~english +/// \brief Enumerate Device +/// \param pDeviceList [OUT] Device list +/// \param interfaceType [IN] The interface type you want to find, support any interface type combination, sucn as interfaceTypeGige | interfaceTypeUsb3 +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// 1、when interfaceType = interfaceTypeAll, enumerate devices in all interface types\n +/// 2、when interfaceType = interfaceTypeGige, enumerate devices in GigE interface \n +/// 3、when interfaceType = interfaceTypeUsb3, enumerate devices in USB interface\n +/// 4、when interfaceType = interfaceTypeCL, enumerate devices in CameraLink interface\n +/// 5、interfaceType supports any interface type combination. For example, if you want to find all GigE and USB3 devices, +/// you can set interfaceType as interfaceType = interfaceTypeGige | interfaceTypeUsb3. +IMV_API int IMV_CALL IMV_EnumDevices(OUT IMV_DeviceList *pDeviceList, IN unsigned int interfaceType); + +/// \~chinese +/// \brief 以单播形式枚举设备, 仅限Gige设备使用 +/// \param pDeviceList [OUT] 设备列表 +/// \param pIpAddress [IN] 设备的IP地址 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Enumerate device by unicast mode. Only for Gige device. +/// \param pDeviceList [OUT] Device list +/// \param pIpAddress [IN] IP address of the device +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_EnumDevicesByUnicast(OUT IMV_DeviceList *pDeviceList, IN const char* pIpAddress); + +/// \~chinese +/// \brief 通过指定标示符创建设备句柄,如指定索引、设备键、设备自定义名、IP地址 +/// \param handle [OUT] 设备句柄 +/// \param mode [IN] 创建设备方式 +/// \param pIdentifier [IN] 指定标示符(设备键、设备自定义名、IP地址为char类型指针强转void类型指针,索引为unsigned int类型指针强转void类型指针) +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Create device handle by specifying identifiers, such as specifying index, device key, device userID, and IP address +/// \param handle [OUT] Device handle +/// \param mode [IN] Create handle mode +/// \param pIdentifier [IN] Specifying identifiers(device key, device userID, and IP address is char* forced to void*, index is unsigned int* forced to void*) +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_CreateHandle(OUT IMV_HANDLE* handle, IN IMV_ECreateHandleMode mode, IN void* pIdentifier); + +/// \~chinese +/// \brief 销毁设备句柄 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Destroy device handle +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_DestroyHandle(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 获取设备信息 +/// \param handle [IN] 设备句柄 +/// \param pDevInfo [OUT] 设备信息 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get device information +/// \param handle [IN] Device handle +/// \param pDevInfo [OUT] Device information +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetDeviceInfo(IN IMV_HANDLE handle, OUT IMV_DeviceInfo *pDevInfo); + +/// \~chinese +/// \brief 打开设备 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Open Device +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_Open(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 打开设备 +/// \param handle [IN] 设备句柄 +/// \param accessPermission [IN] 控制通道权限(IMV_Open默认使用accessPermissionControl权限) +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Open Device +/// \param handle [IN] Device handle +/// \param accessPermission [IN] Control access permission(Default used accessPermissionControl in IMV_Open) +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_OpenEx(IN IMV_HANDLE handle, IN IMV_ECameraAccessPermission accessPermission); + +/// \~chinese +/// \brief 判断设备是否已打开 +/// \param handle [IN] 设备句柄 +/// \return 打开状态,返回true;关闭状态或者掉线状态,返回false +/// \~english +/// \brief Check whether device is opened or not +/// \param handle [IN] Device handle +/// \return Opened, return true. Closed or Offline, return false +IMV_API bool IMV_CALL IMV_IsOpen(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 关闭设备 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Close Device +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_Close(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 修改设备IP, 仅限Gige设备使用 +/// \param handle [IN] 设备句柄 +/// \param pIpAddress [IN] IP地址 +/// \param pSubnetMask [IN] 子网掩码 +/// \param pGateway [IN] 默认网关 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 1、调用该函数时如果pSubnetMask和pGateway都设置了有效值,则以此有效值为准;\n +/// 2、调用该函数时如果pSubnetMask和pGateway都设置了NULL,则内部实现时用它所连接网卡的子网掩码和网关代替\n +/// 3、调用该函数时如果pSubnetMask和pGateway两者中其中一个为NULL,另一个非NULL,则返回错误 +/// \~english +/// \brief Modify device IP. Only for Gige device. +/// \param handle [IN] Device handle +/// \param pIpAddress [IN] IP address +/// \param pSubnetMask [IN] SubnetMask +/// \param pGateway [IN] Gateway +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// 1、When callback this function, if the values of pSubnetMask and pGateway are both valid then we consider the value is correct\n +/// 2、When callback this function, if the values of pSubnetMask and pGateway are both NULL, +/// then these values will be replaced by the subnetmask and gateway of NIC which this device connect to.\n +/// 3、When callback this function, if there is one value of pSubnetMask or pGateway is NULL and the other one is not NULL, then return error +IMV_API int IMV_CALL IMV_GIGE_ForceIpAddress(IN IMV_HANDLE handle, IN const char* pIpAddress, IN const char* pSubnetMask, IN const char* pGateway); + +/// \~chinese +/// \brief 获取设备的当前访问权限, 仅限Gige设备使用 +/// \param handle [IN] 设备句柄 +/// \param pAccessPermission [OUT] 设备的当前访问权限 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get current access permission of device. Only for Gige device. +/// \param handle [IN] Device handle +/// \param pAccessPermission [OUT] Current access permission of device +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GIGE_GetAccessPermission(IN IMV_HANDLE handle, OUT IMV_ECameraAccessPermission* pAccessPermission); + +/// \~chinese +/// \brief 设置设备对sdk命令的响应超时时间,仅限Gige设备使用 +/// \param handle [IN] 设备句柄 +/// \param timeout [IN] 超时时间,单位ms +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set the response timeout interval of device sends command to the API. Only for Gige device. +/// \param handle [IN] Device handle +/// \param timeout [IN] time out, unit:ms +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GIGE_SetAnswerTimeout(IN IMV_HANDLE handle, IN unsigned int timeout); + +/// \~chinese +/// \brief 下载设备描述XML文件,并保存到指定路径,如:D:\\xml.zip +/// \param handle [IN] 设备句柄 +/// \param pFullFileName [IN] 文件要保存的路径 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Download device description XML file, and save the files to specified path. e.g. D:\\xml.zip +/// \param handle [IN] Device handle +/// \param pFullFileName [IN] The full paths where the downloaded XMl files would be saved to +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_DownLoadGenICamXML(IN IMV_HANDLE handle, IN const char* pFullFileName); + +/// \~chinese +/// \brief 保存设备配置到指定的位置。同名文件已存在时,覆盖。 +/// \param handle [IN] 设备句柄 +/// \param pFullFileName [IN] 导出的设备配置文件全名(含路径),如:D:\\config.xml 或 D:\\config.mvcfg +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Save the configuration of the device. Overwrite the file if exists. +/// \param handle [IN] Device handle +/// \param pFullFileName [IN] The full path name of the property file(xml). e.g. D:\\config.xml or D:\\config.mvcfg +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SaveDeviceCfg(IN IMV_HANDLE handle, IN const char* pFullFileName); + +/// \~chinese +/// \brief 从文件加载设备xml配置 +/// \param handle [IN] 设备句柄 +/// \param pFullFileName [IN] 设备配置(xml)文件全名(含路径),如:D:\\config.xml 或 D:\\config.mvcfg +/// \param pErrorList [OUT] 加载失败的属性名列表。存放加载失败的属性上限为IMV_MAX_ERROR_LIST_NUM。 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief load the configuration of the device +/// \param handle [IN] Device handle +/// \param pFullFileName [IN] The full path name of the property file(xml). e.g. D:\\config.xml or D:\\config.mvcfg +/// \param pErrorList [OUT] The list of load failed properties. The failed to load properties list up to IMV_MAX_ERROR_LIST_NUM. +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_LoadDeviceCfg(IN IMV_HANDLE handle, IN const char* pFullFileName, OUT IMV_ErrorList* pErrorList); + +/// \~chinese +/// \brief 写用户自定义数据。相机内部保留32768字节用于用户存储自定义数据(此功能针对本品牌相机,其它品牌相机无此功能) +/// \param handle [IN] 设备句柄 +/// \param pBuffer [IN] 数据缓冲的指针 +/// \param pLength [IN] 期望写入的字节数 [OUT] 实际写入的字节数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Write user-defined data; Inside the camera, there are 32768 bytes reserved for user to store private data (Only for our own camera has this function) +/// \param handle [IN] Device handle +/// \param pBuffer [IN] Pointer of the data buffer +/// \param pLength [IN] Byte count written expected [OUT] Byte count written in fact +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_WriteUserPrivateData(IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength); + +/// \~chinese +/// \brief 读用户自定义数据。相机内部保留32768字节用于用户存储自定义数据(此功能针对本品牌相机,其它品牌相机无此功能) +/// \param handle [IN] 设备句柄 +/// \param pBuffer [OUT] 数据缓冲的指针 +/// \param pLength [IN] 期望读出的字节数 [OUT] 实际读出的字节数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Read user-defined data; Inside the camera, there are 32768 bytes reserved for user to store private data (Only for our own camera has this function) +/// \param handle [IN] Device handle +/// \param pBuffer [OUT] Pointer of the data buffer +/// \param pLength [IN] Byte count read expected [OUT] Byte count read in fact +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ReadUserPrivateData(IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength); + +/// \~chinese +/// \brief 往相机串口寄存器写数据,每次写会清除掉上次的数据(此功能只支持包含串口功能的本品牌相机) +/// \param handle [IN] 设备句柄 +/// \param pBuffer [IN] 数据缓冲的指针 +/// \param pLength [IN] 期望写入的字节数 [OUT] 实际写入的字节数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Write serial data to camera serial register, will erase the data writen before (Only for our own camera with serial port has this function) +/// \param handle [IN] Device handle +/// \param pBuffer [IN] Pointer of the data buffer +/// \param pLength [IN] Byte count written expected [OUT] Byte count written in fact +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_WriteUARTData(IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength); + +/// \~chinese +/// \brief 从相机串口寄存器读取串口数据(此功能只支持包含串口功能的本品牌相机 ) +/// \param handle [IN] 设备句柄 +/// \param pBuffer [OUT] 数据缓冲的指针 +/// \param pLength [IN] 期望读出的字节数 [OUT] 实际读出的字节数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Read serial data from camera serial register (Only for our own camera with serial port has this function) +/// \param handle [IN] Device handle +/// \param pBuffer [OUT] Pointer of the data buffer +/// \param pLength [IN] Byte count read expected [OUT] Byte count read in fact +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ReadUARTData(IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength); + +/// \~chinese +/// \brief 设备连接状态事件回调注册 +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 设备连接状态事件回调函数 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register call back function of device connection status event. +/// \param handle [IN] Device handle +/// \param proc [IN] Call back function of device connection status event +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_SubscribeConnectArg(IN IMV_HANDLE handle, IN IMV_ConnectCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 参数更新事件回调注册 +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 参数更新注册的事件回调函数 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register call back function of parameter update event. +/// \param handle [IN] Device handle +/// \param proc [IN] Call back function of parameter update event +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_SubscribeParamUpdateArg(IN IMV_HANDLE handle, IN IMV_ParamUpdateCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 流通道事件回调注册 +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 流通道事件回调注册函数 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register call back function of stream channel event. +/// \param handle [IN] Device handle +/// \param proc [IN] Call back function of stream channel event +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_SubscribeStreamArg(IN IMV_HANDLE handle, IN IMV_StreamCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 消息通道事件回调注册 +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 消息通道事件回调注册函数 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register call back function of message channel event. +/// \param handle [IN] Device handle +/// \param proc [IN] Call back function of message channel event +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_SubscribeMsgChannelArg(IN IMV_HANDLE handle, IN IMV_MsgChannelCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 设置帧数据缓存个数 +/// \param handle [IN] 设备句柄 +/// \param nSize [IN] 缓存数量 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 不能在拉流过程中设置 +/// \~english +/// \brief Set frame buffer count +/// \param handle [IN] Device handle +/// \param nSize [IN] The buffer count +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// It can not be set during frame grabbing +IMV_API int IMV_CALL IMV_SetBufferCount(IN IMV_HANDLE handle, IN unsigned int nSize); + +/// \~chinese +/// \brief 清除帧数据缓存 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Clear frame buffer +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ClearFrameBuffer(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 设置驱动包间隔时间(MS),仅对Gige设备有效 +/// \param handle [IN] 设备句柄 +/// \param nTimeout [IN] 包间隔时间,单位是毫秒 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 触发模式尾包丢失重传机制 +/// \~english +/// \brief Set packet timeout(MS), only for Gige device +/// \param handle [IN] Device handle +/// \param nTimeout [IN] Time out value, unit is MS +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// The resend mechanism of tail packet loss on trigger mode +IMV_API int IMV_CALL IMV_GIGE_SetInterPacketTimeout(IN IMV_HANDLE handle, IN unsigned int nTimeout); + +/// \~chinese +/// \brief 设置单次重传最大包个数, 仅对GigE设备有效 +/// \param handle [IN] 设备句柄 +/// \param maxPacketNum [IN] 单次重传最大包个数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// maxPacketNum为0时,该功能无效 +/// \~english +/// \brief Set the single resend maximum packet number, only for Gige device +/// \param handle [IN] Device handle +/// \param maxPacketNum [IN] The value of single resend maximum packet number +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Disable the function when maxPacketNum is 0 +IMV_API int IMV_CALL IMV_GIGE_SetSingleResendMaxPacketNum(IN IMV_HANDLE handle, IN unsigned int maxPacketNum); + +/// \~chinese +/// \brief 设置同一帧最大丢包的数量,仅对GigE设备有效 +/// \param handle [IN] 设备句柄 +/// \param maxLostPacketNum [IN] 最大丢包的数量 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// maxLostPacketNum为0时,该功能无效 +/// \~english +/// \brief Set the maximum lost packet number, only for Gige device +/// \param handle [IN] Device handle +/// \param maxLostPacketNum [IN] The value of maximum lost packet number +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Disable the function when maxLostPacketNum is 0 +IMV_API int IMV_CALL IMV_GIGE_SetMaxLostPacketNum(IN IMV_HANDLE handle, IN unsigned int maxLostPacketNum); + +/// \~chinese +/// \brief 设置U3V设备的传输数据块的数量和大小,仅对USB设备有效 +/// \param handle [IN] 设备句柄 +/// \param nNum [IN] 传输数据块的数量(范围:5-256) +/// \param nSize [IN] 传输数据块的大小(范围:8-512, 单位:KByte) +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 1、该接口暂时只有在Linux平台且使用无驱的情况下设置才有效,其他情况下返回IMV_NOT_SUPPORT错误码\n +/// 2、传输数据块数量,范围5 - 256, 默认为64,高分辨率高帧率时可以适当增加该值;多台相机共同使用时,可以适当减小该值\n +/// 3、传输每个数据块大小,范围8 - 512, 默认为64,单位是KByte +/// \~english +/// \brief Set the number and size of urb transmitted, only for USB device +/// \param handle [IN] Device handle +/// \param nNum [IN] The number of urb transmitted(range:5-256) +/// \param nSize [IN] The size of urb transmitted(range:8-512, unit:KByte) +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// 1、The interface is only supported on the Linux platform without USB driver. In other cases, it returns IMV_NOT_SUPPORT error code.\n +/// 2、The number of urb transmitted, the range is 5 - 256, and the default is 64. when high pixel and high frame rate can be appropriately increased.; +/// when multiple cameras are used together, the value can be appropriately reduced.\n +/// 3、The size of each urb transmitted, the range is 8 - 512, the default is 64, the unit is KByte. +IMV_API int IMV_CALL IMV_USB_SetUrbTransfer(IN IMV_HANDLE handle, IN unsigned int nNum, IN unsigned int nSize); + +/// \~chinese +/// \brief 开始取流 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Start grabbing +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_StartGrabbing(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 开始取流 +/// \param handle [IN] 设备句柄 +/// \param maxImagesGrabbed [IN] 允许最多的取帧数,达到指定取帧数后停止取流,如果为0,表示忽略此参数连续取流(IMV_StartGrabbing默认0) +/// \param strategy [IN] 取流策略,(IMV_StartGrabbing默认使用grabStrartegySequential策略取流) +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Start grabbing +/// \param handle [IN] Device handle +/// \param maxImagesGrabbed [IN] Maximum images allowed to grab, once it reaches the limit then stop grabbing; +/// If it is 0, then ignore this parameter and start grabbing continuously(default 0 in IMV_StartGrabbing) +/// \param strategy [IN] Image grabbing strategy; (Default grabStrartegySequential in IMV_StartGrabbing) +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_StartGrabbingEx(IN IMV_HANDLE handle, IN uint64_t maxImagesGrabbed, IN IMV_EGrabStrategy strategy); + +/// \~chinese +/// \brief 判断设备是否正在取流 +/// \param handle [IN] 设备句柄 +/// \return 正在取流,返回true;不在取流,返回false +/// \~english +/// \brief Check whether device is grabbing or not +/// \param handle [IN] Device handle +/// \return Grabbing, return true. Not grabbing, return false +IMV_API bool IMV_CALL IMV_IsGrabbing(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 停止取流 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Stop grabbing +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_StopGrabbing(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 注册帧数据回调函数(异步获取帧数据机制) +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 帧数据信息回调函数,建议不要在该函数中处理耗时的操作,否则会阻塞后续帧数据的实时性 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 该异步获取帧数据机制和同步获取帧数据机制(IMV_GetFrame)互斥,对于同一设备,系统中两者只能选其一\n +/// 只支持一个回调函数, 且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register frame data callback function( asynchronous getting frame data mechanism); +/// \param handle [IN] Device handle +/// \param proc [IN] Frame data information callback function; It is advised to not put time-cosuming operation in this function, +/// otherwise it will block follow-up data frames and affect real time performance +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// This asynchronous getting frame data mechanism and synchronous getting frame data mechanism(IMV_GetFrame) are mutually exclusive,\n +/// only one method can be choosed between these two in system for the same device.\n +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_AttachGrabbing(IN IMV_HANDLE handle, IN IMV_FrameCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 获取一帧图像(同步获取帧数据机制) +/// \param handle [IN] 设备句柄 +/// \param pFrame [OUT] 帧数据信息 +/// \param timeoutMS [IN] 获取一帧图像的超时时间,INFINITE时表示无限等待,直到收到一帧数据或者停止取流。单位是毫秒 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 该接口不支持多线程调用。\n +/// 该同步获取帧机制和异步获取帧机制(IMV_AttachGrabbing)互斥,对于同一设备,系统中两者只能选其一。\n +/// 使用内部缓存获取图像,需要IMV_ReleaseFrame进行释放图像缓存。 +/// \~english +/// \brief Get a frame image(synchronous getting frame data mechanism) +/// \param handle [IN] Device handle +/// \param pFrame [OUT] Frame data information +/// \param timeoutMS [IN] The time out of getting one image, INFINITE means infinite wait until the one frame data is returned or stop grabbing.unit is MS +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// This interface does not support multi-threading.\n +/// This synchronous getting frame data mechanism and asynchronous getting frame data mechanism(IMV_AttachGrabbing) are mutually exclusive,\n +/// only one method can be chose between these two in system for the same device.\n +/// Use internal cache to get image, need to release image buffer by IMV_ReleaseFrame +IMV_API int IMV_CALL IMV_GetFrame(IN IMV_HANDLE handle, OUT IMV_Frame* pFrame, IN unsigned int timeoutMS); + +/// \~chinese +/// \brief 释放图像缓存 +/// \param handle [IN] 设备句柄 +/// \param pFrame [IN] 帧数据信息 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Free image buffer +/// \param handle [IN] Device handle +/// \param pFrame [IN] Frame image data information +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ReleaseFrame(IN IMV_HANDLE handle, IN IMV_Frame* pFrame); + +/// \~chinese +/// \brief 帧数据深拷贝克隆 +/// \param handle [IN] 设备句柄 +/// \param pFrame [IN] 克隆源帧数据信息 +/// \param pCloneFrame [OUT] 新的帧数据信息 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 使用IMV_ReleaseFrame进行释放图像缓存。 +/// \~english +/// \brief Frame data deep clone +/// \param handle [IN] Device handle +/// \param pFrame [IN] Frame data information of clone source +/// \param pCloneFrame [OUT] New frame data information +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Use IMV_ReleaseFrame to free image buffer + +IMV_API int IMV_CALL IMV_CloneFrame(IN IMV_HANDLE handle, IN IMV_Frame* pFrame, OUT IMV_Frame* pCloneFrame); + +/// \~chinese +/// \brief 获取Chunk数据(仅对GigE/Usb相机有效) +/// \param handle [IN] 设备句柄 +/// \param pFrame [IN] 帧数据信息 +/// \param index [IN] 索引ID +/// \param pChunkDataInfo [OUT] Chunk数据信息 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get chunk data(Only GigE/Usb Camera) +/// \param handle [IN] Device handle +/// \param pFrame [IN] Frame data information +/// \param index [IN] index ID +/// \param pChunkDataInfo [OUT] Chunk data infomation +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetChunkDataByIndex(IN IMV_HANDLE handle, IN IMV_Frame* pFrame, IN unsigned int index, OUT IMV_ChunkDataInfo *pChunkDataInfo); + +/// \~chinese +/// \brief 获取流统计信息(IMV_StartGrabbing / IMV_StartGrabbing执行后调用) +/// \param handle [IN] 设备句柄 +/// \param pStreamStatsInfo [OUT] 流统计信息数据 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get stream statistics infomation(Used after excuting IMV_StartGrabbing / IMV_StartGrabbing) +/// \param handle [IN] Device handle +/// \param pStreamStatsInfo [OUT] Stream statistics infomation +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetStatisticsInfo(IN IMV_HANDLE handle, OUT IMV_StreamStatisticsInfo* pStreamStatsInfo); + +/// \~chinese +/// \brief 重置流统计信息(IMV_StartGrabbing / IMV_StartGrabbing执行后调用) +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Reset stream statistics infomation(Used after excuting IMV_StartGrabbing / IMV_StartGrabbing) +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ResetStatisticsInfo(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 判断属性是否可用 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 可用,返回true;不可用,返回false +/// \~english +/// \brief Check the property is available or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Available, return true. Not available, return false +IMV_API bool IMV_CALL IMV_FeatureIsAvailable(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 判断属性是否可读 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 可读,返回true;不可读,返回false +/// \~english +/// \brief Check the property is readable or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Readable, return true. Not readable, return false +IMV_API bool IMV_CALL IMV_FeatureIsReadable(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 判断属性是否可写 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 可写,返回true;不可写,返回false +/// \~english +/// \brief Check the property is writeable or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Writeable, return true. Not writeable, return false +IMV_API bool IMV_CALL IMV_FeatureIsWriteable(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 判断属性是否可流 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 可流,返回true;不可流,返回false +/// \~english +/// \brief Check the property is streamable or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Streamable, return true. Not streamable, return false +IMV_API bool IMV_CALL IMV_FeatureIsStreamable(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 判断属性是否有效 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 有效,返回true;无效,返回false +/// \~english +/// \brief Check the property is valid or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Valid, return true. Invalid, return false +IMV_API bool IMV_CALL IMV_FeatureIsValid(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 获取整型属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pIntValue [OUT] 整型属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get integer property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pIntValue [OUT] Integer property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetIntFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); + +/// \~chinese +/// \brief 获取整型属性可设的最小值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pIntValue [OUT] 整型属性可设的最小值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the integer property settable minimum value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pIntValue [OUT] Integer property settable minimum value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetIntFeatureMin(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); + +/// \~chinese +/// \brief 获取整型属性可设的最大值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pIntValue [OUT] 整型属性可设的最大值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the integer property settable maximum value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pIntValue [OUT] Integer property settable maximum value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetIntFeatureMax(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); + +/// \~chinese +/// \brief 获取整型属性步长 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pIntValue [OUT] 整型属性步长 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get integer property increment +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pIntValue [OUT] Integer property increment +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetIntFeatureInc(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); + +/// \~chinese +/// \brief 设置整型属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param intValue [IN] 待设置的整型属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set integer property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param intValue [IN] Integer property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetIntFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN int64_t intValue); + +/// \~chinese +/// \brief 获取浮点属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pDoubleValue [OUT] 浮点属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get double property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pDoubleValue [OUT] Double property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetDoubleFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); + +/// \~chinese +/// \brief 获取浮点属性可设的最小值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pDoubleValue [OUT] 浮点属性可设的最小值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the double property settable minimum value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pDoubleValue [OUT] Double property settable minimum value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetDoubleFeatureMin(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); + +/// \~chinese +/// \brief 获取浮点属性可设的最大值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pDoubleValue [OUT] 浮点属性可设的最大值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the double property settable maximum value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pDoubleValue [OUT] Double property settable maximum value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetDoubleFeatureMax(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); + +/// \~chinese +/// \brief 设置浮点属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param doubleValue [IN] 待设置的浮点属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set double property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param doubleValue [IN] Double property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetDoubleFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN double doubleValue); + +/// \~chinese +/// \brief 获取布尔属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pBoolValue [OUT] 布尔属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get boolean property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pBoolValue [OUT] Boolean property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetBoolFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT bool* pBoolValue); + +/// \~chinese +/// \brief 设置布尔属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param boolValue [IN] 待设置的布尔属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set boolean property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param boolValue [IN] Boolean property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetBoolFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN bool boolValue); + +/// \~chinese +/// \brief 获取枚举属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEnumValue [OUT] 枚举属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get enumeration property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEnumValue [OUT] Enumeration property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetEnumFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT uint64_t* pEnumValue); + +/// \~chinese +/// \brief 设置枚举属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param enumValue [IN] 待设置的枚举属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set enumeration property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param enumValue [IN] Enumeration property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetEnumFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN uint64_t enumValue); + +/// \~chinese +/// \brief 获取枚举属性symbol值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEnumSymbol [OUT] 枚举属性symbol值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get enumeration property symbol value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEnumSymbol [OUT] Enumeration property symbol value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetEnumFeatureSymbol(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pEnumSymbol); + +/// \~chinese +/// \brief 设置枚举属性symbol值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEnumSymbol [IN] 待设置的枚举属性symbol值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set enumeration property symbol value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEnumSymbol [IN] Enumeration property symbol value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetEnumFeatureSymbol(IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pEnumSymbol); + +/// \~chinese +/// \brief 获取枚举属性的可设枚举值的个数 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEntryNum [OUT] 枚举属性的可设枚举值的个数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the number of enumeration property settable enumeration +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEntryNum [OUT] The number of enumeration property settable enumeration value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetEnumFeatureEntryNum(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT unsigned int* pEntryNum); + +/// \~chinese +/// \brief 获取枚举属性的可设枚举值列表 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEnumEntryList [OUT] 枚举属性的可设枚举值列表 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get settable enumeration value list of enumeration property +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEnumEntryList [OUT] Settable enumeration value list of enumeration property +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetEnumFeatureEntrys(IN IMV_HANDLE handle, IN const char* pFeatureName, IN_OUT IMV_EnumEntryList* pEnumEntryList); + +/// \~chinese +/// \brief 获取字符串属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pStringValue [OUT] 字符串属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get string property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pStringValue [OUT] String property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetStringFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pStringValue); + +/// \~chinese +/// \brief 设置字符串属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pStringValue [IN] 待设置的字符串属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set string property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pStringValue [IN] String property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetStringFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pStringValue); + +/// \~chinese +/// \brief 执行命令属性 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Execute command property +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ExecuteCommandFeature(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 像素格式转换 +/// \param handle [IN] 设备句柄 +/// \param pstPixelConvertParam [IN][OUT] 像素格式转换参数结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持转化成目标像素格式gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 / gvspPixelBGRA8\n +/// 通过该接口将原始图像数据转换成用户所需的像素格式并存放在调用者指定内存中。\n +/// 像素格式为YUV411Packed的时,图像宽须能被4整除\n +/// 像素格式为YUV422Packed的时,图像宽须能被2整除\n +/// 像素格式为YUYVPacked的时,图像宽须能被2整除\n +/// 转换后的图像:数据存储是从最上面第一行开始的,这个是相机数据的默认存储方向 +/// \~english +/// \brief Pixel format conversion +/// \param handle [IN] Device handle +/// \param pstPixelConvertParam [IN][OUT] Convert Pixel Type parameter structure +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only support converting to destination pixel format of gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 / gvspPixelBGRA8\n +/// This API is used to transform the collected original data to pixel format and save to specified memory by caller.\n +/// pixelFormat:YUV411Packed, the image width is divisible by 4\n +/// pixelFormat : YUV422Packed, the image width is divisible by 2\n +/// pixelFormat : YUYVPacked,the image width is divisible by 2\n +/// converted image:The first row of the image is located at the start of the image buffer.This is the default for image taken by a camera. +IMV_API int IMV_CALL IMV_PixelConvert(IN IMV_HANDLE handle, IN_OUT IMV_PixelConvertParam* pstPixelConvertParam); + +/// \~chinese +/// \brief 打开录像 +/// \param handle [IN] 设备句柄 +/// \param pstRecordParam [IN] 录像参数结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Open record +/// \param handle [IN] Device handle +/// \param pstRecordParam [IN] Record param structure +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_OpenRecord(IN IMV_HANDLE handle, IN IMV_RecordParam *pstRecordParam); + +/// \~chinese +/// \brief 录制一帧图像 +/// \param handle [IN] 设备句柄 +/// \param pstRecordFrameInfoParam [IN] 录像用帧信息结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Record one frame +/// \param handle [IN] Device handle +/// \param pstRecordFrameInfoParam [IN] Frame information for recording structure +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_InputOneFrame(IN IMV_HANDLE handle, IN IMV_RecordFrameInfoParam *pstRecordFrameInfoParam); + +/// \~chinese +/// \brief 关闭录像 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Close record +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_CloseRecord(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 图像翻转 +/// \param handle [IN] 设备句柄 +/// \param pstFlipImageParam [IN][OUT] 图像翻转参数结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持像素格式gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8的图像的垂直和水平翻转。\n +/// 通过该接口将原始图像数据翻转后并存放在调用者指定内存中。 +/// \~english +/// \brief Flip image +/// \param handle [IN] Device handle +/// \param pstFlipImageParam [IN][OUT] Flip image parameter structure +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only support vertical and horizontal flip of image data with gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 pixel format.\n +/// This API is used to flip original data and save to specified memory by caller. +IMV_API int IMV_CALL IMV_FlipImage(IN IMV_HANDLE handle, IN_OUT IMV_FlipImageParam* pstFlipImageParam); + +/// \~chinese +/// \brief 图像顺时针旋转 +/// \param handle [IN] 设备句柄 +/// \param pstRotateImageParam [IN][OUT] 图像旋转参数结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8格式数据的90/180/270度顺时针旋转。\n +/// 通过该接口将原始图像数据旋转后并存放在调用者指定内存中。 +/// \~english +/// \brief Rotate image clockwise +/// \param handle [IN] Device handle +/// \param pstRotateImageParam [IN][OUT] Rotate image parameter structure +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only support 90/180/270 clockwise rotation of data in the gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 format.\n +/// This API is used to rotation original data and save to specified memory by caller. +IMV_API int IMV_CALL IMV_RotateImage(IN IMV_HANDLE handle, IN_OUT IMV_RotateImageParam* pstRotateImageParam); + +#ifdef __cplusplus +} +#endif + +#endif // __IMV_API_H__ \ No newline at end of file diff --git a/IMVDefines.h b/IMVDefines.h new file mode 100644 index 0000000..8cb5082 --- /dev/null +++ b/IMVDefines.h @@ -0,0 +1,811 @@ +#ifndef __IMV_DEFINES_H__ +#define __IMV_DEFINES_H__ + +#ifdef WIN32 +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif + +#ifndef IN +#define IN ///< \~chinese 输入型参数 \~english Input param +#endif + +#ifndef OUT +#define OUT ///< \~chinese 输出型参数 \~english Output param +#endif + +#ifndef IN_OUT +#define IN_OUT ///< \~chinese 输入/输出型参数 \~english Input/Output param +#endif + +#ifndef __cplusplus +typedef char bool; +#define true 1 +#define false 0 +#endif + +/// \~chinese +/// \brief 错误码 +/// \~english +/// \brief Error code +#define IMV_OK 0 ///< \~chinese 成功,无错误 \~english Successed, no error +#define IMV_ERROR -101 ///< \~chinese 通用的错误 \~english Generic error +#define IMV_INVALID_HANDLE -102 ///< \~chinese 错误或无效的句柄 \~english Error or invalid handle +#define IMV_INVALID_PARAM -103 ///< \~chinese 错误的参数 \~english Incorrect parameter +#define IMV_INVALID_FRAME_HANDLE -104 ///< \~chinese 错误或无效的帧句柄 \~english Error or invalid frame handle +#define IMV_INVALID_FRAME -105 ///< \~chinese 无效的帧 \~english Invalid frame +#define IMV_INVALID_RESOURCE -106 ///< \~chinese 相机/事件/流等资源无效 \~english Camera/Event/Stream and so on resource invalid +#define IMV_INVALID_IP -107 ///< \~chinese 设备与主机的IP网段不匹配 \~english Device's and PC's subnet is mismatch +#define IMV_NO_MEMORY -108 ///< \~chinese 内存不足 \~english Malloc memery failed +#define IMV_INSUFFICIENT_MEMORY -109 ///< \~chinese 传入的内存空间不足 \~english Insufficient memory +#define IMV_ERROR_PROPERTY_TYPE -110 ///< \~chinese 属性类型错误 \~english Property type error +#define IMV_INVALID_ACCESS -111 ///< \~chinese 属性不可访问、或不能读/写、或读/写失败 \~english Property not accessible, or not be read/written, or read/written failed +#define IMV_INVALID_RANGE -112 ///< \~chinese 属性值超出范围、或者不是步长整数倍 \~english The property's value is out of range, or is not integer multiple of the step +#define IMV_NOT_SUPPORT -113 ///< \~chinese 设备不支持的功能 \~english Device not supported function + +#define IMV_MAX_DEVICE_ENUM_NUM 100 ///< \~chinese 支持设备最大个数 \~english The maximum number of supported devices +#define IMV_MAX_STRING_LENTH 256 ///< \~chinese 字符串最大长度 \~english The maximum length of string +#define IMV_MAX_ERROR_LIST_NUM 128 ///< \~chinese 失败属性列表最大长度 \~english The maximum size of failed properties list + +typedef void* IMV_HANDLE; ///< \~chinese 设备句柄 \~english Device handle +typedef void* IMV_FRAME_HANDLE; ///< \~chinese 帧句柄 \~english Frame handle + +/// \~chinese +///枚举:接口类型 +/// \~english +///Enumeration: interface type +typedef enum _IMV_EInterfaceType +{ + interfaceTypeGige = 0x00000001, ///< \~chinese 网卡接口类型 \~english NIC type + interfaceTypeUsb3 = 0x00000002, ///< \~chinese USB3.0接口类型 \~english USB3.0 interface type + interfaceTypeCL = 0x00000004, ///< \~chinese CAMERALINK接口类型 \~english Cameralink interface type + interfaceTypePCIe = 0x00000008, ///< \~chinese PCIe接口类型 \~english PCIe interface type + interfaceTypeAll = 0x00000000, ///< \~chinese 忽略接口类型 \~english All types interface type + interfaceInvalidType = 0xFFFFFFFF ///< \~chinese 无效接口类型 \~english Invalid interface type +}IMV_EInterfaceType; + +/// \~chinese +///枚举:设备类型 +/// \~english +///Enumeration: device type +typedef enum _IMV_ECameraType +{ + typeGigeCamera = 0, ///< \~chinese GIGE相机 \~english GigE Vision Camera + typeU3vCamera = 1, ///< \~chinese USB3.0相机 \~english USB3.0 Vision Camera + typeCLCamera = 2, ///< \~chinese CAMERALINK 相机 \~english Cameralink camera + typePCIeCamera = 3, ///< \~chinese PCIe相机 \~english PCIe Camera + typeUndefinedCamera = 255 ///< \~chinese 未知类型 \~english Undefined Camera +}IMV_ECameraType; + +/// \~chinese +///枚举:创建句柄方式 +/// \~english +///Enumeration: Create handle mode +typedef enum _IMV_ECreateHandleMode +{ + modeByIndex = 0, ///< \~chinese 通过已枚举设备的索引(从0开始,比如 0, 1, 2...) \~english By index of enumerated devices (Start from 0, such as 0, 1, 2...) + modeByCameraKey, ///< \~chinese 通过设备键"厂商:序列号" \~english By device's key "vendor:serial number" + modeByDeviceUserID, ///< \~chinese 通过设备自定义名 \~english By device userID + modeByIPAddress, ///< \~chinese 通过设备IP地址 \~english By device IP address. +}IMV_ECreateHandleMode; + +/// \~chinese +///枚举:访问权限 +/// \~english +///Enumeration: access permission +typedef enum _IMV_ECameraAccessPermission +{ + accessPermissionOpen = 0, ///< \~chinese GigE相机没有被连接 \~english The GigE vision device isn't connected to any application. + accessPermissionExclusive, ///< \~chinese 独占访问权限 \~english Exclusive Access Permission + accessPermissionControl, ///< \~chinese 非独占可读访问权限 \~english Non-Exclusive Readbale Access Permission + accessPermissionControlWithSwitchover, ///< \~chinese 切换控制访问权限 \~english Control access with switchover enabled. + accessPermissionUnknown = 254, ///< \~chinese 无法确定 \~english Value not known; indeterminate. + accessPermissionUndefined ///< \~chinese 未定义访问权限 \~english Undefined Access Permission +}IMV_ECameraAccessPermission; + +/// \~chinese +///枚举:抓图策略 +/// \~english +///Enumeration: grab strartegy +typedef enum _IMV_EGrabStrategy +{ + grabStrartegySequential = 0, ///< \~chinese 按到达顺序处理图片 \~english The images are processed in the order of their arrival + grabStrartegyLatestImage = 1, ///< \~chinese 获取最新的图片 \~english Get latest image + grabStrartegyUpcomingImage = 2, ///< \~chinese 等待获取下一张图片(只针对GigE相机) \~english Waiting for next image(GigE only) + grabStrartegyUndefined ///< \~chinese 未定义 \~english Undefined +}IMV_EGrabStrategy; + +/// \~chinese +///枚举:流事件状态 +/// \~english +/// Enumeration:stream event status +typedef enum _IMV_EEventStatus +{ + streamEventNormal = 1, ///< \~chinese 正常流事件 \~english Normal stream event + streamEventLostFrame = 2, ///< \~chinese 丢帧事件 \~english Lost frame event + streamEventLostPacket = 3, ///< \~chinese 丢包事件 \~english Lost packet event + streamEventImageError = 4, ///< \~chinese 图像错误事件 \~english Error image event + streamEventStreamChannelError = 5, ///< \~chinese 取流错误事件 \~english Stream channel error event + streamEventTooManyConsecutiveResends = 6, ///< \~chinese 太多连续重传 \~english Too many consecutive resends event + streamEventTooManyLostPacket = 7 ///< \~chinese 太多丢包 \~english Too many lost packet event +}IMV_EEventStatus; + +/// \~chinese +///枚举:图像转换Bayer格式所用的算法 +/// \~english +/// Enumeration:alorithm used for Bayer demosaic +typedef enum _IMV_EBayerDemosaic +{ + demosaicNearestNeighbor, ///< \~chinese 最近邻 \~english Nearest neighbor + demosaicBilinear, ///< \~chinese 双线性 \~english Bilinear + demosaicEdgeSensing, ///< \~chinese 边缘检测 \~english Edge sensing + demosaicNotSupport = 255, ///< \~chinese 不支持 \~english Not support +}IMV_EBayerDemosaic; + +/// \~chinese +///枚举:事件类型 +/// \~english +/// Enumeration:event type +typedef enum _IMV_EVType +{ + offLine, ///< \~chinese 设备离线通知 \~english device offline notification + onLine ///< \~chinese 设备在线通知 \~english device online notification +}IMV_EVType; + +/// \~chinese +///枚举:视频格式 +/// \~english +/// Enumeration:Video format +typedef enum _IMV_EVideoType +{ + typeVideoFormatAVI = 0, ///< \~chinese AVI格式 \~english AVI format + typeVideoFormatNotSupport = 255 ///< \~chinese 不支持 \~english Not support +}IMV_EVideoType; + +/// \~chinese +///枚举:图像翻转类型 +/// \~english +/// Enumeration:Image flip type +typedef enum _IMV_EFlipType +{ + typeFlipVertical, ///< \~chinese 垂直(Y轴)翻转 \~english Vertical(Y-axis) flip + typeFlipHorizontal ///< \~chinese 水平(X轴)翻转 \~english Horizontal(X-axis) flip +}IMV_EFlipType; + +/// \~chinese +///枚举:顺时针旋转角度 +/// \~english +/// Enumeration:Rotation angle clockwise +typedef enum _IMV_ERotationAngle +{ + rotationAngle90, ///< \~chinese 顺时针旋转90度 \~english Rotate 90 degree clockwise + rotationAngle180, ///< \~chinese 顺时针旋转180度 \~english Rotate 180 degree clockwise + rotationAngle270, ///< \~chinese 顺时针旋转270度 \~english Rotate 270 degree clockwise +}IMV_ERotationAngle; + +#define IMV_GVSP_PIX_MONO 0x01000000 +#define IMV_GVSP_PIX_RGB 0x02000000 +#define IMV_GVSP_PIX_COLOR 0x02000000 +#define IMV_GVSP_PIX_CUSTOM 0x80000000 +#define IMV_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 IMV_GVSP_PIX_OCCUPY1BIT 0x00010000 +#define IMV_GVSP_PIX_OCCUPY2BIT 0x00020000 +#define IMV_GVSP_PIX_OCCUPY4BIT 0x00040000 +#define IMV_GVSP_PIX_OCCUPY8BIT 0x00080000 +#define IMV_GVSP_PIX_OCCUPY12BIT 0x000C0000 +#define IMV_GVSP_PIX_OCCUPY16BIT 0x00100000 +#define IMV_GVSP_PIX_OCCUPY24BIT 0x00180000 +#define IMV_GVSP_PIX_OCCUPY32BIT 0x00200000 +#define IMV_GVSP_PIX_OCCUPY36BIT 0x00240000 +#define IMV_GVSP_PIX_OCCUPY48BIT 0x00300000 + +/// \~chinese +///枚举:图像格式 +/// \~english +/// Enumeration:image format +typedef enum _IMV_EPixelType +{ + // Undefined pixel type + gvspPixelTypeUndefined = -1, + + // Mono Format + gvspPixelMono1p = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY1BIT | 0x0037), + gvspPixelMono2p = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY2BIT | 0x0038), + gvspPixelMono4p = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY4BIT | 0x0039), + gvspPixelMono8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x0001), + gvspPixelMono8S = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x0002), + gvspPixelMono10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0003), + gvspPixelMono10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0004), + gvspPixelMono12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0005), + gvspPixelMono12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0006), + gvspPixelMono14 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0025), + gvspPixelMono16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0007), + + // Bayer Format + gvspPixelBayGR8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x0008), + gvspPixelBayRG8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x0009), + gvspPixelBayGB8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x000A), + gvspPixelBayBG8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x000B), + gvspPixelBayGR10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x000C), + gvspPixelBayRG10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x000D), + gvspPixelBayGB10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x000E), + gvspPixelBayBG10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x000F), + gvspPixelBayGR12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0010), + gvspPixelBayRG12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0011), + gvspPixelBayGB12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0012), + gvspPixelBayBG12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0013), + gvspPixelBayGR10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0026), + gvspPixelBayRG10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0027), + gvspPixelBayGB10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0028), + gvspPixelBayBG10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0029), + gvspPixelBayGR12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x002A), + gvspPixelBayRG12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x002B), + gvspPixelBayGB12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x002C), + gvspPixelBayBG12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x002D), + gvspPixelBayGR16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x002E), + gvspPixelBayRG16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x002F), + gvspPixelBayGB16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0030), + gvspPixelBayBG16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0031), + + // RGB Format + gvspPixelRGB8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0014), + gvspPixelBGR8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0015), + gvspPixelRGBA8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY32BIT | 0x0016), + gvspPixelBGRA8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY32BIT | 0x0017), + gvspPixelRGB10 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0018), + gvspPixelBGR10 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0019), + gvspPixelRGB12 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x001A), + gvspPixelBGR12 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x001B), + gvspPixelRGB16 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0033), + gvspPixelRGB10V1Packed = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY32BIT | 0x001C), + gvspPixelRGB10P32 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY32BIT | 0x001D), + gvspPixelRGB12V1Packed = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY36BIT | 0X0034), + gvspPixelRGB565P = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0035), + gvspPixelBGR565P = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0X0036), + + // YVR Format + gvspPixelYUV411_8_UYYVYY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY12BIT | 0x001E), + gvspPixelYUV422_8_UYVY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x001F), + gvspPixelYUV422_8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0032), + gvspPixelYUV8_UYV = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0020), + gvspPixelYCbCr8CbYCr = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x003A), + gvspPixelYCbCr422_8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x003B), + gvspPixelYCbCr422_8_CbYCrY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0043), + gvspPixelYCbCr411_8_CbYYCrYY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY12BIT | 0x003C), + gvspPixelYCbCr601_8_CbYCr = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x003D), + gvspPixelYCbCr601_422_8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x003E), + gvspPixelYCbCr601_422_8_CbYCrY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0044), + gvspPixelYCbCr601_411_8_CbYYCrYY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY12BIT | 0x003F), + gvspPixelYCbCr709_8_CbYCr = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0040), + gvspPixelYCbCr709_422_8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0041), + gvspPixelYCbCr709_422_8_CbYCrY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0045), + gvspPixelYCbCr709_411_8_CbYYCrYY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY12BIT | 0x0042), + + // RGB Planar + gvspPixelRGB8Planar = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0021), + gvspPixelRGB10Planar = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0022), + gvspPixelRGB12Planar = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0023), + gvspPixelRGB16Planar = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0024), + + //BayerRG10p和BayerRG12p格式,针对特定项目临时添加,请不要使用 + //BayerRG10p and BayerRG12p, currently used for specific project, please do not use them + gvspPixelBayRG10p = 0x010A0058, + gvspPixelBayRG12p = 0x010c0059, + + //mono1c格式,自定义格式 + //mono1c, customized image format, used for binary output + gvspPixelMono1c = 0x012000FF, + + //mono1e格式,自定义格式,用来显示连通域 + //mono1e, customized image format, used for displaying connected domain + gvspPixelMono1e = 0x01080FFF +}IMV_EPixelType; + +/// \~chinese +/// \brief 字符串信息 +/// \~english +/// \brief String information +typedef struct _IMV_String +{ + char str[IMV_MAX_STRING_LENTH]; ///< \~chinese 字符串.长度不超过256 \~english Strings and the maximum length of strings is 255. +}IMV_String; + +/// \~chinese +/// \brief GigE网卡信息 +/// \~english +/// \brief GigE interface information +typedef struct _IMV_GigEInterfaceInfo +{ + char description[IMV_MAX_STRING_LENTH]; ///< \~chinese 网卡描述信息 \~english Network card description + char macAddress[IMV_MAX_STRING_LENTH]; ///< \~chinese 网卡Mac地址 \~english Network card MAC Address + char ipAddress[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备Ip地址 \~english Device ip Address + char subnetMask[IMV_MAX_STRING_LENTH]; ///< \~chinese 子网掩码 \~english SubnetMask + char defaultGateWay[IMV_MAX_STRING_LENTH]; ///< \~chinese 默认网关 \~english Default GateWay + char chReserved[5][IMV_MAX_STRING_LENTH]; ///< 保留 \~english Reserved field +}IMV_GigEInterfaceInfo; + +/// \~chinese +/// \brief USB接口信息 +/// \~english +/// \brief USB interface information +typedef struct _IMV_UsbInterfaceInfo +{ + char description[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口描述信息 \~english USB interface description + char vendorID[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口Vendor ID \~english USB interface Vendor ID + char deviceID[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口设备ID \~english USB interface Device ID + char subsystemID[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口Subsystem ID \~english USB interface Subsystem ID + char revision[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口Revision \~english USB interface Revision + char speed[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口speed \~english USB interface speed + char chReserved[4][IMV_MAX_STRING_LENTH]; ///< 保留 \~english Reserved field +}IMV_UsbInterfaceInfo; + +/// \~chinese +/// \brief GigE设备信息 +/// \~english +/// \brief GigE device information +typedef struct _IMV_GigEDeviceInfo +{ + /// \~chinese + /// 设备支持的IP配置选项\n + /// value:4 相机只支持LLA\n + /// value:5 相机支持LLA和Persistent IP\n + /// value:6 相机支持LLA和DHCP\n + /// value:7 相机支持LLA、DHCP和Persistent IP\n + /// value:0 获取失败 + /// \~english + /// Supported IP configuration options of device\n + /// value:4 Device supports LLA \n + /// value:5 Device supports LLA and Persistent IP\n + /// value:6 Device supports LLA and DHCP\n + /// value:7 Device supports LLA, DHCP and Persistent IP\n + /// value:0 Get fail + unsigned int nIpConfigOptions; + /// \~chinese + /// 设备当前的IP配置选项\n + /// value:4 LLA处于活动状态\n + /// value:5 LLA和Persistent IP处于活动状态\n + /// value:6 LLA和DHCP处于活动状态\n + /// value:7 LLA、DHCP和Persistent IP处于活动状态\n + /// value:0 获取失败 + /// \~english + /// Current IP Configuration options of device\n + /// value:4 LLA is active\n + /// value:5 LLA and Persistent IP are active\n + /// value:6 LLA and DHCP are active\n + /// value:7 LLA, DHCP and Persistent IP are active\n + /// value:0 Get fail + unsigned int nIpConfigCurrent; + unsigned int nReserved[3]; ///< \~chinese 保留 \~english Reserved field + + char macAddress[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备Mac地址 \~english Device MAC Address + char ipAddress[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备Ip地址 \~english Device ip Address + char subnetMask[IMV_MAX_STRING_LENTH]; ///< \~chinese 子网掩码 \~english SubnetMask + char defaultGateWay[IMV_MAX_STRING_LENTH]; ///< \~chinese 默认网关 \~english Default GateWay + char protocolVersion[IMV_MAX_STRING_LENTH]; ///< \~chinese 网络协议版本 \~english Net protocol version + /// \~chinese + /// Ip配置有效性\n + /// Ip配置有效时字符串值"Valid"\n + /// Ip配置无效时字符串值"Invalid On This Interface" + /// \~english + /// IP configuration valid\n + /// String value is "Valid" when ip configuration valid\n + /// String value is "Invalid On This Interface" when ip configuration invalid + char ipConfiguration[IMV_MAX_STRING_LENTH]; + char chReserved[6][IMV_MAX_STRING_LENTH]; ///< \~chinese 保留 \~english Reserved field + +}IMV_GigEDeviceInfo; + +/// \~chinese +/// \brief Usb设备信息 +/// \~english +/// \brief Usb device information +typedef struct _IMV_UsbDeviceInfo +{ + bool bLowSpeedSupported; ///< \~chinese true支持,false不支持,其他值 非法。 \~english true support,false not supported,other invalid + bool bFullSpeedSupported; ///< \~chinese true支持,false不支持,其他值 非法。 \~english true support,false not supported,other invalid + bool bHighSpeedSupported; ///< \~chinese true支持,false不支持,其他值 非法。 \~english true support,false not supported,other invalid + bool bSuperSpeedSupported; ///< \~chinese true支持,false不支持,其他值 非法。 \~english true support,false not supported,other invalid + bool bDriverInstalled; ///< \~chinese true安装,false未安装,其他值 非法。 \~english true support,false not supported,other invalid + bool boolReserved[3]; ///< \~chinese 保留 + unsigned int Reserved[4]; ///< \~chinese 保留 \~english Reserved field + + char configurationValid[IMV_MAX_STRING_LENTH]; ///< \~chinese 配置有效性 \~english Configuration Valid + char genCPVersion[IMV_MAX_STRING_LENTH]; ///< \~chinese GenCP 版本 \~english GenCP Version + char u3vVersion[IMV_MAX_STRING_LENTH]; ///< \~chinese U3V 版本号 \~english U3v Version + char deviceGUID[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备引导号 \~english Device guid number + char familyName[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备系列号 \~english Device serial number + char u3vSerialNumber[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备序列号 \~english Device SerialNumber + char speed[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备传输速度 \~english Device transmission speed + char maxPower[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备最大供电量 \~english Maximum power supply of device + char chReserved[4][IMV_MAX_STRING_LENTH]; ///< \~chinese 保留 \~english Reserved field + +}IMV_UsbDeviceInfo; + +/// \~chinese +/// \brief 设备通用信息 +/// \~english +/// \brief Device general information +typedef struct _IMV_DeviceInfo +{ + IMV_ECameraType nCameraType; ///< \~chinese 设备类别 \~english Camera type + int nCameraReserved[5]; ///< \~chinese 保留 \~english Reserved field + + char cameraKey[IMV_MAX_STRING_LENTH]; ///< \~chinese 厂商:序列号 \~english Camera key + char cameraName[IMV_MAX_STRING_LENTH]; ///< \~chinese 用户自定义名 \~english UserDefinedName + char serialNumber[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备序列号 \~english Device SerialNumber + char vendorName[IMV_MAX_STRING_LENTH]; ///< \~chinese 厂商 \~english Camera Vendor + char modelName[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备型号 \~english Device model + char manufactureInfo[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备制造信息 \~english Device ManufactureInfo + char deviceVersion[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备版本 \~english Device Version + char cameraReserved[5][IMV_MAX_STRING_LENTH]; ///< \~chinese 保留 \~english Reserved field + union + { + IMV_GigEDeviceInfo gigeDeviceInfo; ///< \~chinese Gige设备信息 \~english Gige Device Information + IMV_UsbDeviceInfo usbDeviceInfo; ///< \~chinese Usb设备信息 \~english Usb Device Information + }DeviceSpecificInfo; + + IMV_EInterfaceType nInterfaceType; ///< \~chinese 接口类别 \~english Interface type + int nInterfaceReserved[5]; ///< \~chinese 保留 \~english Reserved field + char interfaceName[IMV_MAX_STRING_LENTH]; ///< \~chinese 接口名 \~english Interface Name + char interfaceReserved[5][IMV_MAX_STRING_LENTH]; ///< \~chinese 保留 \~english Reserved field + union + { + IMV_GigEInterfaceInfo gigeInterfaceInfo; ///< \~chinese GigE网卡信息 \~english Gige interface Information + IMV_UsbInterfaceInfo usbInterfaceInfo; ///< \~chinese Usb接口信息 \~english Usb interface Information + }InterfaceInfo; +}IMV_DeviceInfo; + +/// \~chinese +/// \brief 加载失败的属性信息 +/// \~english +/// \brief Load failed properties information +typedef struct _IMV_ErrorList +{ + unsigned int nParamCnt; ///< \~chinese 加载失败的属性个数 \~english The count of load failed properties + IMV_String paramNameList[IMV_MAX_ERROR_LIST_NUM]; ///< \~chinese 加载失败的属性集合,上限128 \~english Array of load failed properties, up to 128 +}IMV_ErrorList; + +/// \~chinese +/// \brief 设备信息列表 +/// \~english +/// \brief Device information list +typedef struct _IMV_DeviceList +{ + unsigned int nDevNum; ///< \~chinese 设备数量 \~english Device Number + IMV_DeviceInfo* pDevInfo; ///< \~chinese 设备息列表(SDK内部缓存),最多100设备 \~english Device information list(cached within the SDK), up to 100 +}IMV_DeviceList; + +/// \~chinese +/// \brief 连接事件信息 +/// \~english +/// \brief connection event information +typedef struct _IMV_SConnectArg +{ + IMV_EVType event; ///< \~chinese 事件类型 \~english event type + unsigned int nReserve[10]; ///< \~chinese 预留字段 \~english Reserved field +}IMV_SConnectArg; + +/// \~chinese +/// \brief 参数更新事件信息 +/// \~english +/// \brief Updating parameters event information +typedef struct _IMV_SParamUpdateArg +{ + bool isPoll; ///< \~chinese 是否是定时更新,true:表示是定时更新,false:表示非定时更新 \~english Update periodically or not. true:update periodically, true:not update periodically + unsigned int nReserve[10]; ///< \~chinese 预留字段 \~english Reserved field + unsigned int nParamCnt; ///< \~chinese 更新的参数个数 \~english The number of parameters which need update + IMV_String* pParamNameList; ///< \~chinese 更新的参数名称集合(SDK内部缓存) \~english Array of parameter's name which need to be updated(cached within the SDK) +}IMV_SParamUpdateArg; + +/// \~chinese +/// \brief 流事件信息 +/// \~english +/// \brief Stream event information +typedef struct _IMV_SStreamArg +{ + unsigned int channel; ///< \~chinese 流通道号 \~english Channel no. + uint64_t blockId; ///< \~chinese 流数据BlockID \~english Block ID of stream data + uint64_t timeStamp; ///< \~chinese 时间戳 \~english Event time stamp + IMV_EEventStatus eStreamEventStatus; ///< \~chinese 流事件状态码 \~english Stream event status code + unsigned int status; ///< \~chinese 事件状态错误码 \~english Status error code + unsigned int nReserve[9]; ///< \~chinese 预留字段 \~english Reserved field +}IMV_SStreamArg; + +/// \~chinese +/// 消息通道事件ID列表 +/// \~english +/// message channel event id list +#define IMV_MSG_EVENT_ID_EXPOSURE_END 0x9001 +#define IMV_MSG_EVENT_ID_FRAME_TRIGGER 0x9002 +#define IMV_MSG_EVENT_ID_FRAME_START 0x9003 +#define IMV_MSG_EVENT_ID_ACQ_START 0x9004 +#define IMV_MSG_EVENT_ID_ACQ_TRIGGER 0x9005 +#define IMV_MSG_EVENT_ID_DATA_READ_OUT 0x9006 + +/// \~chinese +/// \brief 消息通道事件信息 +/// \~english +/// \brief Message channel event information +typedef struct _IMV_SMsgChannelArg +{ + unsigned short eventId; ///< \~chinese 事件Id \~english Event id + unsigned short channelId; ///< \~chinese 消息通道号 \~english Channel id + uint64_t blockId; ///< \~chinese 流数据BlockID \~english Block ID of stream data + uint64_t timeStamp; ///< \~chinese 时间戳 \~english Event timestamp + unsigned int nReserve[8]; ///< \~chinese 预留字段 \~english Reserved field + unsigned int nParamCnt; ///< \~chinese 参数个数 \~english The number of parameters which need update + IMV_String* pParamNameList; ///< \~chinese 事件相关的属性名列集合(SDK内部缓存) \~english Array of parameter's name which is related(cached within the SDK) +}IMV_SMsgChannelArg; + +/// \~chinese +/// \brief Chunk数据信息 +/// \~english +/// \brief Chunk data information +typedef struct _IMV_ChunkDataInfo +{ + unsigned int chunkID; ///< \~chinese ChunkID \~english ChunkID + unsigned int nParamCnt; ///< \~chinese 属性名个数 \~english The number of paramNames + IMV_String* pParamNameList; ///< \~chinese Chunk数据对应的属性名集合(SDK内部缓存) \~english ParamNames Corresponding property name of chunk data(cached within the SDK) +}IMV_ChunkDataInfo; + +/// \~chinese +/// \brief 帧图像信息 +/// \~english +/// \brief The frame image information +typedef struct _IMV_FrameInfo +{ + uint64_t blockId; ///< \~chinese 帧Id(仅对GigE/Usb/PCIe相机有效) \~english The block ID(GigE/Usb/PCIe camera only) + unsigned int status; ///< \~chinese 数据帧状态(0是正常状态) \~english The status of frame(0 is normal status) + unsigned int width; ///< \~chinese 图像宽度 \~english The width of image + unsigned int height; ///< \~chinese 图像高度 \~english The height of image + unsigned int size; ///< \~chinese 图像大小 \~english The size of image + IMV_EPixelType pixelFormat; ///< \~chinese 图像像素格式 \~english The pixel format of image + uint64_t timeStamp; ///< \~chinese 图像时间戳(仅对GigE/Usb/PCIe相机有效) \~english The timestamp of image(GigE/Usb/PCIe camera only) + unsigned int chunkCount; ///< \~chinese 帧数据中包含的Chunk个数(仅对GigE/Usb相机有效) \~english The number of chunk in frame data(GigE/Usb Camera Only) + unsigned int paddingX; ///< \~chinese 图像paddingX(仅对GigE/Usb/PCIe相机有效) \~english The paddingX of image(GigE/Usb/PCIe camera only) + unsigned int paddingY; ///< \~chinese 图像paddingY(仅对GigE/Usb/PCIe相机有效) \~english The paddingY of image(GigE/Usb/PCIe camera only) + unsigned int recvFrameTime; ///< \~chinese 图像在网络传输所用的时间(单位:微秒,非GigE相机该值为0) \~english The time taken for the image to be transmitted over the network(unit:us, The value is 0 for non-GigE camera) + unsigned int nReserved[19]; ///< \~chinese 预留字段 \~english Reserved field +}IMV_FrameInfo; + +/// \~chinese +/// \brief 帧图像数据信息 +/// \~english +/// \brief Frame image data information +typedef struct _IMV_Frame +{ + IMV_FRAME_HANDLE frameHandle; ///< \~chinese 帧图像句柄(SDK内部帧管理用) \~english Frame image handle(used for managing frame within the SDK) + unsigned char* pData; ///< \~chinese 帧图像数据的内存首地址 \~english The starting address of memory of image data + IMV_FrameInfo frameInfo; ///< \~chinese 帧信息 \~english Frame information + unsigned int nReserved[10]; ///< \~chinese 预留字段 \~english Reserved field +}IMV_Frame; + +/// \~chinese +/// \brief PCIE设备统计流信息 +/// \~english +/// \brief PCIE device stream statistics information +typedef struct _IMV_PCIEStreamStatsInfo +{ + unsigned int imageError; ///< \~chinese 图像错误的帧数 \~english Number of images error frames + unsigned int lostPacketBlock; ///< \~chinese 丢包的帧数 \~english Number of frames lost + unsigned int nReserved0[10]; ///< \~chinese 预留 \~english Reserved field + + unsigned int imageReceived; ///< \~chinese 正常获取的帧数 \~english Number of frames acquired + double fps; ///< \~chinese 帧率 \~english Frame rate + double bandwidth; ///< \~chinese 带宽(Mbps) \~english Bandwidth(Mbps) + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved field +}IMV_PCIEStreamStatsInfo; + +/// \~chinese +/// \brief U3V设备统计流信息 +/// \~english +/// \brief U3V device stream statistics information +typedef struct _IMV_U3VStreamStatsInfo +{ + unsigned int imageError; ///< \~chinese 图像错误的帧数 \~english Number of images error frames + unsigned int lostPacketBlock; ///< \~chinese 丢包的帧数 \~english Number of frames lost + unsigned int nReserved0[10]; ///< \~chinese 预留 \~english Reserved field + + unsigned int imageReceived; ///< \~chinese 正常获取的帧数 \~english Number of images error frames + double fps; ///< \~chinese 帧率 \~english Frame rate + double bandwidth; ///< \~chinese 带宽(Mbps) \~english Bandwidth(Mbps) + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved field +}IMV_U3VStreamStatsInfo; + +/// \~chinese +/// \brief Gige设备统计流信息 +/// \~english +/// \brief Gige device stream statistics information +typedef struct _IMV_GigEStreamStatsInfo +{ + unsigned int nReserved0[10]; ///< \~chinese 预留 \~english Reserved field + + unsigned int imageError; ///< \~chinese 图像错误的帧数 \~english Number of image error frames + unsigned int lostPacketBlock; ///< \~chinese 丢包的帧数 \~english Number of frames lost + unsigned int nReserved1[4]; ///< \~chinese 预留 \~english Reserved field + unsigned int nReserved2[5]; ///< \~chinese 预留 \~english Reserved field + + unsigned int imageReceived; ///< \~chinese 正常获取的帧数 \~english Number of frames acquired + double fps; ///< \~chinese 帧率 \~english Frame rate + double bandwidth; ///< \~chinese 带宽(Mbps) \~english Bandwidth(Mbps) + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved field +}IMV_GigEStreamStatsInfo; + +/// \~chinese +/// \brief 统计流信息 +/// \~english +/// \brief Stream statistics information +typedef struct _IMV_StreamStatisticsInfo +{ + IMV_ECameraType nCameraType; ///< \~chinese 设备类型 \~english Device type + + union + { + IMV_PCIEStreamStatsInfo pcieStatisticsInfo; ///< \~chinese PCIE设备统计信息 \~english PCIE device statistics information + IMV_U3VStreamStatsInfo u3vStatisticsInfo; ///< \~chinese U3V设备统计信息 \~english U3V device statistics information + IMV_GigEStreamStatsInfo gigeStatisticsInfo; ///< \~chinese Gige设备统计信息 \~english GIGE device statistics information + }; +}IMV_StreamStatisticsInfo; + +/// \~chinese +/// \brief 枚举属性的枚举值信息 +/// \~english +/// \brief Enumeration property 's enumeration value information +typedef struct _IMV_EnumEntryInfo +{ + uint64_t value; ///< \~chinese 枚举值 \~english Enumeration value + char name[IMV_MAX_STRING_LENTH]; ///< \~chinese symbol名 \~english Symbol name +}IMV_EnumEntryInfo; + +/// \~chinese +/// \brief 枚举属性的可设枚举值列表信息 +/// \~english +/// \brief Enumeration property 's settable enumeration value list information +typedef struct _IMV_EnumEntryList +{ + unsigned int nEnumEntryBufferSize; ///< \~chinese 存放枚举值内存大小 \~english The size of saving enumeration value + IMV_EnumEntryInfo* pEnumEntryInfo; ///< \~chinese 存放可设枚举值列表(调用者分配缓存) \~english Save the list of settable enumeration value(allocated cache by the caller) +}IMV_EnumEntryList; + +/// \~chinese +/// \brief 像素转换结构体 +/// \~english +/// \brief Pixel convert structure +typedef struct _IMV_PixelConvertParam +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + IMV_EPixelType ePixelFormat; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned char* pSrcData; ///< [IN] \~chinese 输入图像数据 \~english Input image data + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入图像长度 \~english Input image length + unsigned int nPaddingX; ///< [IN] \~chinese 图像宽填充 \~english Padding X + unsigned int nPaddingY; ///< [IN] \~chinese 图像高填充 \~english Padding Y + IMV_EBayerDemosaic eBayerDemosaic; ///< [IN] \~chinese 转换Bayer格式算法 \~english Alorithm used for Bayer demosaic + IMV_EPixelType eDstPixelFormat; ///< [IN] \~chinese 目标像素格式 \~english Destination pixel format + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存(调用者分配缓存) \~english Output data buffer(allocated cache by the caller) + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstDataLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved field +}IMV_PixelConvertParam; + +/// \~chinese +/// \brief 录像结构体 +/// \~english +/// \brief Record structure +typedef struct _IMV_RecordParam +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + float fFameRate; ///< [IN] \~chinese 帧率(大于0) \~english Frame rate(greater than 0) + unsigned int nQuality; ///< [IN] \~chinese 视频质量(1-100) \~english Video quality(1-100) + IMV_EVideoType recordFormat; ///< [IN] \~chinese 视频格式 \~english Video format + const char* pRecordFilePath; ///< [IN] \~chinese 保存视频路径 \~english Save video path + unsigned int nReserved[5]; ///< \~chinese 预留 \~english Reserved +}IMV_RecordParam; + +/// \~chinese +/// \brief 录像用帧信息结构体 +/// \~english +/// \brief Frame information for recording structure +typedef struct _IMV_RecordFrameInfoParam +{ + unsigned char* pData; ///< [IN] \~chinese 图像数据 \~english Image data + unsigned int nDataLen; ///< [IN] \~chinese 图像数据长度 \~english Image data length + unsigned int nPaddingX; ///< [IN] \~chinese 图像宽填充 \~english Padding X + unsigned int nPaddingY; ///< [IN] \~chinese 图像高填充 \~english Padding Y + IMV_EPixelType ePixelFormat; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned int nReserved[5]; ///< \~chinese 预留 \~english Reserved +}IMV_RecordFrameInfoParam; + +/// \~chinese +/// \brief 图像翻转结构体 +/// \~english +/// \brief Flip image structure +typedef struct _IMV_FlipImageParam +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + IMV_EPixelType ePixelFormat; ///< [IN] \~chinese 像素格式 \~english Pixel format + IMV_EFlipType eFlipType; ///< [IN] \~chinese 翻转类型 \~english Flip type + unsigned char* pSrcData; ///< [IN] \~chinese 输入图像数据 \~english Input image data + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入图像长度 \~english Input image length + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存(调用者分配缓存) \~english Output data buffer(allocated cache by the caller) + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstDataLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved +}IMV_FlipImageParam; + +/// \~chinese +/// \brief 图像旋转结构体 +/// \~english +/// \brief Rotate image structure +typedef struct _IMV_RotateImageParam +{ + unsigned int nWidth; ///< [IN][OUT] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN][OUT] \~chinese 图像高 \~english Height + IMV_EPixelType ePixelFormat; ///< [IN] \~chinese 像素格式 \~english Pixel format + IMV_ERotationAngle eRotationAngle; ///< [IN] \~chinese 旋转角度 \~english Rotation angle + unsigned char* pSrcData; ///< [IN] \~chinese 输入图像数据 \~english Input image data + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入图像长度 \~english Input image length + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存(调用者分配缓存) \~english Output data buffer(allocated cache by the caller) + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstDataLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved +}IMV_RotateImageParam; + +/// \~chinese +/// \brief 设备连接状态事件回调函数声明 +/// \param pParamUpdateArg [in] 回调时主动推送的设备连接状态事件信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of device connection status event +/// \param pStreamArg [in] The device connection status event which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_ConnectCallBack)(const IMV_SConnectArg* pConnectArg, void* pUser); + +/// \~chinese +/// \brief 参数更新事件回调函数声明 +/// \param pParamUpdateArg [in] 回调时主动推送的参数更新事件信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of parameter update event +/// \param pStreamArg [in] The parameter update event which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_ParamUpdateCallBack)(const IMV_SParamUpdateArg* pParamUpdateArg, void* pUser); + +/// \~chinese +/// \brief 流事件回调函数声明 +/// \param pStreamArg [in] 回调时主动推送的流事件信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of stream event +/// \param pStreamArg [in] The stream event which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_StreamCallBack)(const IMV_SStreamArg* pStreamArg, void* pUser); + +/// \~chinese +/// \brief 消息通道事件回调函数声明 +/// \param pMsgChannelArg [in] 回调时主动推送的消息通道事件信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of message channel event +/// \param pMsgChannelArg [in] The message channel event which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_MsgChannelCallBack)(const IMV_SMsgChannelArg* pMsgChannelArg, void* pUser); + +/// \~chinese +/// \brief 帧数据信息回调函数声明 +/// \param pFrame [in] 回调时主动推送的帧信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of frame data information +/// \param pFrame [in] The frame information which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_FrameCallBack)(IMV_Frame* pFrame, void* pUser); + +#endif // __IMV_DEFINES_H__ \ No newline at end of file diff --git a/include/IMVApi.h b/include/IMVApi.h new file mode 100644 index 0000000..e7fb265 --- /dev/null +++ b/include/IMVApi.h @@ -0,0 +1,1071 @@ +/// \mainpage +/// \~chinese +/// \htmlinclude mainpage_chs.html +/// \~english +/// \htmlinclude mainpage_eng.html + +#ifndef __IMV_API_H__ +#define __IMV_API_H__ + +#include "IMVDefines.h" + +/// \~chinese +/// \brief 动态库导入导出定义 +/// \~english +/// \brief Dynamic library import and export definition +#if (defined (_WIN32) || defined(WIN64)) + #ifdef IMV_API_DLL_BUILD + #define IMV_API _declspec(dllexport) + #else + #define IMV_API _declspec(dllimport) + #endif + + #define IMV_CALL __stdcall +#else + #define IMV_API + #define IMV_CALL +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/// \~chinese +/// \brief 获取版本信息 +/// \return 成功时返回版本信息,失败时返回NULL +/// \~english +/// \brief get version information +/// \return Success, return version info. Failure, return NULL +IMV_API const char* IMV_CALL IMV_GetVersion(void); + +/// \~chinese +/// \brief 枚举设备 +/// \param pDeviceList [OUT] 设备列表 +/// \param interfaceType [IN] 待枚举的接口类型, 类型可任意组合,如 interfaceTypeGige | interfaceTypeUsb3 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 1、当interfaceType = interfaceTypeAll 时,枚举所有接口下的在线设备\n +/// 2、当interfaceType = interfaceTypeGige 时,枚举所有GigE网口下的在线设备\n +/// 3、当interfaceType = interfaceTypeUsb3 时,枚举所有USB接口下的在线设备\n +/// 4、当interfaceType = interfaceTypeCL 时,枚举所有CameraLink接口下的在线设备\n +/// 5、该接口下的interfaceType支持任意接口类型的组合,如,若枚举所有GigE网口和USB3接口下的在线设备时, +/// 可将interfaceType设置为 interfaceType = interfaceTypeGige | interfaceTypeUsb3,其它接口类型组合以此类推 +/// \~english +/// \brief Enumerate Device +/// \param pDeviceList [OUT] Device list +/// \param interfaceType [IN] The interface type you want to find, support any interface type combination, sucn as interfaceTypeGige | interfaceTypeUsb3 +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// 1、when interfaceType = interfaceTypeAll, enumerate devices in all interface types\n +/// 2、when interfaceType = interfaceTypeGige, enumerate devices in GigE interface \n +/// 3、when interfaceType = interfaceTypeUsb3, enumerate devices in USB interface\n +/// 4、when interfaceType = interfaceTypeCL, enumerate devices in CameraLink interface\n +/// 5、interfaceType supports any interface type combination. For example, if you want to find all GigE and USB3 devices, +/// you can set interfaceType as interfaceType = interfaceTypeGige | interfaceTypeUsb3. +IMV_API int IMV_CALL IMV_EnumDevices(OUT IMV_DeviceList *pDeviceList, IN unsigned int interfaceType); + +/// \~chinese +/// \brief 以单播形式枚举设备, 仅限Gige设备使用 +/// \param pDeviceList [OUT] 设备列表 +/// \param pIpAddress [IN] 设备的IP地址 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Enumerate device by unicast mode. Only for Gige device. +/// \param pDeviceList [OUT] Device list +/// \param pIpAddress [IN] IP address of the device +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_EnumDevicesByUnicast(OUT IMV_DeviceList *pDeviceList, IN const char* pIpAddress); + +/// \~chinese +/// \brief 通过指定标示符创建设备句柄,如指定索引、设备键、设备自定义名、IP地址 +/// \param handle [OUT] 设备句柄 +/// \param mode [IN] 创建设备方式 +/// \param pIdentifier [IN] 指定标示符(设备键、设备自定义名、IP地址为char类型指针强转void类型指针,索引为unsigned int类型指针强转void类型指针) +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Create device handle by specifying identifiers, such as specifying index, device key, device userID, and IP address +/// \param handle [OUT] Device handle +/// \param mode [IN] Create handle mode +/// \param pIdentifier [IN] Specifying identifiers(device key, device userID, and IP address is char* forced to void*, index is unsigned int* forced to void*) +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_CreateHandle(OUT IMV_HANDLE* handle, IN IMV_ECreateHandleMode mode, IN void* pIdentifier); + +/// \~chinese +/// \brief 销毁设备句柄 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Destroy device handle +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_DestroyHandle(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 获取设备信息 +/// \param handle [IN] 设备句柄 +/// \param pDevInfo [OUT] 设备信息 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get device information +/// \param handle [IN] Device handle +/// \param pDevInfo [OUT] Device information +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetDeviceInfo(IN IMV_HANDLE handle, OUT IMV_DeviceInfo *pDevInfo); + +/// \~chinese +/// \brief 打开设备 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Open Device +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_Open(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 打开设备 +/// \param handle [IN] 设备句柄 +/// \param accessPermission [IN] 控制通道权限(IMV_Open默认使用accessPermissionControl权限) +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Open Device +/// \param handle [IN] Device handle +/// \param accessPermission [IN] Control access permission(Default used accessPermissionControl in IMV_Open) +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_OpenEx(IN IMV_HANDLE handle, IN IMV_ECameraAccessPermission accessPermission); + +/// \~chinese +/// \brief 判断设备是否已打开 +/// \param handle [IN] 设备句柄 +/// \return 打开状态,返回true;关闭状态或者掉线状态,返回false +/// \~english +/// \brief Check whether device is opened or not +/// \param handle [IN] Device handle +/// \return Opened, return true. Closed or Offline, return false +IMV_API bool IMV_CALL IMV_IsOpen(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 关闭设备 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Close Device +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_Close(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 修改设备IP, 仅限Gige设备使用 +/// \param handle [IN] 设备句柄 +/// \param pIpAddress [IN] IP地址 +/// \param pSubnetMask [IN] 子网掩码 +/// \param pGateway [IN] 默认网关 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 1、调用该函数时如果pSubnetMask和pGateway都设置了有效值,则以此有效值为准;\n +/// 2、调用该函数时如果pSubnetMask和pGateway都设置了NULL,则内部实现时用它所连接网卡的子网掩码和网关代替\n +/// 3、调用该函数时如果pSubnetMask和pGateway两者中其中一个为NULL,另一个非NULL,则返回错误 +/// \~english +/// \brief Modify device IP. Only for Gige device. +/// \param handle [IN] Device handle +/// \param pIpAddress [IN] IP address +/// \param pSubnetMask [IN] SubnetMask +/// \param pGateway [IN] Gateway +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// 1、When callback this function, if the values of pSubnetMask and pGateway are both valid then we consider the value is correct\n +/// 2、When callback this function, if the values of pSubnetMask and pGateway are both NULL, +/// then these values will be replaced by the subnetmask and gateway of NIC which this device connect to.\n +/// 3、When callback this function, if there is one value of pSubnetMask or pGateway is NULL and the other one is not NULL, then return error +IMV_API int IMV_CALL IMV_GIGE_ForceIpAddress(IN IMV_HANDLE handle, IN const char* pIpAddress, IN const char* pSubnetMask, IN const char* pGateway); + +/// \~chinese +/// \brief 获取设备的当前访问权限, 仅限Gige设备使用 +/// \param handle [IN] 设备句柄 +/// \param pAccessPermission [OUT] 设备的当前访问权限 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get current access permission of device. Only for Gige device. +/// \param handle [IN] Device handle +/// \param pAccessPermission [OUT] Current access permission of device +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GIGE_GetAccessPermission(IN IMV_HANDLE handle, OUT IMV_ECameraAccessPermission* pAccessPermission); + +/// \~chinese +/// \brief 设置设备对sdk命令的响应超时时间,仅限Gige设备使用 +/// \param handle [IN] 设备句柄 +/// \param timeout [IN] 超时时间,单位ms +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set the response timeout interval of device sends command to the API. Only for Gige device. +/// \param handle [IN] Device handle +/// \param timeout [IN] time out, unit:ms +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GIGE_SetAnswerTimeout(IN IMV_HANDLE handle, IN unsigned int timeout); + +/// \~chinese +/// \brief 下载设备描述XML文件,并保存到指定路径,如:D:\\xml.zip +/// \param handle [IN] 设备句柄 +/// \param pFullFileName [IN] 文件要保存的路径 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Download device description XML file, and save the files to specified path. e.g. D:\\xml.zip +/// \param handle [IN] Device handle +/// \param pFullFileName [IN] The full paths where the downloaded XMl files would be saved to +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_DownLoadGenICamXML(IN IMV_HANDLE handle, IN const char* pFullFileName); + +/// \~chinese +/// \brief 保存设备配置到指定的位置。同名文件已存在时,覆盖。 +/// \param handle [IN] 设备句柄 +/// \param pFullFileName [IN] 导出的设备配置文件全名(含路径),如:D:\\config.xml 或 D:\\config.mvcfg +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Save the configuration of the device. Overwrite the file if exists. +/// \param handle [IN] Device handle +/// \param pFullFileName [IN] The full path name of the property file(xml). e.g. D:\\config.xml or D:\\config.mvcfg +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SaveDeviceCfg(IN IMV_HANDLE handle, IN const char* pFullFileName); + +/// \~chinese +/// \brief 从文件加载设备xml配置 +/// \param handle [IN] 设备句柄 +/// \param pFullFileName [IN] 设备配置(xml)文件全名(含路径),如:D:\\config.xml 或 D:\\config.mvcfg +/// \param pErrorList [OUT] 加载失败的属性名列表。存放加载失败的属性上限为IMV_MAX_ERROR_LIST_NUM。 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief load the configuration of the device +/// \param handle [IN] Device handle +/// \param pFullFileName [IN] The full path name of the property file(xml). e.g. D:\\config.xml or D:\\config.mvcfg +/// \param pErrorList [OUT] The list of load failed properties. The failed to load properties list up to IMV_MAX_ERROR_LIST_NUM. +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_LoadDeviceCfg(IN IMV_HANDLE handle, IN const char* pFullFileName, OUT IMV_ErrorList* pErrorList); + +/// \~chinese +/// \brief 写用户自定义数据。相机内部保留32768字节用于用户存储自定义数据(此功能针对本品牌相机,其它品牌相机无此功能) +/// \param handle [IN] 设备句柄 +/// \param pBuffer [IN] 数据缓冲的指针 +/// \param pLength [IN] 期望写入的字节数 [OUT] 实际写入的字节数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Write user-defined data; Inside the camera, there are 32768 bytes reserved for user to store private data (Only for our own camera has this function) +/// \param handle [IN] Device handle +/// \param pBuffer [IN] Pointer of the data buffer +/// \param pLength [IN] Byte count written expected [OUT] Byte count written in fact +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_WriteUserPrivateData(IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength); + +/// \~chinese +/// \brief 读用户自定义数据。相机内部保留32768字节用于用户存储自定义数据(此功能针对本品牌相机,其它品牌相机无此功能) +/// \param handle [IN] 设备句柄 +/// \param pBuffer [OUT] 数据缓冲的指针 +/// \param pLength [IN] 期望读出的字节数 [OUT] 实际读出的字节数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Read user-defined data; Inside the camera, there are 32768 bytes reserved for user to store private data (Only for our own camera has this function) +/// \param handle [IN] Device handle +/// \param pBuffer [OUT] Pointer of the data buffer +/// \param pLength [IN] Byte count read expected [OUT] Byte count read in fact +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ReadUserPrivateData(IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength); + +/// \~chinese +/// \brief 往相机串口寄存器写数据,每次写会清除掉上次的数据(此功能只支持包含串口功能的本品牌相机) +/// \param handle [IN] 设备句柄 +/// \param pBuffer [IN] 数据缓冲的指针 +/// \param pLength [IN] 期望写入的字节数 [OUT] 实际写入的字节数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Write serial data to camera serial register, will erase the data writen before (Only for our own camera with serial port has this function) +/// \param handle [IN] Device handle +/// \param pBuffer [IN] Pointer of the data buffer +/// \param pLength [IN] Byte count written expected [OUT] Byte count written in fact +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_WriteUARTData(IN IMV_HANDLE handle, IN void* pBuffer, IN_OUT unsigned int* pLength); + +/// \~chinese +/// \brief 从相机串口寄存器读取串口数据(此功能只支持包含串口功能的本品牌相机 ) +/// \param handle [IN] 设备句柄 +/// \param pBuffer [OUT] 数据缓冲的指针 +/// \param pLength [IN] 期望读出的字节数 [OUT] 实际读出的字节数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Read serial data from camera serial register (Only for our own camera with serial port has this function) +/// \param handle [IN] Device handle +/// \param pBuffer [OUT] Pointer of the data buffer +/// \param pLength [IN] Byte count read expected [OUT] Byte count read in fact +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ReadUARTData(IN IMV_HANDLE handle, OUT void* pBuffer, IN_OUT unsigned int* pLength); + +/// \~chinese +/// \brief 设备连接状态事件回调注册 +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 设备连接状态事件回调函数 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register call back function of device connection status event. +/// \param handle [IN] Device handle +/// \param proc [IN] Call back function of device connection status event +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_SubscribeConnectArg(IN IMV_HANDLE handle, IN IMV_ConnectCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 参数更新事件回调注册 +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 参数更新注册的事件回调函数 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register call back function of parameter update event. +/// \param handle [IN] Device handle +/// \param proc [IN] Call back function of parameter update event +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_SubscribeParamUpdateArg(IN IMV_HANDLE handle, IN IMV_ParamUpdateCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 流通道事件回调注册 +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 流通道事件回调注册函数 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register call back function of stream channel event. +/// \param handle [IN] Device handle +/// \param proc [IN] Call back function of stream channel event +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_SubscribeStreamArg(IN IMV_HANDLE handle, IN IMV_StreamCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 消息通道事件回调注册 +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 消息通道事件回调注册函数 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持一个回调函数,且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register call back function of message channel event. +/// \param handle [IN] Device handle +/// \param proc [IN] Call back function of message channel event +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_SubscribeMsgChannelArg(IN IMV_HANDLE handle, IN IMV_MsgChannelCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 设置帧数据缓存个数 +/// \param handle [IN] 设备句柄 +/// \param nSize [IN] 缓存数量 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 不能在拉流过程中设置 +/// \~english +/// \brief Set frame buffer count +/// \param handle [IN] Device handle +/// \param nSize [IN] The buffer count +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// It can not be set during frame grabbing +IMV_API int IMV_CALL IMV_SetBufferCount(IN IMV_HANDLE handle, IN unsigned int nSize); + +/// \~chinese +/// \brief 清除帧数据缓存 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Clear frame buffer +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ClearFrameBuffer(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 设置驱动包间隔时间(MS),仅对Gige设备有效 +/// \param handle [IN] 设备句柄 +/// \param nTimeout [IN] 包间隔时间,单位是毫秒 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 触发模式尾包丢失重传机制 +/// \~english +/// \brief Set packet timeout(MS), only for Gige device +/// \param handle [IN] Device handle +/// \param nTimeout [IN] Time out value, unit is MS +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// The resend mechanism of tail packet loss on trigger mode +IMV_API int IMV_CALL IMV_GIGE_SetInterPacketTimeout(IN IMV_HANDLE handle, IN unsigned int nTimeout); + +/// \~chinese +/// \brief 设置单次重传最大包个数, 仅对GigE设备有效 +/// \param handle [IN] 设备句柄 +/// \param maxPacketNum [IN] 单次重传最大包个数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// maxPacketNum为0时,该功能无效 +/// \~english +/// \brief Set the single resend maximum packet number, only for Gige device +/// \param handle [IN] Device handle +/// \param maxPacketNum [IN] The value of single resend maximum packet number +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Disable the function when maxPacketNum is 0 +IMV_API int IMV_CALL IMV_GIGE_SetSingleResendMaxPacketNum(IN IMV_HANDLE handle, IN unsigned int maxPacketNum); + +/// \~chinese +/// \brief 设置同一帧最大丢包的数量,仅对GigE设备有效 +/// \param handle [IN] 设备句柄 +/// \param maxLostPacketNum [IN] 最大丢包的数量 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// maxLostPacketNum为0时,该功能无效 +/// \~english +/// \brief Set the maximum lost packet number, only for Gige device +/// \param handle [IN] Device handle +/// \param maxLostPacketNum [IN] The value of maximum lost packet number +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Disable the function when maxLostPacketNum is 0 +IMV_API int IMV_CALL IMV_GIGE_SetMaxLostPacketNum(IN IMV_HANDLE handle, IN unsigned int maxLostPacketNum); + +/// \~chinese +/// \brief 设置U3V设备的传输数据块的数量和大小,仅对USB设备有效 +/// \param handle [IN] 设备句柄 +/// \param nNum [IN] 传输数据块的数量(范围:5-256) +/// \param nSize [IN] 传输数据块的大小(范围:8-512, 单位:KByte) +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 1、该接口暂时只有在Linux平台且使用无驱的情况下设置才有效,其他情况下返回IMV_NOT_SUPPORT错误码\n +/// 2、传输数据块数量,范围5 - 256, 默认为64,高分辨率高帧率时可以适当增加该值;多台相机共同使用时,可以适当减小该值\n +/// 3、传输每个数据块大小,范围8 - 512, 默认为64,单位是KByte +/// \~english +/// \brief Set the number and size of urb transmitted, only for USB device +/// \param handle [IN] Device handle +/// \param nNum [IN] The number of urb transmitted(range:5-256) +/// \param nSize [IN] The size of urb transmitted(range:8-512, unit:KByte) +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// 1、The interface is only supported on the Linux platform without USB driver. In other cases, it returns IMV_NOT_SUPPORT error code.\n +/// 2、The number of urb transmitted, the range is 5 - 256, and the default is 64. when high pixel and high frame rate can be appropriately increased.; +/// when multiple cameras are used together, the value can be appropriately reduced.\n +/// 3、The size of each urb transmitted, the range is 8 - 512, the default is 64, the unit is KByte. +IMV_API int IMV_CALL IMV_USB_SetUrbTransfer(IN IMV_HANDLE handle, IN unsigned int nNum, IN unsigned int nSize); + +/// \~chinese +/// \brief 开始取流 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Start grabbing +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_StartGrabbing(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 开始取流 +/// \param handle [IN] 设备句柄 +/// \param maxImagesGrabbed [IN] 允许最多的取帧数,达到指定取帧数后停止取流,如果为0,表示忽略此参数连续取流(IMV_StartGrabbing默认0) +/// \param strategy [IN] 取流策略,(IMV_StartGrabbing默认使用grabStrartegySequential策略取流) +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Start grabbing +/// \param handle [IN] Device handle +/// \param maxImagesGrabbed [IN] Maximum images allowed to grab, once it reaches the limit then stop grabbing; +/// If it is 0, then ignore this parameter and start grabbing continuously(default 0 in IMV_StartGrabbing) +/// \param strategy [IN] Image grabbing strategy; (Default grabStrartegySequential in IMV_StartGrabbing) +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_StartGrabbingEx(IN IMV_HANDLE handle, IN uint64_t maxImagesGrabbed, IN IMV_EGrabStrategy strategy); + +/// \~chinese +/// \brief 判断设备是否正在取流 +/// \param handle [IN] 设备句柄 +/// \return 正在取流,返回true;不在取流,返回false +/// \~english +/// \brief Check whether device is grabbing or not +/// \param handle [IN] Device handle +/// \return Grabbing, return true. Not grabbing, return false +IMV_API bool IMV_CALL IMV_IsGrabbing(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 停止取流 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Stop grabbing +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_StopGrabbing(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 注册帧数据回调函数(异步获取帧数据机制) +/// \param handle [IN] 设备句柄 +/// \param proc [IN] 帧数据信息回调函数,建议不要在该函数中处理耗时的操作,否则会阻塞后续帧数据的实时性 +/// \param pUser [IN] 用户自定义数据, 可设为NULL +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 该异步获取帧数据机制和同步获取帧数据机制(IMV_GetFrame)互斥,对于同一设备,系统中两者只能选其一\n +/// 只支持一个回调函数, 且设备关闭后,注册会失效,打开设备后需重新注册 +/// \~english +/// \brief Register frame data callback function( asynchronous getting frame data mechanism); +/// \param handle [IN] Device handle +/// \param proc [IN] Frame data information callback function; It is advised to not put time-cosuming operation in this function, +/// otherwise it will block follow-up data frames and affect real time performance +/// \param pUser [IN] User defined data,It can be set to NULL +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// This asynchronous getting frame data mechanism and synchronous getting frame data mechanism(IMV_GetFrame) are mutually exclusive,\n +/// only one method can be choosed between these two in system for the same device.\n +/// Only one call back function is supported.\n +/// Registration becomes invalid after the device is closed, , and need to re-register after the device is opened +IMV_API int IMV_CALL IMV_AttachGrabbing(IN IMV_HANDLE handle, IN IMV_FrameCallBack proc, IN void* pUser); + +/// \~chinese +/// \brief 获取一帧图像(同步获取帧数据机制) +/// \param handle [IN] 设备句柄 +/// \param pFrame [OUT] 帧数据信息 +/// \param timeoutMS [IN] 获取一帧图像的超时时间,INFINITE时表示无限等待,直到收到一帧数据或者停止取流。单位是毫秒 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 该接口不支持多线程调用。\n +/// 该同步获取帧机制和异步获取帧机制(IMV_AttachGrabbing)互斥,对于同一设备,系统中两者只能选其一。\n +/// 使用内部缓存获取图像,需要IMV_ReleaseFrame进行释放图像缓存。 +/// \~english +/// \brief Get a frame image(synchronous getting frame data mechanism) +/// \param handle [IN] Device handle +/// \param pFrame [OUT] Frame data information +/// \param timeoutMS [IN] The time out of getting one image, INFINITE means infinite wait until the one frame data is returned or stop grabbing.unit is MS +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// This interface does not support multi-threading.\n +/// This synchronous getting frame data mechanism and asynchronous getting frame data mechanism(IMV_AttachGrabbing) are mutually exclusive,\n +/// only one method can be chose between these two in system for the same device.\n +/// Use internal cache to get image, need to release image buffer by IMV_ReleaseFrame +IMV_API int IMV_CALL IMV_GetFrame(IN IMV_HANDLE handle, OUT IMV_Frame* pFrame, IN unsigned int timeoutMS); + +/// \~chinese +/// \brief 释放图像缓存 +/// \param handle [IN] 设备句柄 +/// \param pFrame [IN] 帧数据信息 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Free image buffer +/// \param handle [IN] Device handle +/// \param pFrame [IN] Frame image data information +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ReleaseFrame(IN IMV_HANDLE handle, IN IMV_Frame* pFrame); + +/// \~chinese +/// \brief 帧数据深拷贝克隆 +/// \param handle [IN] 设备句柄 +/// \param pFrame [IN] 克隆源帧数据信息 +/// \param pCloneFrame [OUT] 新的帧数据信息 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 使用IMV_ReleaseFrame进行释放图像缓存。 +/// \~english +/// \brief Frame data deep clone +/// \param handle [IN] Device handle +/// \param pFrame [IN] Frame data information of clone source +/// \param pCloneFrame [OUT] New frame data information +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Use IMV_ReleaseFrame to free image buffer + +IMV_API int IMV_CALL IMV_CloneFrame(IN IMV_HANDLE handle, IN IMV_Frame* pFrame, OUT IMV_Frame* pCloneFrame); + +/// \~chinese +/// \brief 获取Chunk数据(仅对GigE/Usb相机有效) +/// \param handle [IN] 设备句柄 +/// \param pFrame [IN] 帧数据信息 +/// \param index [IN] 索引ID +/// \param pChunkDataInfo [OUT] Chunk数据信息 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get chunk data(Only GigE/Usb Camera) +/// \param handle [IN] Device handle +/// \param pFrame [IN] Frame data information +/// \param index [IN] index ID +/// \param pChunkDataInfo [OUT] Chunk data infomation +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetChunkDataByIndex(IN IMV_HANDLE handle, IN IMV_Frame* pFrame, IN unsigned int index, OUT IMV_ChunkDataInfo *pChunkDataInfo); + +/// \~chinese +/// \brief 获取流统计信息(IMV_StartGrabbing / IMV_StartGrabbing执行后调用) +/// \param handle [IN] 设备句柄 +/// \param pStreamStatsInfo [OUT] 流统计信息数据 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get stream statistics infomation(Used after excuting IMV_StartGrabbing / IMV_StartGrabbing) +/// \param handle [IN] Device handle +/// \param pStreamStatsInfo [OUT] Stream statistics infomation +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetStatisticsInfo(IN IMV_HANDLE handle, OUT IMV_StreamStatisticsInfo* pStreamStatsInfo); + +/// \~chinese +/// \brief 重置流统计信息(IMV_StartGrabbing / IMV_StartGrabbing执行后调用) +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Reset stream statistics infomation(Used after excuting IMV_StartGrabbing / IMV_StartGrabbing) +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ResetStatisticsInfo(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 判断属性是否可用 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 可用,返回true;不可用,返回false +/// \~english +/// \brief Check the property is available or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Available, return true. Not available, return false +IMV_API bool IMV_CALL IMV_FeatureIsAvailable(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 判断属性是否可读 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 可读,返回true;不可读,返回false +/// \~english +/// \brief Check the property is readable or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Readable, return true. Not readable, return false +IMV_API bool IMV_CALL IMV_FeatureIsReadable(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 判断属性是否可写 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 可写,返回true;不可写,返回false +/// \~english +/// \brief Check the property is writeable or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Writeable, return true. Not writeable, return false +IMV_API bool IMV_CALL IMV_FeatureIsWriteable(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 判断属性是否可流 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 可流,返回true;不可流,返回false +/// \~english +/// \brief Check the property is streamable or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Streamable, return true. Not streamable, return false +IMV_API bool IMV_CALL IMV_FeatureIsStreamable(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 判断属性是否有效 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 有效,返回true;无效,返回false +/// \~english +/// \brief Check the property is valid or not +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Valid, return true. Invalid, return false +IMV_API bool IMV_CALL IMV_FeatureIsValid(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 获取整型属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pIntValue [OUT] 整型属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get integer property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pIntValue [OUT] Integer property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetIntFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); + +/// \~chinese +/// \brief 获取整型属性可设的最小值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pIntValue [OUT] 整型属性可设的最小值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the integer property settable minimum value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pIntValue [OUT] Integer property settable minimum value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetIntFeatureMin(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); + +/// \~chinese +/// \brief 获取整型属性可设的最大值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pIntValue [OUT] 整型属性可设的最大值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the integer property settable maximum value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pIntValue [OUT] Integer property settable maximum value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetIntFeatureMax(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); + +/// \~chinese +/// \brief 获取整型属性步长 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pIntValue [OUT] 整型属性步长 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get integer property increment +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pIntValue [OUT] Integer property increment +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetIntFeatureInc(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT int64_t* pIntValue); + +/// \~chinese +/// \brief 设置整型属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param intValue [IN] 待设置的整型属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set integer property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param intValue [IN] Integer property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetIntFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN int64_t intValue); + +/// \~chinese +/// \brief 获取浮点属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pDoubleValue [OUT] 浮点属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get double property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pDoubleValue [OUT] Double property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetDoubleFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); + +/// \~chinese +/// \brief 获取浮点属性可设的最小值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pDoubleValue [OUT] 浮点属性可设的最小值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the double property settable minimum value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pDoubleValue [OUT] Double property settable minimum value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetDoubleFeatureMin(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); + +/// \~chinese +/// \brief 获取浮点属性可设的最大值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pDoubleValue [OUT] 浮点属性可设的最大值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the double property settable maximum value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pDoubleValue [OUT] Double property settable maximum value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetDoubleFeatureMax(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT double* pDoubleValue); + +/// \~chinese +/// \brief 设置浮点属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param doubleValue [IN] 待设置的浮点属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set double property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param doubleValue [IN] Double property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetDoubleFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN double doubleValue); + +/// \~chinese +/// \brief 获取布尔属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pBoolValue [OUT] 布尔属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get boolean property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pBoolValue [OUT] Boolean property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetBoolFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT bool* pBoolValue); + +/// \~chinese +/// \brief 设置布尔属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param boolValue [IN] 待设置的布尔属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set boolean property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param boolValue [IN] Boolean property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetBoolFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN bool boolValue); + +/// \~chinese +/// \brief 获取枚举属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEnumValue [OUT] 枚举属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get enumeration property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEnumValue [OUT] Enumeration property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetEnumFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT uint64_t* pEnumValue); + +/// \~chinese +/// \brief 设置枚举属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param enumValue [IN] 待设置的枚举属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set enumeration property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param enumValue [IN] Enumeration property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetEnumFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN uint64_t enumValue); + +/// \~chinese +/// \brief 获取枚举属性symbol值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEnumSymbol [OUT] 枚举属性symbol值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get enumeration property symbol value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEnumSymbol [OUT] Enumeration property symbol value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetEnumFeatureSymbol(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pEnumSymbol); + +/// \~chinese +/// \brief 设置枚举属性symbol值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEnumSymbol [IN] 待设置的枚举属性symbol值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set enumeration property symbol value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEnumSymbol [IN] Enumeration property symbol value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetEnumFeatureSymbol(IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pEnumSymbol); + +/// \~chinese +/// \brief 获取枚举属性的可设枚举值的个数 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEntryNum [OUT] 枚举属性的可设枚举值的个数 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get the number of enumeration property settable enumeration +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEntryNum [OUT] The number of enumeration property settable enumeration value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetEnumFeatureEntryNum(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT unsigned int* pEntryNum); + +/// \~chinese +/// \brief 获取枚举属性的可设枚举值列表 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pEnumEntryList [OUT] 枚举属性的可设枚举值列表 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get settable enumeration value list of enumeration property +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pEnumEntryList [OUT] Settable enumeration value list of enumeration property +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetEnumFeatureEntrys(IN IMV_HANDLE handle, IN const char* pFeatureName, IN_OUT IMV_EnumEntryList* pEnumEntryList); + +/// \~chinese +/// \brief 获取字符串属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pStringValue [OUT] 字符串属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Get string property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pStringValue [OUT] String property value +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_GetStringFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, OUT IMV_String* pStringValue); + +/// \~chinese +/// \brief 设置字符串属性值 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \param pStringValue [IN] 待设置的字符串属性值 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Set string property value +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \param pStringValue [IN] String property value to be set +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_SetStringFeatureValue(IN IMV_HANDLE handle, IN const char* pFeatureName, IN const char* pStringValue); + +/// \~chinese +/// \brief 执行命令属性 +/// \param handle [IN] 设备句柄 +/// \param pFeatureName [IN] 属性名 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Execute command property +/// \param handle [IN] Device handle +/// \param pFeatureName [IN] Feature name +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_ExecuteCommandFeature(IN IMV_HANDLE handle, IN const char* pFeatureName); + +/// \~chinese +/// \brief 像素格式转换 +/// \param handle [IN] 设备句柄 +/// \param pstPixelConvertParam [IN][OUT] 像素格式转换参数结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持转化成目标像素格式gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 / gvspPixelBGRA8\n +/// 通过该接口将原始图像数据转换成用户所需的像素格式并存放在调用者指定内存中。\n +/// 像素格式为YUV411Packed的时,图像宽须能被4整除\n +/// 像素格式为YUV422Packed的时,图像宽须能被2整除\n +/// 像素格式为YUYVPacked的时,图像宽须能被2整除\n +/// 转换后的图像:数据存储是从最上面第一行开始的,这个是相机数据的默认存储方向 +/// \~english +/// \brief Pixel format conversion +/// \param handle [IN] Device handle +/// \param pstPixelConvertParam [IN][OUT] Convert Pixel Type parameter structure +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only support converting to destination pixel format of gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 / gvspPixelBGRA8\n +/// This API is used to transform the collected original data to pixel format and save to specified memory by caller.\n +/// pixelFormat:YUV411Packed, the image width is divisible by 4\n +/// pixelFormat : YUV422Packed, the image width is divisible by 2\n +/// pixelFormat : YUYVPacked,the image width is divisible by 2\n +/// converted image:The first row of the image is located at the start of the image buffer.This is the default for image taken by a camera. +IMV_API int IMV_CALL IMV_PixelConvert(IN IMV_HANDLE handle, IN_OUT IMV_PixelConvertParam* pstPixelConvertParam); + +/// \~chinese +/// \brief 打开录像 +/// \param handle [IN] 设备句柄 +/// \param pstRecordParam [IN] 录像参数结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Open record +/// \param handle [IN] Device handle +/// \param pstRecordParam [IN] Record param structure +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_OpenRecord(IN IMV_HANDLE handle, IN IMV_RecordParam *pstRecordParam); + +/// \~chinese +/// \brief 录制一帧图像 +/// \param handle [IN] 设备句柄 +/// \param pstRecordFrameInfoParam [IN] 录像用帧信息结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Record one frame +/// \param handle [IN] Device handle +/// \param pstRecordFrameInfoParam [IN] Frame information for recording structure +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_InputOneFrame(IN IMV_HANDLE handle, IN IMV_RecordFrameInfoParam *pstRecordFrameInfoParam); + +/// \~chinese +/// \brief 关闭录像 +/// \param handle [IN] 设备句柄 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \~english +/// \brief Close record +/// \param handle [IN] Device handle +/// \return Success, return IMV_OK. Failure, return error code +IMV_API int IMV_CALL IMV_CloseRecord(IN IMV_HANDLE handle); + +/// \~chinese +/// \brief 图像翻转 +/// \param handle [IN] 设备句柄 +/// \param pstFlipImageParam [IN][OUT] 图像翻转参数结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持像素格式gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8的图像的垂直和水平翻转。\n +/// 通过该接口将原始图像数据翻转后并存放在调用者指定内存中。 +/// \~english +/// \brief Flip image +/// \param handle [IN] Device handle +/// \param pstFlipImageParam [IN][OUT] Flip image parameter structure +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only support vertical and horizontal flip of image data with gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 pixel format.\n +/// This API is used to flip original data and save to specified memory by caller. +IMV_API int IMV_CALL IMV_FlipImage(IN IMV_HANDLE handle, IN_OUT IMV_FlipImageParam* pstFlipImageParam); + +/// \~chinese +/// \brief 图像顺时针旋转 +/// \param handle [IN] 设备句柄 +/// \param pstRotateImageParam [IN][OUT] 图像旋转参数结构体 +/// \return 成功,返回IMV_OK;错误,返回错误码 +/// \remarks +/// 只支持gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8格式数据的90/180/270度顺时针旋转。\n +/// 通过该接口将原始图像数据旋转后并存放在调用者指定内存中。 +/// \~english +/// \brief Rotate image clockwise +/// \param handle [IN] Device handle +/// \param pstRotateImageParam [IN][OUT] Rotate image parameter structure +/// \return Success, return IMV_OK. Failure, return error code +/// \remarks +/// Only support 90/180/270 clockwise rotation of data in the gvspPixelRGB8 / gvspPixelBGR8 / gvspPixelMono8 format.\n +/// This API is used to rotation original data and save to specified memory by caller. +IMV_API int IMV_CALL IMV_RotateImage(IN IMV_HANDLE handle, IN_OUT IMV_RotateImageParam* pstRotateImageParam); + +#ifdef __cplusplus +} +#endif + +#endif // __IMV_API_H__ \ No newline at end of file diff --git a/include/IMVDefines.h b/include/IMVDefines.h new file mode 100644 index 0000000..8cb5082 --- /dev/null +++ b/include/IMVDefines.h @@ -0,0 +1,811 @@ +#ifndef __IMV_DEFINES_H__ +#define __IMV_DEFINES_H__ + +#ifdef WIN32 +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif + +#ifndef IN +#define IN ///< \~chinese 输入型参数 \~english Input param +#endif + +#ifndef OUT +#define OUT ///< \~chinese 输出型参数 \~english Output param +#endif + +#ifndef IN_OUT +#define IN_OUT ///< \~chinese 输入/输出型参数 \~english Input/Output param +#endif + +#ifndef __cplusplus +typedef char bool; +#define true 1 +#define false 0 +#endif + +/// \~chinese +/// \brief 错误码 +/// \~english +/// \brief Error code +#define IMV_OK 0 ///< \~chinese 成功,无错误 \~english Successed, no error +#define IMV_ERROR -101 ///< \~chinese 通用的错误 \~english Generic error +#define IMV_INVALID_HANDLE -102 ///< \~chinese 错误或无效的句柄 \~english Error or invalid handle +#define IMV_INVALID_PARAM -103 ///< \~chinese 错误的参数 \~english Incorrect parameter +#define IMV_INVALID_FRAME_HANDLE -104 ///< \~chinese 错误或无效的帧句柄 \~english Error or invalid frame handle +#define IMV_INVALID_FRAME -105 ///< \~chinese 无效的帧 \~english Invalid frame +#define IMV_INVALID_RESOURCE -106 ///< \~chinese 相机/事件/流等资源无效 \~english Camera/Event/Stream and so on resource invalid +#define IMV_INVALID_IP -107 ///< \~chinese 设备与主机的IP网段不匹配 \~english Device's and PC's subnet is mismatch +#define IMV_NO_MEMORY -108 ///< \~chinese 内存不足 \~english Malloc memery failed +#define IMV_INSUFFICIENT_MEMORY -109 ///< \~chinese 传入的内存空间不足 \~english Insufficient memory +#define IMV_ERROR_PROPERTY_TYPE -110 ///< \~chinese 属性类型错误 \~english Property type error +#define IMV_INVALID_ACCESS -111 ///< \~chinese 属性不可访问、或不能读/写、或读/写失败 \~english Property not accessible, or not be read/written, or read/written failed +#define IMV_INVALID_RANGE -112 ///< \~chinese 属性值超出范围、或者不是步长整数倍 \~english The property's value is out of range, or is not integer multiple of the step +#define IMV_NOT_SUPPORT -113 ///< \~chinese 设备不支持的功能 \~english Device not supported function + +#define IMV_MAX_DEVICE_ENUM_NUM 100 ///< \~chinese 支持设备最大个数 \~english The maximum number of supported devices +#define IMV_MAX_STRING_LENTH 256 ///< \~chinese 字符串最大长度 \~english The maximum length of string +#define IMV_MAX_ERROR_LIST_NUM 128 ///< \~chinese 失败属性列表最大长度 \~english The maximum size of failed properties list + +typedef void* IMV_HANDLE; ///< \~chinese 设备句柄 \~english Device handle +typedef void* IMV_FRAME_HANDLE; ///< \~chinese 帧句柄 \~english Frame handle + +/// \~chinese +///枚举:接口类型 +/// \~english +///Enumeration: interface type +typedef enum _IMV_EInterfaceType +{ + interfaceTypeGige = 0x00000001, ///< \~chinese 网卡接口类型 \~english NIC type + interfaceTypeUsb3 = 0x00000002, ///< \~chinese USB3.0接口类型 \~english USB3.0 interface type + interfaceTypeCL = 0x00000004, ///< \~chinese CAMERALINK接口类型 \~english Cameralink interface type + interfaceTypePCIe = 0x00000008, ///< \~chinese PCIe接口类型 \~english PCIe interface type + interfaceTypeAll = 0x00000000, ///< \~chinese 忽略接口类型 \~english All types interface type + interfaceInvalidType = 0xFFFFFFFF ///< \~chinese 无效接口类型 \~english Invalid interface type +}IMV_EInterfaceType; + +/// \~chinese +///枚举:设备类型 +/// \~english +///Enumeration: device type +typedef enum _IMV_ECameraType +{ + typeGigeCamera = 0, ///< \~chinese GIGE相机 \~english GigE Vision Camera + typeU3vCamera = 1, ///< \~chinese USB3.0相机 \~english USB3.0 Vision Camera + typeCLCamera = 2, ///< \~chinese CAMERALINK 相机 \~english Cameralink camera + typePCIeCamera = 3, ///< \~chinese PCIe相机 \~english PCIe Camera + typeUndefinedCamera = 255 ///< \~chinese 未知类型 \~english Undefined Camera +}IMV_ECameraType; + +/// \~chinese +///枚举:创建句柄方式 +/// \~english +///Enumeration: Create handle mode +typedef enum _IMV_ECreateHandleMode +{ + modeByIndex = 0, ///< \~chinese 通过已枚举设备的索引(从0开始,比如 0, 1, 2...) \~english By index of enumerated devices (Start from 0, such as 0, 1, 2...) + modeByCameraKey, ///< \~chinese 通过设备键"厂商:序列号" \~english By device's key "vendor:serial number" + modeByDeviceUserID, ///< \~chinese 通过设备自定义名 \~english By device userID + modeByIPAddress, ///< \~chinese 通过设备IP地址 \~english By device IP address. +}IMV_ECreateHandleMode; + +/// \~chinese +///枚举:访问权限 +/// \~english +///Enumeration: access permission +typedef enum _IMV_ECameraAccessPermission +{ + accessPermissionOpen = 0, ///< \~chinese GigE相机没有被连接 \~english The GigE vision device isn't connected to any application. + accessPermissionExclusive, ///< \~chinese 独占访问权限 \~english Exclusive Access Permission + accessPermissionControl, ///< \~chinese 非独占可读访问权限 \~english Non-Exclusive Readbale Access Permission + accessPermissionControlWithSwitchover, ///< \~chinese 切换控制访问权限 \~english Control access with switchover enabled. + accessPermissionUnknown = 254, ///< \~chinese 无法确定 \~english Value not known; indeterminate. + accessPermissionUndefined ///< \~chinese 未定义访问权限 \~english Undefined Access Permission +}IMV_ECameraAccessPermission; + +/// \~chinese +///枚举:抓图策略 +/// \~english +///Enumeration: grab strartegy +typedef enum _IMV_EGrabStrategy +{ + grabStrartegySequential = 0, ///< \~chinese 按到达顺序处理图片 \~english The images are processed in the order of their arrival + grabStrartegyLatestImage = 1, ///< \~chinese 获取最新的图片 \~english Get latest image + grabStrartegyUpcomingImage = 2, ///< \~chinese 等待获取下一张图片(只针对GigE相机) \~english Waiting for next image(GigE only) + grabStrartegyUndefined ///< \~chinese 未定义 \~english Undefined +}IMV_EGrabStrategy; + +/// \~chinese +///枚举:流事件状态 +/// \~english +/// Enumeration:stream event status +typedef enum _IMV_EEventStatus +{ + streamEventNormal = 1, ///< \~chinese 正常流事件 \~english Normal stream event + streamEventLostFrame = 2, ///< \~chinese 丢帧事件 \~english Lost frame event + streamEventLostPacket = 3, ///< \~chinese 丢包事件 \~english Lost packet event + streamEventImageError = 4, ///< \~chinese 图像错误事件 \~english Error image event + streamEventStreamChannelError = 5, ///< \~chinese 取流错误事件 \~english Stream channel error event + streamEventTooManyConsecutiveResends = 6, ///< \~chinese 太多连续重传 \~english Too many consecutive resends event + streamEventTooManyLostPacket = 7 ///< \~chinese 太多丢包 \~english Too many lost packet event +}IMV_EEventStatus; + +/// \~chinese +///枚举:图像转换Bayer格式所用的算法 +/// \~english +/// Enumeration:alorithm used for Bayer demosaic +typedef enum _IMV_EBayerDemosaic +{ + demosaicNearestNeighbor, ///< \~chinese 最近邻 \~english Nearest neighbor + demosaicBilinear, ///< \~chinese 双线性 \~english Bilinear + demosaicEdgeSensing, ///< \~chinese 边缘检测 \~english Edge sensing + demosaicNotSupport = 255, ///< \~chinese 不支持 \~english Not support +}IMV_EBayerDemosaic; + +/// \~chinese +///枚举:事件类型 +/// \~english +/// Enumeration:event type +typedef enum _IMV_EVType +{ + offLine, ///< \~chinese 设备离线通知 \~english device offline notification + onLine ///< \~chinese 设备在线通知 \~english device online notification +}IMV_EVType; + +/// \~chinese +///枚举:视频格式 +/// \~english +/// Enumeration:Video format +typedef enum _IMV_EVideoType +{ + typeVideoFormatAVI = 0, ///< \~chinese AVI格式 \~english AVI format + typeVideoFormatNotSupport = 255 ///< \~chinese 不支持 \~english Not support +}IMV_EVideoType; + +/// \~chinese +///枚举:图像翻转类型 +/// \~english +/// Enumeration:Image flip type +typedef enum _IMV_EFlipType +{ + typeFlipVertical, ///< \~chinese 垂直(Y轴)翻转 \~english Vertical(Y-axis) flip + typeFlipHorizontal ///< \~chinese 水平(X轴)翻转 \~english Horizontal(X-axis) flip +}IMV_EFlipType; + +/// \~chinese +///枚举:顺时针旋转角度 +/// \~english +/// Enumeration:Rotation angle clockwise +typedef enum _IMV_ERotationAngle +{ + rotationAngle90, ///< \~chinese 顺时针旋转90度 \~english Rotate 90 degree clockwise + rotationAngle180, ///< \~chinese 顺时针旋转180度 \~english Rotate 180 degree clockwise + rotationAngle270, ///< \~chinese 顺时针旋转270度 \~english Rotate 270 degree clockwise +}IMV_ERotationAngle; + +#define IMV_GVSP_PIX_MONO 0x01000000 +#define IMV_GVSP_PIX_RGB 0x02000000 +#define IMV_GVSP_PIX_COLOR 0x02000000 +#define IMV_GVSP_PIX_CUSTOM 0x80000000 +#define IMV_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 IMV_GVSP_PIX_OCCUPY1BIT 0x00010000 +#define IMV_GVSP_PIX_OCCUPY2BIT 0x00020000 +#define IMV_GVSP_PIX_OCCUPY4BIT 0x00040000 +#define IMV_GVSP_PIX_OCCUPY8BIT 0x00080000 +#define IMV_GVSP_PIX_OCCUPY12BIT 0x000C0000 +#define IMV_GVSP_PIX_OCCUPY16BIT 0x00100000 +#define IMV_GVSP_PIX_OCCUPY24BIT 0x00180000 +#define IMV_GVSP_PIX_OCCUPY32BIT 0x00200000 +#define IMV_GVSP_PIX_OCCUPY36BIT 0x00240000 +#define IMV_GVSP_PIX_OCCUPY48BIT 0x00300000 + +/// \~chinese +///枚举:图像格式 +/// \~english +/// Enumeration:image format +typedef enum _IMV_EPixelType +{ + // Undefined pixel type + gvspPixelTypeUndefined = -1, + + // Mono Format + gvspPixelMono1p = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY1BIT | 0x0037), + gvspPixelMono2p = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY2BIT | 0x0038), + gvspPixelMono4p = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY4BIT | 0x0039), + gvspPixelMono8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x0001), + gvspPixelMono8S = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x0002), + gvspPixelMono10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0003), + gvspPixelMono10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0004), + gvspPixelMono12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0005), + gvspPixelMono12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0006), + gvspPixelMono14 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0025), + gvspPixelMono16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0007), + + // Bayer Format + gvspPixelBayGR8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x0008), + gvspPixelBayRG8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x0009), + gvspPixelBayGB8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x000A), + gvspPixelBayBG8 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY8BIT | 0x000B), + gvspPixelBayGR10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x000C), + gvspPixelBayRG10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x000D), + gvspPixelBayGB10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x000E), + gvspPixelBayBG10 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x000F), + gvspPixelBayGR12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0010), + gvspPixelBayRG12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0011), + gvspPixelBayGB12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0012), + gvspPixelBayBG12 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0013), + gvspPixelBayGR10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0026), + gvspPixelBayRG10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0027), + gvspPixelBayGB10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0028), + gvspPixelBayBG10Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x0029), + gvspPixelBayGR12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x002A), + gvspPixelBayRG12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x002B), + gvspPixelBayGB12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x002C), + gvspPixelBayBG12Packed = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY12BIT | 0x002D), + gvspPixelBayGR16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x002E), + gvspPixelBayRG16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x002F), + gvspPixelBayGB16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0030), + gvspPixelBayBG16 = (IMV_GVSP_PIX_MONO | IMV_GVSP_PIX_OCCUPY16BIT | 0x0031), + + // RGB Format + gvspPixelRGB8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0014), + gvspPixelBGR8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0015), + gvspPixelRGBA8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY32BIT | 0x0016), + gvspPixelBGRA8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY32BIT | 0x0017), + gvspPixelRGB10 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0018), + gvspPixelBGR10 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0019), + gvspPixelRGB12 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x001A), + gvspPixelBGR12 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x001B), + gvspPixelRGB16 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0033), + gvspPixelRGB10V1Packed = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY32BIT | 0x001C), + gvspPixelRGB10P32 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY32BIT | 0x001D), + gvspPixelRGB12V1Packed = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY36BIT | 0X0034), + gvspPixelRGB565P = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0035), + gvspPixelBGR565P = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0X0036), + + // YVR Format + gvspPixelYUV411_8_UYYVYY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY12BIT | 0x001E), + gvspPixelYUV422_8_UYVY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x001F), + gvspPixelYUV422_8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0032), + gvspPixelYUV8_UYV = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0020), + gvspPixelYCbCr8CbYCr = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x003A), + gvspPixelYCbCr422_8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x003B), + gvspPixelYCbCr422_8_CbYCrY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0043), + gvspPixelYCbCr411_8_CbYYCrYY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY12BIT | 0x003C), + gvspPixelYCbCr601_8_CbYCr = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x003D), + gvspPixelYCbCr601_422_8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x003E), + gvspPixelYCbCr601_422_8_CbYCrY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0044), + gvspPixelYCbCr601_411_8_CbYYCrYY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY12BIT | 0x003F), + gvspPixelYCbCr709_8_CbYCr = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0040), + gvspPixelYCbCr709_422_8 = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0041), + gvspPixelYCbCr709_422_8_CbYCrY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY16BIT | 0x0045), + gvspPixelYCbCr709_411_8_CbYYCrYY = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY12BIT | 0x0042), + + // RGB Planar + gvspPixelRGB8Planar = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY24BIT | 0x0021), + gvspPixelRGB10Planar = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0022), + gvspPixelRGB12Planar = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0023), + gvspPixelRGB16Planar = (IMV_GVSP_PIX_COLOR | IMV_GVSP_PIX_OCCUPY48BIT | 0x0024), + + //BayerRG10p和BayerRG12p格式,针对特定项目临时添加,请不要使用 + //BayerRG10p and BayerRG12p, currently used for specific project, please do not use them + gvspPixelBayRG10p = 0x010A0058, + gvspPixelBayRG12p = 0x010c0059, + + //mono1c格式,自定义格式 + //mono1c, customized image format, used for binary output + gvspPixelMono1c = 0x012000FF, + + //mono1e格式,自定义格式,用来显示连通域 + //mono1e, customized image format, used for displaying connected domain + gvspPixelMono1e = 0x01080FFF +}IMV_EPixelType; + +/// \~chinese +/// \brief 字符串信息 +/// \~english +/// \brief String information +typedef struct _IMV_String +{ + char str[IMV_MAX_STRING_LENTH]; ///< \~chinese 字符串.长度不超过256 \~english Strings and the maximum length of strings is 255. +}IMV_String; + +/// \~chinese +/// \brief GigE网卡信息 +/// \~english +/// \brief GigE interface information +typedef struct _IMV_GigEInterfaceInfo +{ + char description[IMV_MAX_STRING_LENTH]; ///< \~chinese 网卡描述信息 \~english Network card description + char macAddress[IMV_MAX_STRING_LENTH]; ///< \~chinese 网卡Mac地址 \~english Network card MAC Address + char ipAddress[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备Ip地址 \~english Device ip Address + char subnetMask[IMV_MAX_STRING_LENTH]; ///< \~chinese 子网掩码 \~english SubnetMask + char defaultGateWay[IMV_MAX_STRING_LENTH]; ///< \~chinese 默认网关 \~english Default GateWay + char chReserved[5][IMV_MAX_STRING_LENTH]; ///< 保留 \~english Reserved field +}IMV_GigEInterfaceInfo; + +/// \~chinese +/// \brief USB接口信息 +/// \~english +/// \brief USB interface information +typedef struct _IMV_UsbInterfaceInfo +{ + char description[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口描述信息 \~english USB interface description + char vendorID[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口Vendor ID \~english USB interface Vendor ID + char deviceID[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口设备ID \~english USB interface Device ID + char subsystemID[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口Subsystem ID \~english USB interface Subsystem ID + char revision[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口Revision \~english USB interface Revision + char speed[IMV_MAX_STRING_LENTH]; ///< \~chinese USB接口speed \~english USB interface speed + char chReserved[4][IMV_MAX_STRING_LENTH]; ///< 保留 \~english Reserved field +}IMV_UsbInterfaceInfo; + +/// \~chinese +/// \brief GigE设备信息 +/// \~english +/// \brief GigE device information +typedef struct _IMV_GigEDeviceInfo +{ + /// \~chinese + /// 设备支持的IP配置选项\n + /// value:4 相机只支持LLA\n + /// value:5 相机支持LLA和Persistent IP\n + /// value:6 相机支持LLA和DHCP\n + /// value:7 相机支持LLA、DHCP和Persistent IP\n + /// value:0 获取失败 + /// \~english + /// Supported IP configuration options of device\n + /// value:4 Device supports LLA \n + /// value:5 Device supports LLA and Persistent IP\n + /// value:6 Device supports LLA and DHCP\n + /// value:7 Device supports LLA, DHCP and Persistent IP\n + /// value:0 Get fail + unsigned int nIpConfigOptions; + /// \~chinese + /// 设备当前的IP配置选项\n + /// value:4 LLA处于活动状态\n + /// value:5 LLA和Persistent IP处于活动状态\n + /// value:6 LLA和DHCP处于活动状态\n + /// value:7 LLA、DHCP和Persistent IP处于活动状态\n + /// value:0 获取失败 + /// \~english + /// Current IP Configuration options of device\n + /// value:4 LLA is active\n + /// value:5 LLA and Persistent IP are active\n + /// value:6 LLA and DHCP are active\n + /// value:7 LLA, DHCP and Persistent IP are active\n + /// value:0 Get fail + unsigned int nIpConfigCurrent; + unsigned int nReserved[3]; ///< \~chinese 保留 \~english Reserved field + + char macAddress[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备Mac地址 \~english Device MAC Address + char ipAddress[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备Ip地址 \~english Device ip Address + char subnetMask[IMV_MAX_STRING_LENTH]; ///< \~chinese 子网掩码 \~english SubnetMask + char defaultGateWay[IMV_MAX_STRING_LENTH]; ///< \~chinese 默认网关 \~english Default GateWay + char protocolVersion[IMV_MAX_STRING_LENTH]; ///< \~chinese 网络协议版本 \~english Net protocol version + /// \~chinese + /// Ip配置有效性\n + /// Ip配置有效时字符串值"Valid"\n + /// Ip配置无效时字符串值"Invalid On This Interface" + /// \~english + /// IP configuration valid\n + /// String value is "Valid" when ip configuration valid\n + /// String value is "Invalid On This Interface" when ip configuration invalid + char ipConfiguration[IMV_MAX_STRING_LENTH]; + char chReserved[6][IMV_MAX_STRING_LENTH]; ///< \~chinese 保留 \~english Reserved field + +}IMV_GigEDeviceInfo; + +/// \~chinese +/// \brief Usb设备信息 +/// \~english +/// \brief Usb device information +typedef struct _IMV_UsbDeviceInfo +{ + bool bLowSpeedSupported; ///< \~chinese true支持,false不支持,其他值 非法。 \~english true support,false not supported,other invalid + bool bFullSpeedSupported; ///< \~chinese true支持,false不支持,其他值 非法。 \~english true support,false not supported,other invalid + bool bHighSpeedSupported; ///< \~chinese true支持,false不支持,其他值 非法。 \~english true support,false not supported,other invalid + bool bSuperSpeedSupported; ///< \~chinese true支持,false不支持,其他值 非法。 \~english true support,false not supported,other invalid + bool bDriverInstalled; ///< \~chinese true安装,false未安装,其他值 非法。 \~english true support,false not supported,other invalid + bool boolReserved[3]; ///< \~chinese 保留 + unsigned int Reserved[4]; ///< \~chinese 保留 \~english Reserved field + + char configurationValid[IMV_MAX_STRING_LENTH]; ///< \~chinese 配置有效性 \~english Configuration Valid + char genCPVersion[IMV_MAX_STRING_LENTH]; ///< \~chinese GenCP 版本 \~english GenCP Version + char u3vVersion[IMV_MAX_STRING_LENTH]; ///< \~chinese U3V 版本号 \~english U3v Version + char deviceGUID[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备引导号 \~english Device guid number + char familyName[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备系列号 \~english Device serial number + char u3vSerialNumber[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备序列号 \~english Device SerialNumber + char speed[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备传输速度 \~english Device transmission speed + char maxPower[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备最大供电量 \~english Maximum power supply of device + char chReserved[4][IMV_MAX_STRING_LENTH]; ///< \~chinese 保留 \~english Reserved field + +}IMV_UsbDeviceInfo; + +/// \~chinese +/// \brief 设备通用信息 +/// \~english +/// \brief Device general information +typedef struct _IMV_DeviceInfo +{ + IMV_ECameraType nCameraType; ///< \~chinese 设备类别 \~english Camera type + int nCameraReserved[5]; ///< \~chinese 保留 \~english Reserved field + + char cameraKey[IMV_MAX_STRING_LENTH]; ///< \~chinese 厂商:序列号 \~english Camera key + char cameraName[IMV_MAX_STRING_LENTH]; ///< \~chinese 用户自定义名 \~english UserDefinedName + char serialNumber[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备序列号 \~english Device SerialNumber + char vendorName[IMV_MAX_STRING_LENTH]; ///< \~chinese 厂商 \~english Camera Vendor + char modelName[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备型号 \~english Device model + char manufactureInfo[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备制造信息 \~english Device ManufactureInfo + char deviceVersion[IMV_MAX_STRING_LENTH]; ///< \~chinese 设备版本 \~english Device Version + char cameraReserved[5][IMV_MAX_STRING_LENTH]; ///< \~chinese 保留 \~english Reserved field + union + { + IMV_GigEDeviceInfo gigeDeviceInfo; ///< \~chinese Gige设备信息 \~english Gige Device Information + IMV_UsbDeviceInfo usbDeviceInfo; ///< \~chinese Usb设备信息 \~english Usb Device Information + }DeviceSpecificInfo; + + IMV_EInterfaceType nInterfaceType; ///< \~chinese 接口类别 \~english Interface type + int nInterfaceReserved[5]; ///< \~chinese 保留 \~english Reserved field + char interfaceName[IMV_MAX_STRING_LENTH]; ///< \~chinese 接口名 \~english Interface Name + char interfaceReserved[5][IMV_MAX_STRING_LENTH]; ///< \~chinese 保留 \~english Reserved field + union + { + IMV_GigEInterfaceInfo gigeInterfaceInfo; ///< \~chinese GigE网卡信息 \~english Gige interface Information + IMV_UsbInterfaceInfo usbInterfaceInfo; ///< \~chinese Usb接口信息 \~english Usb interface Information + }InterfaceInfo; +}IMV_DeviceInfo; + +/// \~chinese +/// \brief 加载失败的属性信息 +/// \~english +/// \brief Load failed properties information +typedef struct _IMV_ErrorList +{ + unsigned int nParamCnt; ///< \~chinese 加载失败的属性个数 \~english The count of load failed properties + IMV_String paramNameList[IMV_MAX_ERROR_LIST_NUM]; ///< \~chinese 加载失败的属性集合,上限128 \~english Array of load failed properties, up to 128 +}IMV_ErrorList; + +/// \~chinese +/// \brief 设备信息列表 +/// \~english +/// \brief Device information list +typedef struct _IMV_DeviceList +{ + unsigned int nDevNum; ///< \~chinese 设备数量 \~english Device Number + IMV_DeviceInfo* pDevInfo; ///< \~chinese 设备息列表(SDK内部缓存),最多100设备 \~english Device information list(cached within the SDK), up to 100 +}IMV_DeviceList; + +/// \~chinese +/// \brief 连接事件信息 +/// \~english +/// \brief connection event information +typedef struct _IMV_SConnectArg +{ + IMV_EVType event; ///< \~chinese 事件类型 \~english event type + unsigned int nReserve[10]; ///< \~chinese 预留字段 \~english Reserved field +}IMV_SConnectArg; + +/// \~chinese +/// \brief 参数更新事件信息 +/// \~english +/// \brief Updating parameters event information +typedef struct _IMV_SParamUpdateArg +{ + bool isPoll; ///< \~chinese 是否是定时更新,true:表示是定时更新,false:表示非定时更新 \~english Update periodically or not. true:update periodically, true:not update periodically + unsigned int nReserve[10]; ///< \~chinese 预留字段 \~english Reserved field + unsigned int nParamCnt; ///< \~chinese 更新的参数个数 \~english The number of parameters which need update + IMV_String* pParamNameList; ///< \~chinese 更新的参数名称集合(SDK内部缓存) \~english Array of parameter's name which need to be updated(cached within the SDK) +}IMV_SParamUpdateArg; + +/// \~chinese +/// \brief 流事件信息 +/// \~english +/// \brief Stream event information +typedef struct _IMV_SStreamArg +{ + unsigned int channel; ///< \~chinese 流通道号 \~english Channel no. + uint64_t blockId; ///< \~chinese 流数据BlockID \~english Block ID of stream data + uint64_t timeStamp; ///< \~chinese 时间戳 \~english Event time stamp + IMV_EEventStatus eStreamEventStatus; ///< \~chinese 流事件状态码 \~english Stream event status code + unsigned int status; ///< \~chinese 事件状态错误码 \~english Status error code + unsigned int nReserve[9]; ///< \~chinese 预留字段 \~english Reserved field +}IMV_SStreamArg; + +/// \~chinese +/// 消息通道事件ID列表 +/// \~english +/// message channel event id list +#define IMV_MSG_EVENT_ID_EXPOSURE_END 0x9001 +#define IMV_MSG_EVENT_ID_FRAME_TRIGGER 0x9002 +#define IMV_MSG_EVENT_ID_FRAME_START 0x9003 +#define IMV_MSG_EVENT_ID_ACQ_START 0x9004 +#define IMV_MSG_EVENT_ID_ACQ_TRIGGER 0x9005 +#define IMV_MSG_EVENT_ID_DATA_READ_OUT 0x9006 + +/// \~chinese +/// \brief 消息通道事件信息 +/// \~english +/// \brief Message channel event information +typedef struct _IMV_SMsgChannelArg +{ + unsigned short eventId; ///< \~chinese 事件Id \~english Event id + unsigned short channelId; ///< \~chinese 消息通道号 \~english Channel id + uint64_t blockId; ///< \~chinese 流数据BlockID \~english Block ID of stream data + uint64_t timeStamp; ///< \~chinese 时间戳 \~english Event timestamp + unsigned int nReserve[8]; ///< \~chinese 预留字段 \~english Reserved field + unsigned int nParamCnt; ///< \~chinese 参数个数 \~english The number of parameters which need update + IMV_String* pParamNameList; ///< \~chinese 事件相关的属性名列集合(SDK内部缓存) \~english Array of parameter's name which is related(cached within the SDK) +}IMV_SMsgChannelArg; + +/// \~chinese +/// \brief Chunk数据信息 +/// \~english +/// \brief Chunk data information +typedef struct _IMV_ChunkDataInfo +{ + unsigned int chunkID; ///< \~chinese ChunkID \~english ChunkID + unsigned int nParamCnt; ///< \~chinese 属性名个数 \~english The number of paramNames + IMV_String* pParamNameList; ///< \~chinese Chunk数据对应的属性名集合(SDK内部缓存) \~english ParamNames Corresponding property name of chunk data(cached within the SDK) +}IMV_ChunkDataInfo; + +/// \~chinese +/// \brief 帧图像信息 +/// \~english +/// \brief The frame image information +typedef struct _IMV_FrameInfo +{ + uint64_t blockId; ///< \~chinese 帧Id(仅对GigE/Usb/PCIe相机有效) \~english The block ID(GigE/Usb/PCIe camera only) + unsigned int status; ///< \~chinese 数据帧状态(0是正常状态) \~english The status of frame(0 is normal status) + unsigned int width; ///< \~chinese 图像宽度 \~english The width of image + unsigned int height; ///< \~chinese 图像高度 \~english The height of image + unsigned int size; ///< \~chinese 图像大小 \~english The size of image + IMV_EPixelType pixelFormat; ///< \~chinese 图像像素格式 \~english The pixel format of image + uint64_t timeStamp; ///< \~chinese 图像时间戳(仅对GigE/Usb/PCIe相机有效) \~english The timestamp of image(GigE/Usb/PCIe camera only) + unsigned int chunkCount; ///< \~chinese 帧数据中包含的Chunk个数(仅对GigE/Usb相机有效) \~english The number of chunk in frame data(GigE/Usb Camera Only) + unsigned int paddingX; ///< \~chinese 图像paddingX(仅对GigE/Usb/PCIe相机有效) \~english The paddingX of image(GigE/Usb/PCIe camera only) + unsigned int paddingY; ///< \~chinese 图像paddingY(仅对GigE/Usb/PCIe相机有效) \~english The paddingY of image(GigE/Usb/PCIe camera only) + unsigned int recvFrameTime; ///< \~chinese 图像在网络传输所用的时间(单位:微秒,非GigE相机该值为0) \~english The time taken for the image to be transmitted over the network(unit:us, The value is 0 for non-GigE camera) + unsigned int nReserved[19]; ///< \~chinese 预留字段 \~english Reserved field +}IMV_FrameInfo; + +/// \~chinese +/// \brief 帧图像数据信息 +/// \~english +/// \brief Frame image data information +typedef struct _IMV_Frame +{ + IMV_FRAME_HANDLE frameHandle; ///< \~chinese 帧图像句柄(SDK内部帧管理用) \~english Frame image handle(used for managing frame within the SDK) + unsigned char* pData; ///< \~chinese 帧图像数据的内存首地址 \~english The starting address of memory of image data + IMV_FrameInfo frameInfo; ///< \~chinese 帧信息 \~english Frame information + unsigned int nReserved[10]; ///< \~chinese 预留字段 \~english Reserved field +}IMV_Frame; + +/// \~chinese +/// \brief PCIE设备统计流信息 +/// \~english +/// \brief PCIE device stream statistics information +typedef struct _IMV_PCIEStreamStatsInfo +{ + unsigned int imageError; ///< \~chinese 图像错误的帧数 \~english Number of images error frames + unsigned int lostPacketBlock; ///< \~chinese 丢包的帧数 \~english Number of frames lost + unsigned int nReserved0[10]; ///< \~chinese 预留 \~english Reserved field + + unsigned int imageReceived; ///< \~chinese 正常获取的帧数 \~english Number of frames acquired + double fps; ///< \~chinese 帧率 \~english Frame rate + double bandwidth; ///< \~chinese 带宽(Mbps) \~english Bandwidth(Mbps) + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved field +}IMV_PCIEStreamStatsInfo; + +/// \~chinese +/// \brief U3V设备统计流信息 +/// \~english +/// \brief U3V device stream statistics information +typedef struct _IMV_U3VStreamStatsInfo +{ + unsigned int imageError; ///< \~chinese 图像错误的帧数 \~english Number of images error frames + unsigned int lostPacketBlock; ///< \~chinese 丢包的帧数 \~english Number of frames lost + unsigned int nReserved0[10]; ///< \~chinese 预留 \~english Reserved field + + unsigned int imageReceived; ///< \~chinese 正常获取的帧数 \~english Number of images error frames + double fps; ///< \~chinese 帧率 \~english Frame rate + double bandwidth; ///< \~chinese 带宽(Mbps) \~english Bandwidth(Mbps) + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved field +}IMV_U3VStreamStatsInfo; + +/// \~chinese +/// \brief Gige设备统计流信息 +/// \~english +/// \brief Gige device stream statistics information +typedef struct _IMV_GigEStreamStatsInfo +{ + unsigned int nReserved0[10]; ///< \~chinese 预留 \~english Reserved field + + unsigned int imageError; ///< \~chinese 图像错误的帧数 \~english Number of image error frames + unsigned int lostPacketBlock; ///< \~chinese 丢包的帧数 \~english Number of frames lost + unsigned int nReserved1[4]; ///< \~chinese 预留 \~english Reserved field + unsigned int nReserved2[5]; ///< \~chinese 预留 \~english Reserved field + + unsigned int imageReceived; ///< \~chinese 正常获取的帧数 \~english Number of frames acquired + double fps; ///< \~chinese 帧率 \~english Frame rate + double bandwidth; ///< \~chinese 带宽(Mbps) \~english Bandwidth(Mbps) + unsigned int nReserved[4]; ///< \~chinese 预留 \~english Reserved field +}IMV_GigEStreamStatsInfo; + +/// \~chinese +/// \brief 统计流信息 +/// \~english +/// \brief Stream statistics information +typedef struct _IMV_StreamStatisticsInfo +{ + IMV_ECameraType nCameraType; ///< \~chinese 设备类型 \~english Device type + + union + { + IMV_PCIEStreamStatsInfo pcieStatisticsInfo; ///< \~chinese PCIE设备统计信息 \~english PCIE device statistics information + IMV_U3VStreamStatsInfo u3vStatisticsInfo; ///< \~chinese U3V设备统计信息 \~english U3V device statistics information + IMV_GigEStreamStatsInfo gigeStatisticsInfo; ///< \~chinese Gige设备统计信息 \~english GIGE device statistics information + }; +}IMV_StreamStatisticsInfo; + +/// \~chinese +/// \brief 枚举属性的枚举值信息 +/// \~english +/// \brief Enumeration property 's enumeration value information +typedef struct _IMV_EnumEntryInfo +{ + uint64_t value; ///< \~chinese 枚举值 \~english Enumeration value + char name[IMV_MAX_STRING_LENTH]; ///< \~chinese symbol名 \~english Symbol name +}IMV_EnumEntryInfo; + +/// \~chinese +/// \brief 枚举属性的可设枚举值列表信息 +/// \~english +/// \brief Enumeration property 's settable enumeration value list information +typedef struct _IMV_EnumEntryList +{ + unsigned int nEnumEntryBufferSize; ///< \~chinese 存放枚举值内存大小 \~english The size of saving enumeration value + IMV_EnumEntryInfo* pEnumEntryInfo; ///< \~chinese 存放可设枚举值列表(调用者分配缓存) \~english Save the list of settable enumeration value(allocated cache by the caller) +}IMV_EnumEntryList; + +/// \~chinese +/// \brief 像素转换结构体 +/// \~english +/// \brief Pixel convert structure +typedef struct _IMV_PixelConvertParam +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + IMV_EPixelType ePixelFormat; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned char* pSrcData; ///< [IN] \~chinese 输入图像数据 \~english Input image data + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入图像长度 \~english Input image length + unsigned int nPaddingX; ///< [IN] \~chinese 图像宽填充 \~english Padding X + unsigned int nPaddingY; ///< [IN] \~chinese 图像高填充 \~english Padding Y + IMV_EBayerDemosaic eBayerDemosaic; ///< [IN] \~chinese 转换Bayer格式算法 \~english Alorithm used for Bayer demosaic + IMV_EPixelType eDstPixelFormat; ///< [IN] \~chinese 目标像素格式 \~english Destination pixel format + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存(调用者分配缓存) \~english Output data buffer(allocated cache by the caller) + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstDataLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved field +}IMV_PixelConvertParam; + +/// \~chinese +/// \brief 录像结构体 +/// \~english +/// \brief Record structure +typedef struct _IMV_RecordParam +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + float fFameRate; ///< [IN] \~chinese 帧率(大于0) \~english Frame rate(greater than 0) + unsigned int nQuality; ///< [IN] \~chinese 视频质量(1-100) \~english Video quality(1-100) + IMV_EVideoType recordFormat; ///< [IN] \~chinese 视频格式 \~english Video format + const char* pRecordFilePath; ///< [IN] \~chinese 保存视频路径 \~english Save video path + unsigned int nReserved[5]; ///< \~chinese 预留 \~english Reserved +}IMV_RecordParam; + +/// \~chinese +/// \brief 录像用帧信息结构体 +/// \~english +/// \brief Frame information for recording structure +typedef struct _IMV_RecordFrameInfoParam +{ + unsigned char* pData; ///< [IN] \~chinese 图像数据 \~english Image data + unsigned int nDataLen; ///< [IN] \~chinese 图像数据长度 \~english Image data length + unsigned int nPaddingX; ///< [IN] \~chinese 图像宽填充 \~english Padding X + unsigned int nPaddingY; ///< [IN] \~chinese 图像高填充 \~english Padding Y + IMV_EPixelType ePixelFormat; ///< [IN] \~chinese 像素格式 \~english Pixel format + unsigned int nReserved[5]; ///< \~chinese 预留 \~english Reserved +}IMV_RecordFrameInfoParam; + +/// \~chinese +/// \brief 图像翻转结构体 +/// \~english +/// \brief Flip image structure +typedef struct _IMV_FlipImageParam +{ + unsigned int nWidth; ///< [IN] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN] \~chinese 图像高 \~english Height + IMV_EPixelType ePixelFormat; ///< [IN] \~chinese 像素格式 \~english Pixel format + IMV_EFlipType eFlipType; ///< [IN] \~chinese 翻转类型 \~english Flip type + unsigned char* pSrcData; ///< [IN] \~chinese 输入图像数据 \~english Input image data + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入图像长度 \~english Input image length + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存(调用者分配缓存) \~english Output data buffer(allocated cache by the caller) + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstDataLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved +}IMV_FlipImageParam; + +/// \~chinese +/// \brief 图像旋转结构体 +/// \~english +/// \brief Rotate image structure +typedef struct _IMV_RotateImageParam +{ + unsigned int nWidth; ///< [IN][OUT] \~chinese 图像宽 \~english Width + unsigned int nHeight; ///< [IN][OUT] \~chinese 图像高 \~english Height + IMV_EPixelType ePixelFormat; ///< [IN] \~chinese 像素格式 \~english Pixel format + IMV_ERotationAngle eRotationAngle; ///< [IN] \~chinese 旋转角度 \~english Rotation angle + unsigned char* pSrcData; ///< [IN] \~chinese 输入图像数据 \~english Input image data + unsigned int nSrcDataLen; ///< [IN] \~chinese 输入图像长度 \~english Input image length + unsigned char* pDstBuf; ///< [OUT] \~chinese 输出数据缓存(调用者分配缓存) \~english Output data buffer(allocated cache by the caller) + unsigned int nDstBufSize; ///< [IN] \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size + unsigned int nDstDataLen; ///< [OUT] \~chinese 输出数据长度 \~english Output data length + unsigned int nReserved[8]; ///< \~chinese 预留 \~english Reserved +}IMV_RotateImageParam; + +/// \~chinese +/// \brief 设备连接状态事件回调函数声明 +/// \param pParamUpdateArg [in] 回调时主动推送的设备连接状态事件信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of device connection status event +/// \param pStreamArg [in] The device connection status event which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_ConnectCallBack)(const IMV_SConnectArg* pConnectArg, void* pUser); + +/// \~chinese +/// \brief 参数更新事件回调函数声明 +/// \param pParamUpdateArg [in] 回调时主动推送的参数更新事件信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of parameter update event +/// \param pStreamArg [in] The parameter update event which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_ParamUpdateCallBack)(const IMV_SParamUpdateArg* pParamUpdateArg, void* pUser); + +/// \~chinese +/// \brief 流事件回调函数声明 +/// \param pStreamArg [in] 回调时主动推送的流事件信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of stream event +/// \param pStreamArg [in] The stream event which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_StreamCallBack)(const IMV_SStreamArg* pStreamArg, void* pUser); + +/// \~chinese +/// \brief 消息通道事件回调函数声明 +/// \param pMsgChannelArg [in] 回调时主动推送的消息通道事件信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of message channel event +/// \param pMsgChannelArg [in] The message channel event which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_MsgChannelCallBack)(const IMV_SMsgChannelArg* pMsgChannelArg, void* pUser); + +/// \~chinese +/// \brief 帧数据信息回调函数声明 +/// \param pFrame [in] 回调时主动推送的帧信息 +/// \param pUser [in] 用户自定义数据 +/// \~english +/// \brief Call back function declaration of frame data information +/// \param pFrame [in] The frame information which will be active pushed out during the callback +/// \param pUser [in] User defined data +typedef void(*IMV_FrameCallBack)(IMV_Frame* pFrame, void* pUser); + +#endif // __IMV_DEFINES_H__ \ No newline at end of file diff --git a/lib/GenICam/bin/Linux64_x64/libGCBase_gcc421_v3_0.so b/lib/GenICam/bin/Linux64_x64/libGCBase_gcc421_v3_0.so new file mode 100644 index 0000000..a749e9c Binary files /dev/null and b/lib/GenICam/bin/Linux64_x64/libGCBase_gcc421_v3_0.so differ diff --git a/lib/GenICam/bin/Linux64_x64/libGenApi_gcc421_v3_0.so b/lib/GenICam/bin/Linux64_x64/libGenApi_gcc421_v3_0.so new file mode 100644 index 0000000..6895642 Binary files /dev/null and b/lib/GenICam/bin/Linux64_x64/libGenApi_gcc421_v3_0.so differ diff --git a/lib/GenICam/bin/Linux64_x64/libLog_gcc421_v3_0.so b/lib/GenICam/bin/Linux64_x64/libLog_gcc421_v3_0.so new file mode 100644 index 0000000..8b7cbfd Binary files /dev/null and b/lib/GenICam/bin/Linux64_x64/libLog_gcc421_v3_0.so differ diff --git a/lib/GenICam/bin/Linux64_x64/libMathParser_gcc421_v3_0.so b/lib/GenICam/bin/Linux64_x64/libMathParser_gcc421_v3_0.so new file mode 100644 index 0000000..04050d2 Binary files /dev/null and b/lib/GenICam/bin/Linux64_x64/libMathParser_gcc421_v3_0.so differ diff --git a/lib/GenICam/bin/Linux64_x64/libNodeMapData_gcc421_v3_0.so b/lib/GenICam/bin/Linux64_x64/libNodeMapData_gcc421_v3_0.so new file mode 100644 index 0000000..3dac61c Binary files /dev/null and b/lib/GenICam/bin/Linux64_x64/libNodeMapData_gcc421_v3_0.so differ diff --git a/lib/GenICam/bin/Linux64_x64/libXmlParser_gcc421_v3_0.so b/lib/GenICam/bin/Linux64_x64/libXmlParser_gcc421_v3_0.so new file mode 100644 index 0000000..b93e919 Binary files /dev/null and b/lib/GenICam/bin/Linux64_x64/libXmlParser_gcc421_v3_0.so differ diff --git a/lib/GenICam/bin/Linux64_x64/liblog4cpp_gcc421_v3_0.so b/lib/GenICam/bin/Linux64_x64/liblog4cpp_gcc421_v3_0.so new file mode 100644 index 0000000..c2710a4 Binary files /dev/null and b/lib/GenICam/bin/Linux64_x64/liblog4cpp_gcc421_v3_0.so differ diff --git a/lib/GenICam/log/config-unix/DefaultLogging.properties b/lib/GenICam/log/config-unix/DefaultLogging.properties new file mode 100644 index 0000000..0452fee --- /dev/null +++ b/lib/GenICam/log/config-unix/DefaultLogging.properties @@ -0,0 +1,6 @@ +# These settings are loaded as default + +log4j.rootCategory=ERROR, Console +log4cpp.appender.Console=org.apache.log4j.ConsoleAppender +log4cpp.appender.Console.layout=org.apache.log4j.PatternLayout +log4cpp.appender.Console.layout.ConversionPattern==>LOG %x: %c : %m%n diff --git a/lib/GenICam/xml/GenApi/GenApiSchema_Version_1_0.xsd b/lib/GenICam/xml/GenApi/GenApiSchema_Version_1_0.xsd new file mode 100644 index 0000000..bf420d6 --- /dev/null +++ b/lib/GenICam/xml/GenApi/GenApiSchema_Version_1_0.xsd @@ -0,0 +1,741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cache on write and write into register + + + + + Write w/o cache, read updates cache + + + + + Do not perform caching + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/GenICam/xml/GenApi/GenApiSchema_Version_1_1.xsd b/lib/GenICam/xml/GenApi/GenApiSchema_Version_1_1.xsd new file mode 100644 index 0000000..26dfb01 --- /dev/null +++ b/lib/GenICam/xml/GenApi/GenApiSchema_Version_1_1.xsd @@ -0,0 +1,1221 @@ + + + + + + + + The outer element of a device description file. It contains a set of nodes which are connected + via pointers and which describe a mapping from features (like Gain) to a register space + defined in terms of address and length. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + List of all possible node types. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used for structuring device description files. Groups can be nested in any depth. + They have no meaning with respect to the device functionality and are stripped off the device + description file in a pre-processing step. + + + + + + + + + + + Lists the elements which are common to (nearly) all nodes. + + + + + + + + + + + + + + + + + + + + + + + + + Lists the attributes which are common to all nodes. + + + + + + + + + + + Lists the elements which are common to all register nodes with a pLength element + + + + + + + + + + + + + + + + + + + + + + + + + + The simple node with no functionality. + + + + + + + + + + + + Contains references to features which are exposed to the user via API or GUI. + Can be nested in any depth. + + + + + + + + + + + + + Integer node which can be used to collect Value, Min, Max, and Inc or be used as Multiplexer + or be used as Replicator. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Maps to a register of Integer type. + + + + + + + + + + + + + + + + Maps to a subset (bit range) of a register of Integer type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Describes a collection of subsets (bit ranges) on the same integer register + + + + + + + + + + + + + Describes a one subset (bit range) of a StructReg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A node for issuing commands. + + + + + + + + + + + + + + + + + + + + + A node for issuing boolean values based on an integer node + + + + + + + + + + + + + + + + + + + + Float node which can be used to collect Value, Min, and Max, or be used as Multiplexer. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bi-directional Float Swiss-knife. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bi-directional Integer Swiss-knife. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Maps to a Float register. + + + + + + + + + + + + + + + + Enumeration mapping to an Integer. + + + + + + + + + + + + + + + + + + + + Possible value of an Enumeration node + + + + + + + + + + + + + + + + String node + + + + + + + + + + + + + + + + + String mapping to a register + + + + + + + + + + + Register exposed as byte array. + + + + + + + + + + + Uno-directional formula interpreter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Uno-directional formula interpreter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Node mapping to a port accessing the device's registers. + + + + + + + + + + + + + + + + + + Accesses a IEEE1212 configuration ROM address block + + + + + + + + + + + + + + + + + + + + + + + + Accesses a Text entry in a IEEE1212 configuration ROM address block + + + + + + + + + + + + Accesses an Integer entry in a IEEE1212 configuration ROM address block + + + + + + + + + + + + Gets the address of a DCAM smart feature + + + + + + + + + + + + + Gets the address of a smart feature + + + + + + + + + + + + + + + + + + + Content to custom extend a device description file. The extension entries are stripped away + during pre-processing of the device description file. + + + + + + + + + + + + + + + + + + + + + + + + + + Cache on write and write into register + + + + + Write w/o cache, read updates cache + + + + + Do not perform caching + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/GenICam/xml/GenApi/GenApi_Params_h.xsl b/lib/GenICam/xml/GenApi/GenApi_Params_h.xsl new file mode 100644 index 0000000..15961fa --- /dev/null +++ b/lib/GenICam/xml/GenApi/GenApi_Params_h.xsl @@ -0,0 +1,376 @@ + + + + + + + + + + + +//----------------------------------------------------------------------------- +// (c) 2004-2008 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +//----------------------------------------------------------------------------- +/*! +\file +\brief +*/ + +//----------------------------------------------------------------------------- +// This file is generated automatically +// Do not modify! +//----------------------------------------------------------------------------- + + + _ + + +#ifndef _PARAMS_H +#define _PARAMS_H + +#include <GenApi/IEnumerationT.h> +#include <GenApi/NodeMapRef.h> +#include <GenApi/DLLLoad.h> + +//! The namespace containing the device's control interface and related enumeration types +namespace +{ + + //************************************************************************************************** + // Enumerations + //************************************************************************************************** + + + //************************************************************************************************** + // Parameter class + //************************************************************************************************** + + C_Params + + + //! + class + { + //---------------------------------------------------------------------------------------------------------------- + // Implementation + //---------------------------------------------------------------------------------------------------------------- + protected: + // If you want to show the following methods in the help file + // add the string HIDE_CLASS_METHODS to the ENABLED_SECTIONS tag in the doxygen file + //! \cond HIDE_CLASS_METHODS + + //! Constructor + (void); + + //! Destructor + ~(void); + + //! Initializes the references + void _Initialize(GenApi::INodeMap*); + + //! Return the vendor of the camera + const char* _GetVendorName(void); + + //! Returns the camera model name + const char* _GetModelName(void); + + //! \endcond + + //---------------------------------------------------------------------------------------------------------------- + // References to features + //---------------------------------------------------------------------------------------------------------------- + public: + + + private: + //! \cond HIDE_CLASS_METHODS + + //! not implemented copy constructor + (&); + + //! not implemented assignment operator + & operator=(&); + + //! \endcond + }; + + + //************************************************************************************************** + // Parameter class implementation + //************************************************************************************************** + + //! \cond HIDE_CLASS_METHODS + + inline ::(void) + + { + } + + inline ::~(void) + { + + } + + inline void ::_Initialize(GenApi::INodeMap* _Ptr) + { + + } + + inline const char* ::_GetVendorName(void) + { + return ""; + } + + inline const char* ::_GetModelName(void) + { + return ""; + } + + //! \endcond + +} // namespace + +#endif // _PARAMS_H + + + + + + + + + + + + + //! Valid values for + enum Enums + { + + }; + + + + + + + + + + + + , + + + + + + + _ //!< + + + + + + + + + + + + + //! \name - + + + //! \name Miscellaneous Features + + + //@{ + /*! + \brief + + + + + + \b Visibility = + + + \b Visibility = Beginner + + + + \b Selected by : + + , + + + + */ + +# pragma deprecated( ) +# pragma warning(push) +# pragma warning(disable: 4995) // name has been marked as deprecated + + + + GenApi:: + T< + Enums > + + + GenApi:: + + + + & + ; + +# pragma warning(pop) + + //@} + + + + + + + + + + + + + + + + : + + + , + + + + +# pragma warning(push) +# pragma warning(disable: 4995) // name has been marked as deprecated + + + + ( *new GenApi::<Enums>() ) + + + ( *new GenApi::() ) + + + +# pragma warning(pop) + + + + + + + + + + + + +# pragma warning(push) +# pragma warning(disable: 4995) // name has been marked as deprecated + + + + delete static_cast < GenApi::<Enums> *> (& ); + + + delete static_cast < GenApi::*> (& ); + + + +# pragma warning(pop) + + + + + + + + + + + +# pragma warning(push) +# pragma warning(disable: 4995) // name has been marked as deprecated + + + + static_cast<GenApi::<Enums> *> (& )->SetReference(_Ptr->GetNode("")); + + + static_cast<GenApi::*> (& )->SetReference(_Ptr->GetNode("")); + + + + + static_cast<GenApi::<Enums> *> (& )->SetNumEnums(); + + + + + + +# pragma warning(pop) + + + + + + + + + + + + + + + + + + + + + + + static_cast<GenApi::CEnumerationTRef<Enums> *> (& )->SetEnumReference( _, "" ); + + + diff --git a/lib/GenICam/xml/GenApi/GenApi_Ptr_h.xsl b/lib/GenICam/xml/GenApi/GenApi_Ptr_h.xsl new file mode 100644 index 0000000..ed5108c --- /dev/null +++ b/lib/GenICam/xml/GenApi/GenApi_Ptr_h.xsl @@ -0,0 +1,83 @@ + + + + + +Params.h + + + + + +//----------------------------------------------------------------------------- +// (c) 2004-2008 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +//----------------------------------------------------------------------------- +/*! +\file +\brief +*/ +//----------------------------------------------------------------------------- +// This file is generated automatically +// Do not modify! +//----------------------------------------------------------------------------- + + _ + + +#ifndef _PTR_H +#define _PTR_H + +#include <GenApi/NodeMapRef.h> +#include "" + +//! The namespace containing the device's control interface and related enumeration types +namespace +{ + //************************************************************************************************** + // Access class + //************************************************************************************************** + //! + class C + : public GenApi::CNodeMapRefT<::C_Params> + { + public: + //! Constructor + C(GenICam::gcstring DeviceName = "Device") : GenApi::CNodeMapRefT<::C_Params>(DeviceName) + { + } + }; + + +} // namespace + +#endif // _PTR_H + + + + + diff --git a/lib/GenICam/xml/GenApi/NodeTypes.xml b/lib/GenICam/xml/GenApi/NodeTypes.xml new file mode 100644 index 0000000..44315d6 --- /dev/null +++ b/lib/GenICam/xml/GenApi/NodeTypes.xml @@ -0,0 +1,131 @@ + + + + + + CValueNode + IValue + CValueRef + + + CCategory + ICategory + CCategoryRef + + + CInteger + IInteger + CIntegerRef + + + CEnumeration + IEnumeration + CEnumerationTRef + + + CEnumEntry + IEnumEntry + CEnumEntryRef + + + CMaskedIntReg + IInteger + CIntegerRef + + + CRegister + IRegister + CRegisterRef + + + CIntReg + IInteger + CIntegerRef + + + CFloat + IFloat + CFloatRef + + + CFltReg + IFloat + CFloatRef + + + CSwissKnife + IFloat + CFloatRef + + + CIntSwissKnife + IInteger + CIntegerRef + + + CIntKey + IInteger + CIntegerRef + + + CTxtKey + IString + CStringRef + + + CPort + IPort + CPortRecorderRef + + + CIEEE1212Parser + IRegister + CRegisterRef + + + CDcamAccessCtrlReg + IInteger + CIntegerRef + + + CSmartFeature + IInteger + CIntegerRef + + + CStringNode + IString + CStringRef + + + CStringRegister + IString + CStringRef + + + CBoolean + IBoolean + CBooleanRef + + + CCommand + ICommand + CCommandRef + + + CConverter + IFloat + CFloatRef + + + CIntConverter + IInteger + CIntegerRef + + diff --git a/lib/GenICam/xml/GenApi/NodeTypes.xsd b/lib/GenICam/xml/GenApi/NodeTypes.xsd new file mode 100644 index 0000000..dc852e8 --- /dev/null +++ b/lib/GenICam/xml/GenApi/NodeTypes.xsd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/Qt/libQt5Core.so.5.5.1 b/lib/Qt/libQt5Core.so.5.5.1 new file mode 100644 index 0000000..71d7a30 Binary files /dev/null and b/lib/Qt/libQt5Core.so.5.5.1 differ diff --git a/lib/Qt/libQt5DBus.so.5.5.1 b/lib/Qt/libQt5DBus.so.5.5.1 new file mode 100644 index 0000000..302eb7a Binary files /dev/null and b/lib/Qt/libQt5DBus.so.5.5.1 differ diff --git a/lib/Qt/libQt5Gui.so.5.5.1 b/lib/Qt/libQt5Gui.so.5.5.1 new file mode 100644 index 0000000..741dffb Binary files /dev/null and b/lib/Qt/libQt5Gui.so.5.5.1 differ diff --git a/lib/Qt/libQt5Network.so.5.5.1 b/lib/Qt/libQt5Network.so.5.5.1 new file mode 100644 index 0000000..a0e56e7 Binary files /dev/null and b/lib/Qt/libQt5Network.so.5.5.1 differ diff --git a/lib/Qt/libQt5Xml.so.5.5.1 b/lib/Qt/libQt5Xml.so.5.5.1 new file mode 100644 index 0000000..f005c55 Binary files /dev/null and b/lib/Qt/libQt5Xml.so.5.5.1 differ diff --git a/lib/libImageConvert.so b/lib/libImageConvert.so new file mode 100644 index 0000000..bf3b972 Binary files /dev/null and b/lib/libImageConvert.so differ diff --git a/lib/libMVSDK.so.2.1.0.194984 b/lib/libMVSDK.so.2.1.0.194984 new file mode 100644 index 0000000..cc940a7 Binary files /dev/null and b/lib/libMVSDK.so.2.1.0.194984 differ diff --git a/lib/libMVSDKGuiQt.so b/lib/libMVSDKGuiQt.so new file mode 100644 index 0000000..79fb681 Binary files /dev/null and b/lib/libMVSDKGuiQt.so differ diff --git a/lib/libVideoRender.so b/lib/libVideoRender.so new file mode 100644 index 0000000..3cc9d67 Binary files /dev/null and b/lib/libVideoRender.so differ diff --git a/lib/liblog4cpp.so b/lib/liblog4cpp.so new file mode 100644 index 0000000..b4dfcd9 Binary files /dev/null and b/lib/liblog4cpp.so differ