Add support to IMAQ conversion

This commit is contained in:
2026-04-13 10:39:26 +10:00
parent 749c7db3c6
commit 3a4320f253
3 changed files with 156 additions and 64 deletions

View File

@@ -167,8 +167,16 @@ extern "C" __declspec(dllexport) int ANSCV_ImagePatternMatchs_S(cv::Mat** image
extern "C" __declspec(dllexport) int ANSCV_ImagesToMP4_S(const char* imageFolder, const char* outputVideoPath, int targetDurationSec);
// IMAQ <-> cv::Mat conversion functions
extern "C" __declspec(dllexport) int ANSCV_IMAQ2Image(Image* imaqImage, cv::Mat** imageOut);
extern "C" __declspec(dllexport) int ANSCV_Image2IMAQ(cv::Mat** imageIn, Image* imaqImage);
// IMAQ -> cv::Mat conversion (NI Vision Image*, auto-detects indirection level)
extern "C" __declspec(dllexport) int ANSCV_IMAQ2Image(void* imaqHandle, cv::Mat** imageOut);
// cv::Mat -> IMAQ: outputs lossless PNG to LStrHandle, use IMAQ ReadFromString in LabVIEW
extern "C" __declspec(dllexport) int ANSCV_Image2IMAQ(cv::Mat** imageIn, LStrHandle outputImage);
// cv::Mat -> LabVIEW 2D U32 array for IMAQ ArrayToColorImage VI "Image Pixels (U32)"
typedef struct { int32 dimSizes[2]; uInt32 elt[1]; } LVArray2D_U32;
typedef LVArray2D_U32** LVArray2D_U32Hdl;
extern "C" __declspec(dllexport) int ANSCV_ImageToArray(cv::Mat** imageIn, LVArray2D_U32Hdl arrayOut);
// cv::Mat -> IMAQ via LStrHandle (lossless PNG)
extern "C" __declspec(dllexport) int ANSCV_Image2IMAQ(cv::Mat** imageIn, LStrHandle outputImage);
#endif