IRayFpdSys.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. /**
  2. * File: IRayFpdSys.h
  3. *
  4. * Purpose: Main access interface of iRay flat panel SDK.
  5. *
  6. * @author Haitao.Ning
  7. * @version 1.0 2015/02/02
  8. *
  9. * Copyright (C) 2009, 2015, iRay Technology (Shanghai) Ltd.
  10. *
  11. * @code: sample code for demostrating IRayFpdSys.DLL interface only,
  12. * more error-handling shall be performed in user's program, detail see "Programming Guide" document.
  13. * ---------------------------------------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "IRayFpdSys.h"
  16. #define TEST_WORKDIR_1 "D:\\MyDR\\MyDetector1"
  17. #define TEST_WORKDIR_2 "D:\\MyDR\\MyDetector2"
  18. void MyCallback(int nDetectorID, int nEventID, int nEventLevel,
  19. const char* pszMsg, int nParam1, int nParam2, int nPtrParamLen, void* pParam);
  20. FnCreate g_fpCreate;
  21. FnDestroy g_fpDestroy;
  22. FnGetAttr g_fpGetAttr;
  23. FnSetAttr g_fpSetAttr;
  24. FnInvoke g_fpInvoke;
  25. int _tmain(int argc, _TCHAR* argv[])
  26. {
  27. HMODULE hModule = LoadLibraryA("FpdSys.DLL");
  28. if (NULL == hModule)
  29. {
  30. printf("\r\n----Load SDK DLL failed!----");
  31. return 0;
  32. }
  33. g_fpCreate = (FnCreate)GetProcAddress(hModule, IRAY_FPD_PROC_NAME_CREATE);
  34. g_fpDestroy = (FnDestroy)GetProcAddress(hModule, IRAY_FPD_PROC_NAME_DESTROY);
  35. g_fpGetAttr = (FnGetAttr)GetProcAddress(hModule, IRAY_FPD_PROC_NAME_GETATTR);
  36. g_fpSetAttr = (FnSetAttr)GetProcAddress(hModule, IRAY_FPD_PROC_NAME_SETATTR);
  37. g_fpInvoke = (FnInvoke)GetProcAddress(hModule, IRAY_FPD_PROC_NAME_INVOKE);
  38. if (NULL == g_fpCreate || NULL == g_fpDestroy || NULL == g_fpGetAttr ||
  39. NULL == g_fpSetAttr || NULL == g_fpInvoke)
  40. {
  41. printf("\r\n----Get exported function failed!----");
  42. FreeLibrary(hModule);
  43. return 0;
  44. }
  45. FPDRESULT result;
  46. int nDetectorID1;
  47. result = g_fpCreate(TEST_WORKDIR_1, &MyCallback, &nDetectorID1);
  48. if (Err_OK == result)
  49. {
  50. IRayVariant var;
  51. var.vt = IVT_INT;
  52. var.val.nVal = 1;
  53. result = g_fpSetAttr(nDetectorID1, Cfg_ComPort, &var);
  54. if (Err_OK != result)
  55. {
  56. printf("\r\n----Test set attribute data failed!----");
  57. }
  58. else
  59. {
  60. printf("\r\n----Test set attribute data succeed----");
  61. }
  62. result = g_fpGetAttr(nDetectorID1, Attr_State, &var);
  63. if (Err_OK != result)
  64. {
  65. printf("\r\n----Test get attribute data failed!----");
  66. }
  67. else
  68. {
  69. printf("\r\n----Test get attribute data succeed, value = %d----", var.val.nVal);
  70. }
  71. }
  72. else
  73. {
  74. printf("\r\n----Create detector object failed!----");
  75. FreeLibrary(hModule);
  76. return 0;
  77. }
  78. int nDetectorID2;
  79. result = g_fpCreate(TEST_WORKDIR_2, &MyCallback, &nDetectorID2);
  80. if (Err_OK == result)
  81. {
  82. result = g_fpInvoke(nDetectorID2, Cmd_Connect, NULL, 0);
  83. if (Err_TaskPending == result)
  84. {
  85. printf("\r\n----Test command invoke is pending, please wait task result event.----");
  86. }
  87. if (Err_OK == result)
  88. {
  89. printf("\r\n----Test command invoke succeed!----");
  90. }
  91. else
  92. {
  93. printf("\r\n----Test command invoke failed! ErrCode = %d----", result);
  94. }
  95. }
  96. else
  97. {
  98. printf("\r\n----Create detector object failed!----");
  99. g_fpDestroy(nDetectorID1);
  100. FreeLibrary(hModule);
  101. return 0;
  102. }
  103. while (getchar() != 'q')
  104. {
  105. Sleep(10);
  106. }
  107. g_fpDestroy(nDetectorID1);
  108. g_fpDestroy(nDetectorID2);
  109. FreeLibrary(hModule);
  110. return 0;
  111. }
  112. void MyCallback(int nDetectorID, int nEventID, int nEventLevel,
  113. const char* pszMsg, int nParam1, int nParam2, int nPtrParamLen, void* pParam)
  114. {
  115. switch (nEventID)
  116. {
  117. case Evt_TaskResult_Succeed:
  118. if (Cmd_Connect == nParam1)
  119. {
  120. printf("\r\n----Test event callback succeed, Detector connected: ID = %d----", nDetectorID);
  121. }
  122. break;
  123. default:
  124. break;
  125. }
  126. }
  127. * ---------------------------------------------------------------------------------------------------------
  128. * @endcode
  129. *
  130. */
  131. #ifndef _IRAY_FPD_SYSTEM_INTERFACE_H_
  132. #define _IRAY_FPD_SYSTEM_INTERFACE_H_
  133. #include "IRayVariant.h"
  134. #include "IRayImage.h"
  135. #include "IRayErrDef.h"
  136. #include "IRayCmdDef.h"
  137. #include "IRayAttrDef.h"
  138. #include "IRayEnumDef.h"
  139. #include "IRayEventDef.h"
  140. #define IRAY_FPD_PROC_NAME_VERSION "GetSDKVersion"
  141. #define IRAY_FPD_PROC_SET_USERCODE "SetUserCode"
  142. #define IRAY_FPD_PROC_NAME_REGISTER_SCANNotify "RegisterScanNotify"
  143. #define IRAY_FPD_PROC_NAME_SCAN "ScanOnce"
  144. #define IRAY_FPD_PROC_NAME_CREATE "Create"
  145. #define IRAY_FPD_PROC_NAME_DESTROY "Destroy"
  146. #define IRAY_FPD_PROC_NAME_GETATTR "GetAttr"
  147. #define IRAY_FPD_PROC_NAME_SETATTR "SetAttr"
  148. #define IRAY_FPD_PROC_NAME_INVOKE "Invoke"
  149. #define IRAY_FPD_PROC_NAME_ABORT "Abort"
  150. #define IRAY_FPD_PROC_NAME_DEFECT_OPEN "OpenDefectTemplateFile"
  151. #define IRAY_FPD_PROC_NAME_DEFECT_SAVE "SaveDefectTemplateFile"
  152. #define IRAY_FPD_PROC_NAME_DEFECT_CLOSE "CloseDefectTemplateFile"
  153. #define IRAY_FPD_PROC_NAME_EXPLINE_CORRECT "DoExpLineCorrect"
  154. #define IRAY_FPD_PROC_NAME_SYNC_CREATE "SyncBoxCreate"
  155. #define IRAY_FPD_PROC_NAME_SYNC_DESTROY "SyncBoxDestroy"
  156. #define IRAY_FPD_PROC_NAME_SYNC_BIND "SyncBoxBind"
  157. #define IRAY_FPD_PROC_NAME_SYNC_GET_BIND "SyncBoxGetBind"
  158. #define IRAY_FPD_PROC_NAME_SYNC_GET_TUBEREADYTIME "SyncBoxGetTubeReadyTime"
  159. #define IRAY_FPD_PROC_NAME_SYNC_SET_TUBEREADYTIME "SyncBoxSetTubeReadyTime"
  160. #define IRAY_FPD_PROC_NAME_SYNC_GET_STATE "SyncBoxGetState"
  161. /**
  162. * FnGetSDKVersion: Define a function type for DLL export function "GetSDKVersion"
  163. *
  164. * GetSDKVersion: Get IRay FPD SDK software version
  165. *
  166. * @param pszVersion [out] buffer to receive the version infomation
  167. * for example "4.0.1.33" (MainVer.Function.Fixing.Build)
  168. *
  169. * @return 0: succeed, Non-Zero: error code
  170. */
  171. typedef int(*FnGetSDKVersion)(char pszVersion[32]);
  172. /**
  173. * FnSetUserCode: Define a function type for DLL export function "SetUserCode"
  174. *
  175. * SetUserCode: Set user code to obtain the authority specified by the license
  176. *
  177. * @param pszUserCode [in] User code to match the license
  178. *
  179. * @return 0: succeed, Non-Zero: error code
  180. */
  181. typedef int(*FnSetUserCode)(char* pszUserCode);
  182. /**
  183. * DetectorProfile: Define a data struct for scan and profile functions
  184. */
  185. #pragma pack(1)
  186. typedef struct _tagDetectorProfile
  187. {
  188. int nProdNo;
  189. int nSubProdNo;
  190. char szSN[64];
  191. char szIP[64];
  192. char szDetConfig[512];
  193. int bDetState; // 0:not busy, 1:busy
  194. }DetectorProfile;
  195. #pragma pack()
  196. /**
  197. * FnNotifyScanResult: Define a function type for broadcast scanning callback,
  198. * Note that: the data is only avaliable within the calling
  199. *
  200. * @param pDetectorProfile [in] scan result data struct
  201. *
  202. * @return void
  203. */
  204. typedef void(*FnNotifyScanResult)(DetectorProfile* pDetectorProfile);
  205. /**
  206. * FnRegisterScanNotify: Define a function type for DLL export function "RegisterScanNotify"
  207. *
  208. * RegisterScanNotify: register the scanning result callback function
  209. *
  210. * @param pCallback [in] callback function pointer, return the scan result from operation "Scan once" or
  211. * firmware pushed online notification.
  212. *
  213. * @return 0: succeed, Non-Zero: error code
  214. */
  215. typedef int(*FnRegisterScanNotify)(FnNotifyScanResult pCallback);
  216. /**
  217. * FnScanOnce: Define a function type for DLL export function "ScanOnce"
  218. *
  219. * ScanOnce: Start a broadcast scan to find reachable detectors, the result notification will be
  220. * returned with registered callback.
  221. *
  222. * @param pszIP [in] IP address of selected local network card, NULL or "0.0.0.0" means broadcast all network cards
  223. *
  224. * @return 0: succeed, Non-Zero: error code
  225. */
  226. typedef int(*FnScanOnce)(char* pszSourceIP);
  227. /**
  228. * FnCallback: Define a function type for SDK callback,
  229. * this definition will be used as an function argument while creating a detector object.
  230. *
  231. * @param nDetectorID [in] the detector which fired the event
  232. * @param nEventID [in] event ID
  233. * @param nEventLevel [in] event level
  234. * @param pszMsg [in] string description for the event
  235. * @param nParam1 [in] parameter with the event, defined for a certain event
  236. * @param nParam2 [in] parameter with the event, defined for a certain event
  237. * @param nPtrParamLen [in] bytes count for pointer typed parameter, defined for a certain event
  238. * @param pParam [in] pointer typed parameter, defined for a certain event
  239. *
  240. * @return void
  241. */
  242. typedef void(*FnCallback)(int nDetectorID, int nEventID, int nEventLevel,
  243. const char* pszMsg, int nParam1, int nParam2, int nPtrParamLen, void* pParam);
  244. /**
  245. * FnCreate: Define a function type for DLL export function "Create"
  246. *
  247. * Create: Create memory detector object,
  248. * if work dir has been used, function call will return error, together with the occuppied detector ID.
  249. *
  250. * @param pszWorkDir [in] set the working directory for a certain flat panel device
  251. * @param fpCallback [in] set the function pointer for SDK event callback
  252. * @param pDetectorID [out] buffer to receive the created object ID
  253. *
  254. * @return 0: succeed, Non-Zero: error code
  255. */
  256. typedef int(*FnCreate)(const char* pszWorkDir, FnCallback fpCallback, int* pDetectorID);
  257. /**
  258. * FnDestroy: Define a function type for DLL export function "Destroy"
  259. *
  260. * Destroy: Close the connection of specified detector, release the corresponding memory object
  261. *
  262. * @param nDetectorID [in] the ID of memory detector object
  263. *
  264. * @return 0: succeed, Non-Zero: error code
  265. */
  266. typedef int(*FnDestroy)(int nDetectorID);
  267. /**
  268. * ReleaseLibraryResource: Release all resources before close sdk. It must be called in embedded linux OS, like android
  269. *
  270. * @return 0: succeed, Non-Zero: error code
  271. */
  272. typedef int(*FnReleaseLibraryResource)();
  273. /**
  274. * FnGetAttr: Define a function type for DLL export function "GetAttr"
  275. *
  276. * GetAttr: Get attribute value
  277. *
  278. * @param nDetectorID [in] specify a detector
  279. * @param nAttrID [in] specify an attribute for getting
  280. * @param pVar [out] buffer to receive the value
  281. *
  282. * @return 0: succeed, Non-Zero: error code
  283. */
  284. typedef int(*FnGetAttr)(int nDetectorID, int nAttrID, IRayVariant* pVar);
  285. /**
  286. * FnSetAttr: Define a function type for DLL export function "SetAttr"
  287. *
  288. * SetAttr: Set attribute value
  289. *
  290. * @param nDetectorID [in] specify a detector
  291. * @param nAttrID [in] specify an attribute for setting
  292. * @param pVar [in] variant to set
  293. *
  294. * @return 0: succeed, Non-Zero: error code
  295. */
  296. typedef int(*FnSetAttr)(int nDetectorID, int nAttrID, const IRayVariant* pVar);
  297. /**
  298. * FnInvoke: Define a function type for DLL export function "Invoke"
  299. *
  300. * Invoke: Call SDK method using a pre-defined command ID,
  301. * if "pending" returned, it means an asynchronous task is started and the result will be callback later.
  302. *
  303. * @param nDetectorID [in] specify a detector
  304. * @param nCommandID [in] specify an command for calling
  305. * @param pars [in] parameter list for a certain command
  306. * @param nParCount [in] the count of parameters
  307. *
  308. * @return 0: succeed, Non-Zero: "pending state" or error code
  309. */
  310. typedef int(*FnInvoke)(int nDetectorID, int nCommandID, IRayCmdParam pars[], int nParCount);
  311. /**
  312. * FnAbort: Define a function type for DLL export function "Abort"
  313. *
  314. * Abort: Abort the current transation processing flow
  315. *
  316. * @param nDetectorID [in] specify a detector
  317. *
  318. * @return 0: succeed, Non-Zero: error code
  319. */
  320. typedef int(*FnAbort)(int nDetectorID);
  321. /**
  322. * FnOpenDefectTemplateFile: Define a function type for DLL export function "OpenDefectTemplateFile"
  323. *
  324. * OpenDefectTemplateFile: Load the specified defect template file for editing
  325. *
  326. * @param pszFilePath [in] file path
  327. * @param ppHandler [out] return the handler of the opened file
  328. * @param pWidth [out] return width of the image
  329. * @param pHeight [out] return height of the image
  330. * @param ppPoints [out] return defect point map of the detector, for each element 0 means normal, 1 means defect
  331. * @param ppRows [out] return defect row map of the detector, for each element 0 means normal, 1 means defect
  332. * @param ppCols [out] return defect column map of the detector, for each element 0 means normal, 1 means defect
  333. * , if ppDualReadCols2 not NULL, ppCols means defect column map of the upper part
  334. * @param ppDualReadCols2 [out] only for the 'Dual-Read' detector, return defect column map of the bottom part
  335. * , NULL means not Dual-Read
  336. *
  337. *
  338. * @return 0: succeed, Non-Zero: error code
  339. */
  340. typedef int(*FnOpenDefectTemplateFile)(
  341. const char* pszFilePath,
  342. void** ppHandler,
  343. unsigned short* pWidth,
  344. unsigned short* pHeight,
  345. char** ppPoints, // arrayLen = width * height
  346. char** ppRows, // arrayLen = height
  347. char** ppCols, // arrayLen = width
  348. char** ppDualReadCols2 // arrayLen = width
  349. );
  350. /**
  351. * FnSaveDefectTemplateFile: Define a function type for DLL export function "SaveDefectTemplateFile"
  352. *
  353. * SaveDefectTemplateFile: Save the opened defect template file after editing
  354. *
  355. * @param pHandler [in] the handler of the opened file
  356. *
  357. * @return 0: succeed, Non-Zero: error code
  358. */
  359. typedef int(*FnSaveDefectTemplateFile)(void* pHandler);
  360. /**
  361. * FnCloseDefectTemplateFile: Define a function type for DLL export function "CloseDefectTemplateFile"
  362. *
  363. * CloseDefectTemplateFile: Close the opened defect template file
  364. *
  365. * @param pHandler [in] the handler of the opened file
  366. *
  367. * @return 0: succeed, Non-Zero: error code
  368. */
  369. typedef int(*FnCloseDefectTemplateFile)(void* pHandler);
  370. /**
  371. * FnDoExpLineCorrect: Define a function type for DLL export function "DoExpLineCorrect"
  372. *
  373. * DoExpLineCorrect: Do exposure line correction after grid removing process, for FreeSync mode only
  374. *
  375. * @param pData [in,out] image data pointer
  376. * @param usWidth [in] image width
  377. * @param usHeight [in] image height
  378. * @param usExpLine [in] exposure line number
  379. *
  380. * @return 0: succeed, Non-Zero: error code
  381. */
  382. typedef int(*FnDoExpLineCorrect)(unsigned short* pData, unsigned short usWidth, unsigned short usHeight, unsigned short usExpLine);
  383. /**
  384. * FnSyncBoxCreate: Define a function type for DLL export function "SyncBoxCreate"
  385. *
  386. * SyncBoxCreate: Create a memory object of syncbox
  387. *
  388. * @param nComPort [in] specify the serial COM port which the device connected,
  389. * is Zero is specified, the function should scan all the ports to find the device
  390. * @param pSyncboxID [in,out] buffer to receive the value of created syncbox ID
  391. *
  392. * @return 0: succeed, Non-Zero: error code
  393. */
  394. typedef int(*FnSyncBoxCreate)(int nComPort, int *pSyncboxID);
  395. /**
  396. * FnSyncBoxDestroy: Define a function type for DLL export function "SyncBoxDestroy"
  397. *
  398. * SyncBoxDestroy: Close the syncbox device and release the corresponding memory object
  399. *
  400. * @param nSyncBoxID [in] the ID of memory syncbox object
  401. *
  402. * @return 0: succeed, Non-Zero: error code
  403. */
  404. typedef int(*FnSyncBoxDestroy)(int nSyncBoxID);
  405. /**
  406. * FnSyncBoxBind: Define a function type for DLL export function "SyncBoxBind"
  407. *
  408. * SyncBoxBind: Bind a detector object to the syncbox.
  409. * Note that if the detector object destroyed, binding may be changed.
  410. *
  411. * @param nSyncboxID [in] specify the syncbox
  412. * @param nDetectorID [in] specify a detector which is going to bind to the syncbox
  413. *
  414. * @return 0: succeed, Non-Zero: error code
  415. */
  416. typedef int(*FnSyncBoxBind)(int nSyncboxID, int nDetectorID);
  417. /**
  418. * FnSyncBoxGetBind: Define a function type for DLL export function "SyncBoxGetBind"
  419. *
  420. * SyncBoxGetBind: Get the current bound detector of syncbox
  421. *
  422. * @param nSyncboxID [in] specify the syncbox
  423. * @param pDetectorID [in, out] buffer to receive the value.
  424. *
  425. * @return 0: succeed, Non-Zero: error code
  426. */
  427. typedef int(*FnSyncBoxGetBind)(int nSyncboxID, int *pDetectorID);
  428. /**
  429. * FnSyncBoxGetTubeReadyTime: Define a function type for DLL export function "SyncBoxGetTubeReadyTime"
  430. *
  431. * SyncBoxGetTubeReadyTime: Get the parameter value of "TubeReadyTime", syncbox will wait the specified time
  432. * after hand switch phase I is pressed and before the detector clear action start
  433. *
  434. * @param nSyncboxID [in] specify the syncbox
  435. * @param pTimeInMS [in,out] buffer to receive the value
  436. *
  437. * @return 0: succeed, Non-Zero: error code
  438. */
  439. typedef int(*FnSyncBoxGetTubeReadyTime)(int nSyncboxID, int *pTimeInMS);
  440. /**
  441. * FnSyncBoxSetTubeReadyTime: Define a function type for DLL export function "SyncBoxSetTubeReadyTime"
  442. *
  443. * SyncBoxSetTubeReadyTime: Set the parameter value of "TubeReadyTime" to device
  444. *
  445. * @param nSyncboxID [in] specify the syncbox
  446. * @param nTimeInMS [in] specify the time value, in MS
  447. *
  448. * @return 0: succeed, Non-Zero: error code
  449. */
  450. typedef int(*FnSyncBoxSetTubeReadyTime)(int nSyncboxID, int nTimeInMS);
  451. /**
  452. * FnSyncBoxGetState: Define a function type for DLL export function "SyncBoxGetState"
  453. *
  454. * SyncBoxGetState: Get the current state of syncbox
  455. *
  456. * @param nSyncboxID [in] specify the syncbox
  457. * @param pState [in, out] buffer to receive the value. 0 - Unknown, 1 - Ready, 2 - Busy
  458. *
  459. * @return 0: succeed, Non-Zero: error code
  460. */
  461. typedef int(*FnSyncBoxGetState)(int nSyncboxID, int *pState);
  462. /*
  463. * the following functions define another group of APIs for getting images
  464. *
  465. * FnUseImageBuf
  466. * FnClearImageBuf
  467. * FnQueryImageBuf
  468. * FnGetImageFromBuf
  469. */
  470. /**
  471. * FnUseImageBuf: Define a function type for DLL export function "UseImageBuf"
  472. *
  473. * UseImageBuf: Specify that Detector Object in SDK should use image buffer for return images,
  474. * disable the image events call back.
  475. *
  476. * @param nDetectID [in] specify a detector
  477. * @param ullBufSizeInBytes [in] specify the buffer size to create; disable pull model and enable callback mode if ullBufSizeInBytes is 0
  478. *
  479. * @return 0: succeed, Non-Zero: memory alloc failed or nDetectID is not available.
  480. */
  481. typedef int(*FnUseImageBuf)(int nDetectID, unsigned long long ullBufSizeInBytes);
  482. /**
  483. * FnClearImageBuf: Define a function type for DLL export function "ClearImageBuf"
  484. *
  485. * ClearImageBuf: Clear the buffered data, it's recommended that call ClearImageBuf before StartAcq
  486. *
  487. * @param nDetectID [in] specify a detector
  488. *
  489. * @return 0: succeed, Non-Zero: buffer not created or nDetectID is not available.
  490. */
  491. typedef int (*FnClearImageBuf)(int nDetectID);
  492. /**
  493. * FnQueryImageBuf: Define a function type for DLL export function "QueryImageBuf"
  494. *
  495. * QueryImageBuf: retrieve the information of the first acquired image in the buffer,
  496. * the size informations shall be used while getting the image data.
  497. *
  498. * @param nDetectID [in] specify a detector
  499. * @param pnFrameNum [out] frame number of the first buffered image
  500. * @param pnImageHeight [out] height of the first buffered image
  501. * @param pnImageWidth [out] width of the first buffered image
  502. * @param pnBytesPerPixel [out] how much bytes used for a pixel
  503. * @param pnPropListMemSize [out] memory size of the property list of the image
  504. *
  505. * @return 0: succeed, Non-Zero: buffer is empty or nDetectID is not available.
  506. */
  507. typedef int (*FnQueryImageBuf)(int nDetectID,
  508. int *pnFrameNum,
  509. int* pnImageHeight,
  510. int* pnImageWidth,
  511. int* pnBytesPerPixel,
  512. int *pnPropListMemSize
  513. );
  514. /**
  515. * FnGetImageFromBuf: Define a function type for DLL export function "GetImageFromBuf"
  516. *
  517. * GetImageFromBuf: Get the first buffered image and release the memory block for reusing,
  518. * after calling, convert pProperties to IRayImagePropertList* for later use
  519. * (see: typedef IRayVariantMap IRayImagePropertList;)
  520. *
  521. * @param nDetectID [in] specify a detector
  522. * @param pImage [in, out] memory to receive the image pixels data
  523. * @param nImageDataSize [in] size of the memory should >= ImageHeight * ImageWidth * BytesPerPixel
  524. * @param pProperties [in, out] memory to receive the image property list
  525. * @param nPropListMemSize [in] size of the memory should >= PropListMemSize(QueryImageBuf returned)
  526. *
  527. * @return 0: succeed, Non-Zero: error code
  528. */
  529. typedef int (*FnGetImageFromBuf)(int nDetectID,
  530. void* pImage,
  531. int nImageDataSize,
  532. void* pProperties,
  533. int nPropListMemSize
  534. );
  535. #endif