tisgrabber.h 90 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245
  1. #ifndef _TISGRABBER
  2. #define _TISGRABBER
  3. //////////////////////////////////////////////////////////////////////////
  4. /*! @mainpage
  5. Please see "tisgrabber.h" for the function documentation.
  6. */
  7. #include "TISGrabberGlobalDefs.h"
  8. // WINAPI for Visual Basic
  9. //#define AC WINAPI
  10. //////////////////////////////////////////////////////////////////////////
  11. /*! Calling convention of the DLL functions. For internal use only.
  12. */
  13. #define AC __stdcall ///< __stdcall for Borland C and Ansi C
  14. #ifndef _WINUSER_
  15. //////////////////////////////////////////////////////////////////////////
  16. /*! Workaround if we are in non windows environment.
  17. */
  18. #define NOHWNDDEFINED 1
  19. #define __HWND int ///< Workaround if we are in non windows environment.
  20. #else
  21. #define __HWND HWND ///<Workaround if we are in windows environment.
  22. #endif
  23. //////////////////////////////////////////////////////////////////////////
  24. /*! This is the handle of an grabber object. Please use the HGRABBER type to access
  25. this object.
  26. */
  27. typedef struct HGRABBER_t__ { int unused; } HGRABBER_t; ///<Internal structure of the grabber object handle.
  28. //////////////////////////////////////////////////////////////////////////
  29. /*! The HGRABBER type is used to hold a handle to a grabber object. Each variable of
  30. HGRABBER type can contain one video capture device. It is possible to create more
  31. than one variables of this type:
  32. HGRABBER camera1 = IC_CreateGrabber();
  33. HGRABBER camera2 = IC_CreateGrabber();
  34. */
  35. #define HGRABBER HGRABBER_t* ///< Type of grabber object handle. Used for all functions.
  36. typedef int _cdecl IC_ENUMCB( char* Name, void*);
  37. typedef struct FILTERPARAMETER_t__
  38. {
  39. char Name[30];
  40. FRAMEFILTER_PARAM_TYPE Type;
  41. } FILTERPARAMETER_t;
  42. typedef struct HFRAMEFILTER_t__
  43. {
  44. void *pFilter;
  45. int bHasDialog;
  46. int ParameterCount;
  47. FILTERPARAMETER_t *Parameters;
  48. } HFRAMEFILTER_t;
  49. #define HFRAMEFILTER HFRAMEFILTER_t
  50. //////////////////////////////////////////////////////////////////////////
  51. /*! A return value of IC_SUCCESS indicates that a function has been performed
  52. without an error.
  53. */
  54. #define IC_SUCCESS 1 ///< Return value for success.
  55. //////////////////////////////////////////////////////////////////////////
  56. /*! If a function returns IC_ERROR, then something went wrong.
  57. */
  58. #define IC_ERROR 0 ///< Return value that indicates an error.
  59. //////////////////////////////////////////////////////////////////////////
  60. /*! This error indicates, that an HGRABBER handle has not been created yet. Please
  61. see IC_CreateGrabber() for creating an HGRABBER handle.
  62. */
  63. #define IC_NO_HANDLE -1 ///< No device handle. HGRABBER is NULL.
  64. //////////////////////////////////////////////////////////////////////////
  65. /*! This return values indicates that no device has been opened. Please refer to
  66. IC_OpenVideoCaptureDevice().
  67. */
  68. #define IC_NO_DEVICE -2 ///< No device opened, but HGRABBER is valid.
  69. //////////////////////////////////////////////////////////////////////////
  70. /*! This return value indicates, that the video capture device is not in live mode,
  71. but live mode is for the current function call required. Please refer to
  72. IC_StartLive().
  73. */
  74. #define IC_NOT_AVAILABLE -3 ///< Property not avaiable, but HGRABBER is valid.
  75. //////////////////////////////////////////////////////////////////////////
  76. /*! This return value indicates, that the video capture device does not support
  77. the specified property.
  78. */
  79. #define IC_NO_PROPERTYSET -3 ///< The Propertyset was not queried.
  80. //////////////////////////////////////////////////////////////////////////
  81. /*! This return value indicates, that the porperty set was not queried for
  82. the current grabber handle. Please check, whether IC_QueryPropertySet()
  83. was called once before using the function.
  84. */
  85. #define IC_DEFAULT_WINDOW_SIZE_SET -3 ///< The live display window size could not be set
  86. //////////////////////////////////////////////////////////////////////////
  87. /*! This return value indicates, that setting of a custom live display window size
  88. failed, because IC_SetDefaultWindowPosition() was not called with parameter false
  89. somewhere before.
  90. @sa IC_SetDefaultWindowPosition
  91. @sa IC_SetWindowPosition
  92. */
  93. #define IC_NOT_IN_LIVEMODE -3 ///< A device has been opened, but is is not in live mode.
  94. //////////////////////////////////////////////////////////////////////////
  95. /*! This return value indicates, that a device does not support the requested property, or
  96. the name of a property was written in wrong way.
  97. @sa IC_GetPropertyValueRange
  98. */
  99. #define IC_PROPERTY_ITEM_NOT_AVAILABLE -4 ///< A requested property item is not available
  100. //////////////////////////////////////////////////////////////////////////
  101. /*! This return value indicates, that a device does not support the requested element property, or
  102. the name of an element was written in wrong way.
  103. @sa IC_GetPropertyValueRange
  104. */
  105. #define IC_PROPERTY_ELEMENT_NOT_AVAILABLE -5 ///< A requested element of a given property item is not available
  106. //////////////////////////////////////////////////////////////////////////
  107. /*! This return value indicates, that a property element does not support
  108. the request, that is wanted. e.g. Exposure Auto has no range, therefore
  109. IC_GetPropertyValueRange(hGrabber, "Epxosure","Auto", &min, &max )
  110. will return IC_PROPERTY_ELEMENT_WRONG_INTERFACE.
  111. @sa IC_GetPropertyValueRange
  112. */
  113. #define IC_PROPERTY_ELEMENT_WRONG_INTERFACE -6 ///< A requested element has not the interface, which is needed.
  114. //////////////////////////////////////////////////////////////////////////
  115. /*! This return value indicates, that there was an index passed, which
  116. was out of range of the number of available elements
  117. @sa IC_ListDevicesbyIndex
  118. */
  119. #define IC_INDEX_OUT_OF_RANGE -7 ///< A requested element has not the interface, which is needed.
  120. //////////////////////////////////////////////////////////////////////////
  121. /*! This return value indicates, that that the passed XML file contains no valid XML
  122. data.
  123. @sa IC_LoadDeviceStateFromFileEx
  124. */
  125. #define IC_WRONG_XML_FORMAT -1
  126. //////////////////////////////////////////////////////////////////////////
  127. /*! This return value indicates, that the passed XML file contains no compatible XML
  128. data.
  129. @sa IC_LoadDeviceStateFromFileEx
  130. */
  131. #define IC_WRONG_INCOMPATIBLE_XML -3
  132. //////////////////////////////////////////////////////////////////////////
  133. /*! This return value indicates, that not all properties have been restored
  134. as desired, but the camera itself was opened.
  135. @sa IC_LoadDeviceStateFromFileEx
  136. */
  137. #define IC_NOT_ALL_PROPERTIES_RESTORED -4
  138. //////////////////////////////////////////////////////////////////////////
  139. /*! This return value indicates, that the device specified in the XML was not
  140. found. E.g. The same model, but different serial number, or no camera
  141. connected at all.
  142. @sa IC_LoadDeviceStateFromFileEx
  143. */
  144. #define IC_DEVICE_NOT_FOUND -5
  145. //////////////////////////////////////////////////////////////////////////
  146. /*! This return value indicates, that the passed file does not exist
  147. @sa IC_LoadDeviceStateFromFileEx
  148. */
  149. #define IC_FILE_NOT_FOUND 35
  150. #if defined(__cplusplus)
  151. extern "C"
  152. {
  153. #endif
  154. //////////////////////////////////////////////////////////////////////////
  155. /*! Initialize the ICImagingControl class library. This function must be called
  156. only once before any other functions of this library are called.
  157. @param szLicenseKey IC Imaging Control license key or NULL if only a trial version is available.
  158. @retval IC_SUCCESS on success.
  159. @retval IC_ERROR on wrong license key or other errors.
  160. @sa IC_CloseLibrary
  161. */
  162. int AC IC_InitLibrary( char* szLicenseKey );///<Initialize the library.
  163. //////////////////////////////////////////////////////////////////////////
  164. /*! Creates a new grabber handle and returns it. A new created grabber should be
  165. release with a call to IC_ReleaseGrabber if it is no longer needed.
  166. @retval IC_SUCCESS on success.
  167. @retval IC_ERROR if an error occurred.
  168. @sa IC_ReleaseGrabber
  169. */
  170. HGRABBER AC IC_CreateGrabber();///<Create a new grabber handle
  171. //////////////////////////////////////////////////////////////////////////
  172. /*! Release the grabber object. Must be called, if the calling application
  173. does no longer need the grabber.
  174. @param hGrabber The handle to grabber to be released.
  175. @sa IC_CreateGrabber
  176. */
  177. void AC IC_ReleaseGrabber( HGRABBER *hGrabber ); ///< Release an HGRABBER object.
  178. //////////////////////////////////////////////////////////////////////////
  179. /* Must be called at the of the application to release allocated memory.
  180. @sa IC_InitLibrary
  181. */
  182. void AC IC_CloseLibrary(); ///< Closes the library, cleans up memory.
  183. //////////////////////////////////////////////////////////////////////////
  184. /*! Open a video capture device. The hGrabber handle must have been created previously by
  185. a call to IC_CreateGrabber(). Once a hGrabber handle has been created it can be
  186. recycled to open different video capture devices in sequence.
  187. @param hGrabber The handle to grabber object, that has been created by a call to IC_CreateGrabber
  188. @param szDeviceName Friendly name of the video capture device e.g. "DFK 21F04".
  189. @retval IC_SUCCESS on success.
  190. @retval IC_ERROR on errors.
  191. @sa IC_CloseVideoCaptureDevice
  192. @code
  193. #include "tisgrabber.h"
  194. void main()
  195. {
  196. HGRABBER hGrabber;
  197. if( IC_InitLibrary(0) == IC_SUCCESS )
  198. {
  199. hGrabber = IC_CreateGrabber();
  200. if( hGrabber )
  201. {
  202. if( IC_OpenVideoCaptureDevice(hGrabber,"DFK 21F04") == IC_SUCCESS )
  203. {
  204. // .. do something with the video capture device.
  205. // Now clean up.
  206. IC_CloseVideoCaptureDevice( hGrabber );
  207. IC_ReleaseGrabber( hGrabber );
  208. }
  209. IC_CloseLibrary();
  210. }
  211. }
  212. @endcode
  213. */
  214. int AC IC_OpenVideoCaptureDevice( HGRABBER hGrabber, char *szDeviceName ); ///< Opens a video capture device.
  215. //////////////////////////////////////////////////////////////////////////
  216. /*! Close the current video capture device. The HGRABBER object will not be deleted.
  217. It can be used again for opening another video capture device.
  218. @param hGrabber The handle to the grabber object.
  219. */
  220. void AC IC_CloseVideoCaptureDevice( HGRABBER hGrabber ); ///<Closes a video capture device.
  221. //////////////////////////////////////////////////////////////////////////
  222. /*! Retrieve the name of the current video capture device. If the device is
  223. invalid, NULL is returned.
  224. @param hGrabber The handle to the grabber object.
  225. @retval char* The name of the video capture device
  226. @retval NULL If no video capture device is currently opened.
  227. */
  228. char* AC IC_GetDeviceName(HGRABBER hGrabber ); ///<Returns the name of the current video capture device.
  229. int AC IC_GetVideoFormatWidth( HGRABBER hGrabber); ///<Returns the width of the video format.
  230. int AC IC_GetVideoFormatHeight( HGRABBER hGrabber);///<returns the height of the video format.
  231. //////////////////////////////////////////////////////////////////////////
  232. /*! Set the sink type. A sink type must be set before images can be snapped.
  233. The sink type basically describes the format of the buffer where the snapped
  234. images are stored.
  235. Possible values for format are:
  236. @li Y800
  237. @li RGB24
  238. @li RGB32
  239. @li UYVY
  240. The sink type may differ from the currently set video format.
  241. @param hGrabber The handle to the grabber object.
  242. @param format The desired color format. Possible values for format are:
  243. @li Y800
  244. @li RGB24
  245. @li RGB32
  246. @li UYVY
  247. @retval IC_SUCCESS on success
  248. @retval IC_ERROR if something went wrong.
  249. @note Please note that UYVY can only be used in conjunction with a UYVY video format.
  250. */
  251. int AC IC_SetFormat( HGRABBER hGrabber, COLORFORMAT format ); ///< Sets the color format of the sink.
  252. //////////////////////////////////////////////////////////////////////////
  253. /*! Retrieves the format of the sink type currently set (See IC_SetFormat()
  254. for possible formats). If no sink type is set
  255. or an error occurred, NONE is returned.
  256. The function returns a valid value only after IC_PreprareLive() or IC_StartLive()
  257. was called. Before these calls, NONE is returned.
  258. @param hGrabber The handle to the grabber object.
  259. @return The current sink color format.
  260. */
  261. COLORFORMAT AC IC_GetFormat( HGRABBER hGrabber ); ///<Returns the current color format of the sink.
  262. //////////////////////////////////////////////////////////////////////////
  263. /*! Set a video format for the current video capture device. The video format
  264. must be supported by the current video capture device.
  265. @param hGrabber The handle to the grabber object.
  266. @param szFormat A string that contains the desired video format.
  267. @retval IC_SUCCESS on success
  268. @retval IC_ERROR if something went wrong.
  269. @code
  270. #include "tisgrabber.h"
  271. void main()
  272. {
  273. HGRABBER hGrabber;
  274. if( IC_InitLibrary(0) == IC_SUCCESS )
  275. {
  276. hGrabber = IC_CreateGrabber();
  277. if( hGrabber )
  278. {
  279. if( IC_OpenVideoCaptureDevice(hGrabber,"DFK 21F04") == IC_SUCCESS )
  280. {
  281. if( IC_SetVideoFormat(hGrabber,"UYVY (640x480)" == IC_SUCCESS )
  282. {
  283. // .. do something with the video capture device.
  284. }
  285. // Now clean up.
  286. IC_CloseVideoCaptureDevice( hGrabber );
  287. IC_ReleaseGrabber( hGrabber );
  288. }
  289. IC_CloseLibrary();
  290. }
  291. }
  292. }
  293. @endcode
  294. */
  295. int AC IC_SetVideoFormat( HGRABBER hGrabber, char *szFormat ); ///<Sets the video format.
  296. //////////////////////////////////////////////////////////////////////////
  297. /*! Set a video norm for the current video capture device.
  298. @note The current video capture device must support video norms.
  299. @param hGrabber The handle to the grabber object.
  300. @param szNorm A string that contains the desired video format.
  301. @retval IC_SUCCESS on success
  302. @retval IC_ERROR if something went wrong.
  303. */
  304. int AC IC_SetVideoNorm( HGRABBER hGrabber, char *szNorm ); ///<Set the video norm.
  305. //////////////////////////////////////////////////////////////////////////
  306. /*! Set a input channel for the current video capture device.
  307. @note The current video capture device must support input channels..
  308. @param hGrabber The handle to the grabber object.
  309. @param szChannel A string that contains the desired video format.
  310. @retval IC_SUCCESS on success
  311. @retval IC_ERROR if something went wrong.
  312. */
  313. int AC IC_SetInputChannel( HGRABBER hGrabber, char *szChannel ); ///<Sets an input channel.
  314. //////////////////////////////////////////////////////////////////////////
  315. /*! Start the live video.
  316. @param hGrabber The handle to the grabber object.
  317. @param iShow The parameter indicates: @li 1 : Show the video @li 0 : Do not show the video, but deliver frames. (For callbacks etc.)
  318. @retval IC_SUCCESS on success
  319. @retval IC_ERROR if something went wrong.
  320. @sa IC_StopLive
  321. */
  322. int AC IC_StartLive( HGRABBER hGrabber, int iShow ); ///<Starts the live video.
  323. int AC IC_PrepareLive( HGRABBER hGrabber, int iShow); ///<Prepare the grabber for starting the live video.
  324. int AC IC_SuspendLive(HGRABBER hGrabber); ///<Suspends an image stream and puts it into prepared state.
  325. //////////////////////////////////////////////////////////////////////////
  326. /*! Check, whether the passed grabber already provides are live video
  327. @param hGrabber The handle to the grabber object.
  328. @retval 1 : Livevideo is running, 0 : Livevideo is not running.
  329. @retval IC_NO_HANDLE hGrabber is not a valid handle. GetGrabber was not called.
  330. @retval IC_NO_DEVICE No device opened. Open a device, before this function can be used.
  331. */
  332. int AC IC_IsLive( HGRABBER hGrabber );
  333. //////////////////////////////////////////////////////////////////////////
  334. /*! Stop the live video.
  335. @param hGrabber The handle to the grabber object.
  336. @sa IC_StartLive
  337. */
  338. void AC IC_StopLive( HGRABBER hGrabber ); ///<Stops the live video.
  339. //////////////////////////////////////////////////////////////////////////
  340. /*! Check, whether a property is supported by the current video capture device.
  341. @param hGrabber The handle to the grabber object.
  342. @sa eProperty The cammera property to be checked
  343. @retval IC_SUCCESS The property is supported.
  344. @retval IC_ERROR The property is not supported.
  345. @retval IC_NO_HANDLE hGrabber is not a valid handle. GetGrabber was not called.
  346. @retval IC_NO_DEVICE No device opened. Open a device, before this function can be used.
  347. */
  348. int AC IC_IsCameraPropertyAvailable( HGRABBER hGrabber, CAMERA_PROPERTY eProperty ); ///< Check whether a camera property is available.
  349. //////////////////////////////////////////////////////////////////////////
  350. /*! Set a camera property like exposure, zoom.
  351. @param hGrabber The handle to the grabber object.
  352. @param eProperty The property to be set. It can have following values:
  353. @li PROP_CAM_PAN
  354. @li PROP_CAM_TILT,
  355. @li PROP_CAM_ROLL,
  356. @li PROP_CAM_ZOOM,
  357. @li PROP_CAM_EXPOSURE,
  358. @li PROP_CAM_IRIS,
  359. @li PROP_CAM_FOCUS
  360. @param lValue The value the property is to be set to.
  361. @retval IC_SUCCESS on success
  362. @retval IC_ERROR if something went wrong.
  363. @note lValue should be in the range of the specified property.
  364. If the value could not be set (out of range, auto is currently enabled), the
  365. function returns 0. On success, the functions returns 1.
  366. */
  367. int AC IC_SetCameraProperty( HGRABBER hGrabber, CAMERA_PROPERTY eProperty, long lValue ); ///< Set a camera property.
  368. int AC IC_CameraPropertyGetRange( HGRABBER hGrabber, CAMERA_PROPERTY eProperty, long *lMin, long *lMax); ///<Get the minimum and maximum value of a camera property
  369. int AC IC_GetCameraProperty( HGRABBER hGrabber, CAMERA_PROPERTY eProperty, long *lValue); ///< Get a camera property's value.
  370. //////////////////////////////////////////////////////////////////////////
  371. /*! Enable or disable automatic for a camera property.
  372. @param hGrabber The handle to the grabber object.
  373. @param iProperty The property to be set. It can have following values:
  374. @li PROP_CAM_PAN
  375. @li PROP_CAM_TILT,
  376. @li PROP_CAM_ROLL,
  377. @li PROP_CAM_ZOOM,
  378. @li PROP_CAM_EXPOSURE,
  379. @li PROP_CAM_IRIS,
  380. @li PROP_CAM_FOCUS
  381. @param iOnOFF Enables or disables the automation. Possible values ar
  382. @li 1 : Enable automatic
  383. @li 0 : Disable Automatic
  384. @retval IC_SUCCESS on success
  385. @retval IC_ERROR if something went wrong.
  386. @note If the property is not supported by the current video capture device or
  387. automation of the property is not available with the current video capture
  388. device, the function returns 0. On success, the function returns 1.
  389. */
  390. int AC IC_EnableAutoCameraProperty( HGRABBER hGrabber, int iProperty, int iOnOff ); ///<Enables or disables property automation.
  391. int AC IC_IsCameraPropertyAutoAvailable( HGRABBER hGrabber, CAMERA_PROPERTY iProperty ); ///<Check whether automation for a camera property is available.
  392. int AC IC_GetAutoCameraProperty( HGRABBER hGrabber, int iProperty, int *iOnOff ); ///<Retrieve whether automatic is enabled for the specifield camera property.
  393. int AC IC_IsVideoPropertyAvailable( HGRABBER hGrabber, VIDEO_PROPERTY eProperty ); ///<Check whether the specified video property is available.
  394. int AC IC_VideoPropertyGetRange( HGRABBER hGrabber, VIDEO_PROPERTY eProperty, long *lMin, long *lMax); ///<Retrieve the lower and upper limit of a video property.
  395. int AC IC_GetVideoProperty( HGRABBER hGrabber, VIDEO_PROPERTY eProperty, long *lValue ); ///< Retrieve the the current value of the specified video property.
  396. int AC IC_IsVideoPropertyAutoAvailable( HGRABBER hGrabber, VIDEO_PROPERTY eProperty ); ///<Check whether the specified video property supports automation.
  397. int AC IC_GetAutoVideoProperty( HGRABBER hGrabber, int iProperty, int *iOnOff ); ///<Get the automation state of a video property.
  398. //////////////////////////////////////////////////////////////////////////
  399. /*! Set a video property like brightness, contrast.
  400. @param hGrabber The handle to the grabber object.
  401. @param eProperty The property to be set. It can have following values:
  402. @li PROP_VID_BRIGHTNESS ,
  403. @li PROP_VID_CONTRAST,
  404. @li PROP_VID_HUE,
  405. @li PROP_VID_SATURATION,
  406. @li PROP_VID_SHARPNESS,
  407. @li PROP_VID_GAMMA,
  408. @li PROP_VID_COLORENABLE,
  409. @li PROP_VID_WHITEBALANCE,
  410. @li PROP_VID_BLACKLIGHTCOMPENSATION,
  411. @li PROP_VID_GAIN
  412. @param lValue The value the property is to be set to.
  413. @retval IC_SUCCESS on success
  414. @retval IC_ERROR if something went wrong.
  415. @note lValue should be in the range of the specified property.
  416. If the value could not be set (out of range, auto is currently enabled), the
  417. function returns 0. On success, the functions returns 1.
  418. */
  419. int AC IC_SetVideoProperty( HGRABBER hGrabber, VIDEO_PROPERTY eProperty, long lValue ); ///<Set a video property.
  420. //////////////////////////////////////////////////////////////////////////
  421. /*! Enable or disable automatic for a video propertery.
  422. @param hGrabber The handle to the grabber object.
  423. @param iProperty The property to be set. It can have following values:
  424. @li PROP_VID_BRIGHTNESS,
  425. @li PROP_VID_CONTRAST,
  426. @li PROP_VID_HUE,
  427. @li PROP_VID_SATURATION,
  428. @li PROP_VID_SHARPNESS,
  429. @li PROP_VID_GAMMA,
  430. @li PROP_VID_COLORENABLE,
  431. @li PROP_VID_WHITEBALANCE,
  432. @li PROP_VID_BLACKLIGHTCOMPENSATION,
  433. @li PROP_VID_GAIN
  434. @param iOnOFF Enables or disables the automation. Possible values ar
  435. @li 1 : Enable automatic
  436. @li 0 : Disable Automatic
  437. @retval IC_SUCCESS on success
  438. @retval IC_ERROR if something went wrong.
  439. @note If the property is not supported by the current video capture device or
  440. automation of the property is not available with the current video capture
  441. device, the function reurns 0. On success, the function returns 1.
  442. */
  443. int AC IC_EnableAutoVideoProperty( HGRABBER hGrabber, int iProperty, int iOnOff ); ///< Switch automatition for a video property,
  444. //////////////////////////////////////////////////////////////////////////
  445. /*! Retrieve the properties of the current video format and sink type
  446. @param hGrabber The handle to the grabber object.
  447. @param *lWidth This recieves the width of the image buffer.
  448. @param *lHeight This recieves the height of the image buffer.
  449. @param *iBitsPerPixel This recieves the count of bits per pixel.
  450. @param *format This recieves the current color format.
  451. @retval IC_SUCCESS on success
  452. @retval IC_ERROR if something went wrong.
  453. */
  454. int AC IC_GetImageDescription( HGRABBER hGrabber, long *lWidth, long *lHeight, int *iBitsPerPixel, COLORFORMAT *format );///<Retrieve the properties of the current video format and sink typ.
  455. //////////////////////////////////////////////////////////////////////////
  456. /*! Snaps an image. The video capture device must be set to live mode and a
  457. sink type has to be set before this call. The format of the snapped images depend on
  458. the selected sink type.
  459. @param hGrabber The handle to the grabber object.
  460. @param iTimeOutMillisek The Timeout time is passed in milli seconds. A value of -1 indicates, that
  461. no time out is set.
  462. @retval IC_SUCCESS if an image has been snapped
  463. @retval IC_ERROR if something went wrong.
  464. @retval IC_NOT_IN_LIVEMODE if the live video has not been started.
  465. @sa IC_StartLive
  466. @sa IC_SetFormat
  467. */
  468. int AC IC_SnapImage( HGRABBER hGrabber, int iTimeOutMillisek); ///<Snaps an image from the live stream.
  469. //////////////////////////////////////////////////////////////////////////
  470. /*! Save the contents of the last snapped image by IC_SnapImage into a file.
  471. @param hGrabber The handle to the grabber object.
  472. @param szFileName String containing the file name to be saved to.
  473. @param ft File type if the image, It have be
  474. @li FILETYPE_BMP for bitmap files
  475. @li FILETYPE_JPEG for JPEG file.
  476. @param quality If the JPEG format is used, the image quality must be specified in a range from 0 to 100.
  477. @retval IC_SUCCESS if an image has been snapped
  478. @retval IC_ERROR if something went wrong.
  479. @remarks
  480. The format of the saved images depend on the sink type. If the sink type
  481. is set to Y800, the saved image will be an 8 Bit grayscale image. In any
  482. other case the saved image will be a 24 Bit RGB image.
  483. @note IC Imaging Control 1.41 only supports FILETYPE_BMP.
  484. @sa IC_SnapImage
  485. @sa IC_SetFormat
  486. */
  487. int AC IC_SaveImage( HGRABBER hGrabber, char *szFileName, IMG_FILETYPE ft, long quality ); ///< Saves an image to a file.
  488. //////////////////////////////////////////////////////////////////////////
  489. /*! Retrieve a byte pointer to the image data (pixel data) of the last snapped
  490. image (see SnapImage()). If the function fails, the return value is NULL
  491. otherwise the value is a pointer to the first byte in the lowest image line
  492. (the image is saved bottom up!).
  493. @param hGrabber The handle to the grabber object.
  494. @retval Nonnull Pointer to the image data
  495. @retval NULL Indicates that an error occurred.
  496. @sa IC_SnapImage
  497. @sa IC_SetFormat
  498. */
  499. unsigned char* AC IC_GetImagePtr( HGRABBER hGrabber ); ///< Retuns a pointer to the image data
  500. //////////////////////////////////////////////////////////////////////////
  501. /*! Assign an Window handle to display the video in.
  502. @param hGrabber The handle to the grabber object.
  503. @param hWnd The handle of the window where to display the live video in.
  504. @retval IC_SUCCESS if an image has been snapped
  505. @retval IC_ERROR if something went wrong.
  506. */
  507. int AC IC_SetHWnd( HGRABBER hGrabber, __HWND hWnd ); ///< Sets a window handle for live display
  508. //////////////////////////////////////////////////////////////////////////
  509. /*! Return the serialnumber of the current device. Memory for the serialnumber
  510. must has been allocated by the application:
  511. @code
  512. char szSerial[20];
  513. GetSerialNumber( hGrabber, szSerial );
  514. @endcode
  515. This function decodes the The Imaging Source serialnumbers.
  516. @param hGrabber The handle to the grabber object.
  517. @param szSerial char array that recieves the serial number.
  518. @retval IC_SUCCESS The serial number could be retrieved.
  519. @retval IC_IC_NOT_AVAILABLE The video capture device does not provide a serial number.
  520. @retval IC_NO_DEVICE No video capture device opened-
  521. @retval IC_NO_HANDLE hGrabber is NULL.
  522. */
  523. int AC IC_GetSerialNumber( HGRABBER hGrabber, char* szSerial );///<Return the video capture device's serial number.
  524. //////////////////////////////////////////////////////////////////////////
  525. /*! Count all connected video capture devices. If the Parameter szDeviceList
  526. is NULL, only the number of devices is queried. The Parameter szDeviceList
  527. must be a two dimensional array of char. The iSize parameter specifies the
  528. length of the strings, that are used in the array.
  529. @param szDeviceList A two dimensional char array that recieves the list. Or NULL if only the count of devices is to be returned.
  530. @param iSize Not used.
  531. @retval >= 0 Success, count of found devices
  532. @retval <0 An error occurred.
  533. Simple sample to list the video capture devices:
  534. @code
  535. char szDeviceList[20][40];
  536. int iDeviceCount;
  537. iDeviceCount = IC_ListDevices( (char*)szDeviceList,40 );
  538. for( i = 0; i < iDeviceCount; i++ )
  539. {
  540. printf("%2d. %s\n",i+1,szDeviceList[i]);
  541. }
  542. @endcode
  543. */
  544. int AC IC_ListDevices( char *szDeviceList, int iSize );///< Count and list devices.
  545. //////////////////////////////////////////////////////////////////////////
  546. /*! Simpler approach of enumerating devices. No 2D char array needed
  547. @code
  548. char szDeviceName[40]; // Use max 39 chars for a device name
  549. int iDeviceCount;
  550. iDeviceCount = IC_GetDeviceCount(); // Query number of connected devices
  551. for( i = 0; i < iDeviceCount; i++ )
  552. {
  553. IC_ListDevicesbyIndex(szDeviceName,39, i);
  554. printf("%2d. %s\n",i+1,szDeviceName);
  555. }
  556. @endcode
  557. @param szDeviceName Char memory, that receives the device name
  558. @param iSize Size of the char memory. If names are longer, they will be truncated.
  559. @param DeviceIndex Index of the device to be query. Must be between 0 and IC_GetDeviceCount.
  560. @retval >= 0 Success, count of found devices
  561. @retval <0 An error occurred.
  562. */
  563. int AC IC_ListDevicesbyIndex( char *szDeviceName, int iSize, int DeviceIndex );
  564. //////////////////////////////////////////////////////////////////////////
  565. /*! Count all available video formats. If the Parameter szFormatList
  566. is NULL, only the number of formats is queried. The Parameter szFormatList
  567. must be a two dimensional array of char. The iSize parameter specifies the
  568. length of the strings, that are used in the array to store the format names.
  569. @param hGrabber The handle to the grabber object.
  570. @param szFormatList A two dimensional char array that recieves the list. Or NULL if only the count of formats is to be returned.
  571. @retval >= 0 Success, count of found video formats
  572. @retval <0 An error occurred.
  573. Simple sample to list the video capture devices:
  574. @code
  575. char szFormatList[80][40];
  576. int iFormatCount;
  577. HGRABBER hGrabber;
  578. hGrabber = IC_CreateGrabber();
  579. IC_OpenVideoCaptureDevice(hGrabber, "DFK 21F04" );
  580. iFormatCount = IC_ListDevices(hGrabber, (char*)szFormatList,40 );
  581. for( i = 0; i < min( iFormatCount, 80); i++ )
  582. {
  583. printf("%2d. %s\n",i+1,szFormatList[i]);
  584. }
  585. IC_ReleaseGrabber( hGrabber );
  586. @endcode
  587. */
  588. int AC IC_ListVideoFormats( HGRABBER hGrabber, char *szFormatList, int iSize );///<List available video formats.
  589. //////////////////////////////////////////////////////////////////////////
  590. /*! Simpler approach of enumerating video formats. No 2D char array needed.
  591. @param hGrabber The handle to the grabber object.
  592. @param szFormatName char memory, that will receive the name of the video format. Should be big enough.
  593. @param iSize Size in byte of szFormatName
  594. @iIndex Index of the video format to query.
  595. @code
  596. char szVideoFormatName[40]; // Use max 39 chars for a video format name
  597. int FormatCount;
  598. HGRABBER hGrabber;
  599. hGrabber = IC_CreateGrabber();
  600. IC_OpenVideoCaptureDevice(hGrabber, "DFK 21AU04" );
  601. FormatCount = IC_GetVideoFormatCount(hGrabber); // Query number of connected devices
  602. for( i = 0; i < FormatCount; i++ )
  603. {
  604. IC_ListVideoFormatbyIndex(szVideoFormatName,39, i);
  605. printf("%2d. %s\n",i+1,szVideoFormatName);
  606. }
  607. @endcode
  608. @param szDeviceName Char memory, that receives the device name
  609. @param iSize Size of the char memory. If names are longer, they will be truncated.
  610. @param DeviceIndex Index of the device to be query. Must be between 0 and IC_GetDeviceCount.
  611. @retval IC_SUCCESS Success,
  612. @retval IC_NO_DEVICE No video capture device selected.
  613. @retval IC_NO_HANDLE No handle to the grabber object.
  614. */
  615. int AC IC_ListVideoFormatbyIndex( HGRABBER hGrabber, char *szFormatName, int iSize, int iIndex);
  616. //////////////////////////////////////////////////////////////////////////
  617. /*! Get the number of the currently available devices. This function creates an
  618. internal array of all connected video capture devices. With each call to this
  619. function, this array is rebuild. The name and the unique name can be retrieved
  620. from the internal array using the functions IC_GetDevice() and IC_GetUniqueNamefromList.
  621. They are usefull for retrieving device names for opening devices.
  622. @retval >= 0 Success, count of found devices.
  623. @retval IC_NO_HANDLE Internal Error.
  624. @sa IC_GetDevice
  625. @sa IC_GetUniqueNamefromList
  626. */
  627. int AC IC_GetDeviceCount(); ///<Get the number of the currently available devices.
  628. //////////////////////////////////////////////////////////////////////////
  629. /*! Get a string representation of a device specified by iIndex. iIndex
  630. must be between 0 and IC_GetDeviceCount(). IC_GetDeviceCount() must
  631. have been called before this function, otherwise it will always fail.
  632. @param iIndex The number of the device whose name is to be returned. It must be
  633. in the range from 0 to IC_GetDeviceCount(),
  634. @return Returns the string representation of the device on success, NULL
  635. otherwise.
  636. @sa IC_GetDeviceCount
  637. @sa IC_GetUniqueNamefromList
  638. */
  639. char* AC IC_GetDevice( int iIndex ); ///< Get the name of a video capture device.
  640. //////////////////////////////////////////////////////////////////////////
  641. /*! Get unique device name of a device specified by iIndex. The unique device name
  642. consist from the device name and its serial number. It allows to differ between
  643. more then one device of the same type connected to the computer. The unique device name
  644. is passed to the function IC_OpenDevByUniqueName
  645. @param iIndex The number of the device whose name is to be returned. It must be
  646. in the range from 0 to IC_GetDeviceCount(),
  647. @return Returns the string representation of the device on success, NULL
  648. otherwise.
  649. @sa IC_GetDeviceCount
  650. @sa IC_GetUniqueNamefromList
  651. @sa IC_OpenDevByUniqueName
  652. */
  653. char* AC IC_GetUniqueNamefromList( int iIndex );///< Get the unique name of a video capture device.
  654. //////////////////////////////////////////////////////////////////////////
  655. /*! Get the number of the available input channels for the current device.
  656. A video capture device must have been opened before this call.
  657. @param hGrabber The handle to the grabber object.
  658. @retval >= 0 Success
  659. @retval IC_NO_DEVICE No video capture device selected.
  660. @retval IC_NO_HANDLE No handle to the grabber object.
  661. @sa IC_GetInputChannel
  662. */
  663. int AC IC_GetInputChannelCount( HGRABBER hGrabber ); ///<Get the number of the available input channels.
  664. //////////////////////////////////////////////////////////////////////////
  665. /*! Get a string representation of the input channel specified by iIndex.
  666. iIndex must be between 0 and IC_GetInputChannelCount().
  667. IC_GetInputChannelCount() must have been called before this function,
  668. otherwise it will always fail.
  669. @param hGrabber The handle to the grabber object.
  670. @param iIndex Number of the input channel to be used..
  671. @retval Nonnull The name of the specified input channel
  672. @retval NULL An error occured.
  673. @sa IC_GetInputChannelCount
  674. */
  675. char* AC IC_GetInputChannel( HGRABBER hGrabber, int iIndex ); ///<Get the name of an input channel.
  676. //////////////////////////////////////////////////////////////////////////
  677. /*! Get the number of the available video norms for the current device.
  678. A video capture device must have been opened before this call.
  679. @param hGrabber The handle to the grabber object.
  680. @retval >= 0 Success
  681. @retval IC_NO_DEVICE No video capture device selected.
  682. @retval IC_NO_HANDLE No handle to the grabber object.
  683. @sa IC_GetVideoNorm
  684. */
  685. int AC IC_GetVideoNormCount( HGRABBER hGrabber ); ///<Get the count of available video norms.
  686. //////////////////////////////////////////////////////////////////////////
  687. /*! Get a string representation of the video norm specified by iIndex.
  688. iIndex must be between 0 and IC_GetVideoNormCount().
  689. IC_GetVideoNormCount() must have been called before this function,
  690. otherwise it will always fail.
  691. @param hGrabber The handle to the grabber object.
  692. @param iIndex Number of the video norm to be used.
  693. @retval Nonnull The name of the specified video norm.
  694. @retval NULL An error occured.
  695. @sa IC_GetVideoNormCount
  696. */
  697. char* AC IC_GetVideoNorm( HGRABBER hGrabber, int iIndex ); ///<Get the name of a video norm.
  698. //////////////////////////////////////////////////////////////////////////
  699. /*! Get the number of the available video formats for the current device.
  700. A video capture device must have been opened before this call.
  701. @param hGrabber The handle to the grabber object.
  702. @retval >= 0 Success
  703. @retval IC_NO_DEVICE No video capture device selected.
  704. @retval IC_NO_HANDLE No handle to the grabber object.
  705. @sa IC_GetVideoFormat
  706. */
  707. int AC IC_GetVideoFormatCount( HGRABBER hGrabber ); ///< Returns the count of available video formats.
  708. //////////////////////////////////////////////////////////////////////////
  709. /*! Get a string representation of the video format specified by iIndex.
  710. iIndex must be between 0 and IC_GetVideoFormatCount().
  711. IC_GetVideoFormatCount() must have been called before this function,
  712. otherwise it will always fail.
  713. @param hGrabber The handle to the grabber object.
  714. @param iIndex Number of the video format to be used.
  715. @retval Nonnull The name of the specified video format.
  716. @retval NULL An error occured.
  717. @sa IC_GetVideoFormatCount
  718. */
  719. char* AC IC_GetVideoFormat( HGRABBER hGrabber, int iIndex ); ///<Return the name of a video format.
  720. //////////////////////////////////////////////////////////////////////////
  721. /*! Save the state of a video capture device to a file.
  722. @param hGrabber The handle to the grabber object.
  723. @param szFileName Name of the file where to save to.
  724. @retval IC_SUCCESS if an image has been snapped
  725. @retval IC_ERROR if something went wrong.
  726. @sa IC_LoadDeviceStateFromFile
  727. */
  728. int AC IC_SaveDeviceStateToFile(HGRABBER hGrabber, char* szFileName);///<Save the state of a video capture device to a file.
  729. //////////////////////////////////////////////////////////////////////////
  730. /*! Load a device settings file. On success the device is opened automatically.
  731. @param hGrabber The handle to the grabber object. If it is NULL then a new HGRABBER handle is
  732. created. This should be released by a call to IC_ReleaseGrabber when it is no longer needed.
  733. @param szFileName Name of the file where to save to.
  734. @return HGRABBER The handle of the grabber object, that contains the new opened video capture device.
  735. @sa IC_SaveDeviceStateToFile
  736. @sa IC_ReleaseGrabber
  737. */
  738. HGRABBER AC IC_LoadDeviceStateFromFile(HGRABBER hGrabber, char* szFileName); ///<Load a device settings file.
  739. //////////////////////////////////////////////////////////////////////////
  740. /*! Load a device settings file.
  741. @param hGrabber The handle to the grabber object. If it is NULL then a new HGRABBER handle is
  742. created, in case OpenDevice is true. If OpenDevice is set to false, the a device must be already
  743. open in the grabber handle. The properties in the passed XML file will be apllied to
  744. the opened device.
  745. This should be released by a call to IC_ReleaseGrabber when it is no longer needed.
  746. @param szFileName Name of the file where to save to.
  747. @param OpenDevice If 1, the device specified in the XML file is opened. If 0, then a device must be opened in the hGrabber.
  748. The properties and video format specified in the XML file will be applied to the opened device.
  749. @return IC_SUCCESS The device was successfully opened and the settings saved in the XML file were set.
  750. @return IC_NO_DEVICE False was passed to OpenDevice, but no device was opened in the grabber handle or the handle is NULL
  751. @return IC_WRONG_XML_FORMAT No device opened.
  752. @return IC_WRONG_INCOMPATIBLE_XML No device opened.
  753. @return IC_DEVICE_NOT_FOUND No device opened.
  754. @return IC_FILE_NOT_FOUND Passed XML file does not exist.
  755. @return IC_NOT_ALL_PROPERTIES_RESTORED The device was opened, but not all properties could be set as wanted.
  756. @sa IC_SaveDeviceStateToFile
  757. @sa IC_ReleaseGrabber
  758. */
  759. int AC IC_LoadDeviceStateFromFileEx(HGRABBER hGrabber, char* szFileName, int OpenDevice); ///<Load a device settings file.
  760. //////////////////////////////////////////////////////////////////////////
  761. /*! Save the device settings to a file specified by szFilename. When used
  762. with IC Imaging Control 1.41 the device name, the input channel, the
  763. video norm and the video format are saved. When used with IC Imaging
  764. Control 2.0, the VCDProperties are saved as well. Returns 1 on success,
  765. 0 otherwise.
  766. Notice that in IC Imaging Control 1.41 the device name includes the trailing
  767. number if there is more than one device of the same type available. This can
  768. cause IC_OpenDeviceBySettings() to fail if one of those devices is unplugged.
  769. When used with IC Imaging Control 2.0, this cannot happen because the device
  770. name is stored without the trailing number. Instead the first device that
  771. matches the type specified in the settings file is opened.
  772. @deprecated Use IC_SaveDeviceStateToFile instead.
  773. */
  774. int AC IC_SaveDeviceSettings( HGRABBER hGrabber, char* szFilename );
  775. //////////////////////////////////////////////////////////////////////////
  776. /*! Open a device by a settings file specified by szFilename. If succedeed,
  777. 1 is returned and a device specified in the settings file is opened and
  778. initialized with the settings data. If failed, 0 is returned.
  779. @deprecated Use IC_LoadDeviceStateFromFile instead.
  780. */
  781. int AC IC_OpenDeviceBySettings( HGRABBER hGrabber, char* szFilename );
  782. //////////////////////////////////////////////////////////////////////////
  783. /*! Load device settings from a file specified by szFilename. A device must
  784. have been opened before this function is called. A check is performed whether
  785. the current device matches the device type stored in the settings file.
  786. If so, the settings are loaded and set.
  787. Returns 1 on success, 0 otherwise.
  788. Notice: This function will only work with IC Imaging Control 2.0. When used
  789. with IC Imaging Control 1.41, it will always return 0.
  790. @deprecated Use IC_LoadDeviceStateFromFile instead.
  791. */
  792. int AC IC_LoadDeviceSettings( HGRABBER hGrabber, char* szFilename );
  793. //////////////////////////////////////////////////////////////////////////
  794. /*! Open a video capture by using its DisplayName.
  795. @param hGrabber The handle to the grabber object.
  796. @param szDisplayname Displayname of the device. Can be retrieved by a call to IC_GetDisplayName().
  797. @retval IC_SUCCESS if an image has been snapped
  798. @retval IC_ERROR if something went wrong.
  799. @sa IC_GetDisplayName
  800. */
  801. int AC IC_OpenDevByDisplayName( HGRABBER hGrabber, char *szDisplayname); ///<Open a video capture by using its DisplayName.
  802. //////////////////////////////////////////////////////////////////////////
  803. /*! Get a DisplayName from a currently open device. The display name of a
  804. device can be another on different computer for the same video capture
  805. device.
  806. @param hGrabber Handle to a grabber object
  807. @param szDisplayName Memory that will take the display name. If it is NULL, the
  808. length of the display name will be returned.
  809. @param iLen Size in Bytes of the memory allocated by szDisplayName.
  810. @retval IC_SUCCESS On success. szDisplayName contains the display name of the device.
  811. @retval IC_ERROR iLen is less than the length of the retrieved display name.
  812. @retval IC_NO_HANDLE hGrabber is not a valid handle. GetGrabber was not called.
  813. @retval IC_NO_DEVICE No device opened. Open a device, before this function can be used.
  814. @retval >1 Length of the display name, if szDisplayName is NULL.
  815. @sa IC_OpenDevByDisplayName
  816. @sa IC_ReleaseGrabber
  817. */
  818. int AC IC_GetDisplayName( HGRABBER hGrabber, char *szDisplayname, int iLen); ///<Get the display name of a device.
  819. //////////////////////////////////////////////////////////////////////////
  820. /*! Open a video capture by using its UniqueName. Use IC_GetUniqueName() to
  821. retrieve the unique name of a camera.
  822. @param hGrabber Handle to a grabber object
  823. @param szDisplayName Memory that will take the display name.
  824. @sa IC_GetUniqueName
  825. @sa IC_ReleaseGrabber
  826. */
  827. int AC IC_OpenDevByUniqueName( HGRABBER hGrabber, char *szDisplayname);
  828. //////////////////////////////////////////////////////////////////////////
  829. /*! Get a UniqueName from a currently open device.
  830. @param hGrabber Handle to a grabber object
  831. @param szUniqueName Memory that will take the Unique name. If it is NULL, the
  832. length of the Unique name will be returned.
  833. @param iLen Size in Bytes of the memory allocated by szUniqueName.
  834. @retval IC_SUCCESS On success. szUniqueName contains the Unique name of the device.
  835. @retval IC_ERROR iLen is less than the length of the retrieved Unique name.
  836. @retval IC_NO_HANDLE hGrabber is not a valid handle. GetGrabber was not called.
  837. @retval IC_NO_DEVICE No device opened. Open a device, before this function can be used.
  838. @retval >1 Length of the Unique name, if szUniqueName is NULL.
  839. */
  840. int AC IC_GetUniqueName( HGRABBER hGrabber, char *szUniquename, int iLen); ///<Get a UniqueName from a currently open device.
  841. //////////////////////////////////////////////////////////////////////////
  842. /*! This returns 1, if a valid device has been opened, otherwise it is 0.
  843. @param hGrabber Handle to a grabber object.
  844. @retval IC_ERROR There is no valid video capture device opened
  845. @retval IC_SUCCESS There is a valid video capture device openend.
  846. */
  847. int AC IC_IsDevValid( HGRABBER hGrabber); ///<Returns whether a video capture device is valid.
  848. //////////////////////////////////////////////////////////////////////////
  849. /*! Show the VCDProperty dialog.
  850. @param hGrabber Handle to a grabber object.
  851. @retval IC_SUCCESS on success
  852. @retval IC_ERROR on error.
  853. @retval IC_NO_DEVICE No video capture device selected.
  854. @retval IC_NO_HANDLE Nullpointer.
  855. */
  856. int AC IC_ShowPropertyDialog( HGRABBER hGrabber ); ///<Show the VCDProperty dialog.
  857. //////////////////////////////////////////////////////////////////////////
  858. /*! Show the device selection dialog. This dialogs enables to select the
  859. video capture device, the video norm, video format, input channel and
  860. frame rate.
  861. @param hGrabber Handle to a grabber object.
  862. @return The passed hGrabber object or a new created if hGrabber was NULL.
  863. @code
  864. HGRABBER hTheGrabber;
  865. hTheGrabber = IC_ShowDeviceSelectionDialog( NULL );
  866. if( hTheGrabber != NULL )
  867. {
  868. IC_StartLive( hTheGrabber, 1 ); // Show the live video of this grabber
  869. IC_ShowPropertyDialog( hTheGrabber ); // Show the property page of this grabber
  870. }
  871. @endcode
  872. */
  873. HGRABBER AC IC_ShowDeviceSelectionDialog( HGRABBER hGrabber ); ///<Show the device selection dialog.
  874. //////////////////////////////////////////////////////////////////////////
  875. /*!
  876. Return whether the current video capture device supports an external
  877. trigger.
  878. @param hGrabber Handle to a grabber object.
  879. @retval IC_SUCCESS An external trigger is supported
  880. @retval IC_ERROR No external trigger is supported.
  881. @retval IC_NO_DEVICE No video capture device selected.
  882. @retval IC_NO_HANDLE Internal Grabber does not exist.
  883. @sa IC_EnableTrigger
  884. */
  885. int AC IC_IsTriggerAvailable( HGRABBER hGrabber ); ///<Check for external trigger support.
  886. //////////////////////////////////////////////////////////////////////////
  887. /*! Enable or disable the external trigger.
  888. @param hGrabber Handle to a grabber object.
  889. @param iEnable 1 = enable the trigger, 0 = disable the trigger
  890. @retval IC_SUCCESS Trigger was enabled or disabled successfully.
  891. @retval IC_NOT_AVAILABLE The device does not support triggering.
  892. @retval IC_NO_PROPERTYSET Failed to query the property set of the device.
  893. @retval IC_NO_DEVICE No video capture device selected.
  894. @retval IC_NO_HANDLE Internal Grabber does not exist or hGrabber is NULL.
  895. @sa IC_IsTriggerAvailable
  896. */
  897. int AC IC_EnableTrigger( HGRABBER hGrabber, int iEnable );
  898. //////////////////////////////////////////////////////////////////////////
  899. /*! Remove or insert the the overlay bitmap to the grabber object. If
  900. Y16 format is used, the overlay must be removed,
  901. @param hGrabber Handle to a grabber object.
  902. @param iEnable = 1 inserts overlay, 0 removes the overlay.
  903. */
  904. void AC IC_RemoveOverlay( HGRABBER hGrabber, int iEnable );
  905. //////////////////////////////////////////////////////////////////////////
  906. /*! Enable or disable the overlay bitmap on the live video
  907. @param hGrabber Handle to a grabber object.
  908. @param iEnable = 1 enables the overlay, 0 disables the overlay.
  909. */
  910. void AC IC_EnableOverlay( HGRABBER hGrabber, int iEnable ); ///<Enable or disable the overlay bitmap.
  911. //////////////////////////////////////////////////////////////////////////
  912. /*! BeginPaint returns an HDC for GDI painting purposes (like TextOut() etc.)
  913. When the paintings are finished, the function IC_EndPaint must be called.
  914. @param hGrabber Handle to a grabber object.
  915. @return HDC The function returns not NULL, if the HDC could be retrieved. If the HDC
  916. could not be retrieved or an error has occured, the function returns 0.
  917. Sample code:
  918. @code
  919. HDC hPaintDC;
  920. hPaintDC = IC_BeginPaint(hGrabber);
  921. if( hPaintDC != NULL )
  922. {
  923. TextOut( hPaintDC,10,10,"Text",4);
  924. }
  925. IC_EndPaint(hGrabber)
  926. @endcode
  927. @sa IC_EndPaint
  928. */
  929. long AC IC_BeginPaint( HGRABBER hGrabber ); ///< BeginPaint returns an HDC for GDI painting purposes.
  930. //////////////////////////////////////////////////////////////////////////
  931. /*! The EndPaint functions must be called, after BeginPaint has been called,
  932. and the painting operations have been finished.
  933. @param hGrabber Handle to a grabber object.
  934. @sa IC_BeginPaint
  935. */
  936. void AC IC_EndPaint( HGRABBER hGrabber ); ///< End painting functions on the overlay bitmap.
  937. //////////////////////////////////////////////////////////////////////////
  938. /*! Display a windows messagebox.
  939. @param szText Message text
  940. @param zsTitle Title of the messagebox.
  941. */
  942. void AC IC_MsgBox( char * szText, char* szTitle ); ///<Display a windows messagebox.
  943. //////////////////////////////////////////////////////////////////////////
  944. /*! Type declaration for the frame ready callback function.
  945. @sa IC_SetFrameReadyCallback
  946. @sa IC_SetCallbacks
  947. @retval IC_SUCCESS Callback was set successfully
  948. @retval IC_ERROR An error occurred, e.g. hGrabber is NULL.
  949. */
  950. typedef void (*FRAME_READY_CALLBACK)
  951. (HGRABBER hGrabber, unsigned char* pData, unsigned long frameNumber, void* );
  952. //////////////////////////////////////////////////////////////////////////
  953. /*! Type declaration for the device lost callback function.
  954. @sa IC_SetCallbacks
  955. */
  956. typedef void (*DEVICE_LOST_CALLBACK)(HGRABBER hGrabber, void* );
  957. //////////////////////////////////////////////////////////////////////////
  958. /*! Enable frame ready callback.
  959. @param hGrabber Handle to a grabber object.
  960. @param cb Callback function of type FRAME_READY_CALLBACK
  961. @param x1_argument_in_void_userdata Pointer to some userdata.
  962. @retval IC_SUCCESS Callback was set successfully
  963. @retval IC_ERROR An error occurred, e.g. hGrabber is NULL.
  964. @sa FRAME_READY_CALLBACK
  965. */
  966. int AC IC_SetFrameReadyCallback(
  967. HGRABBER hGrabber,
  968. FRAME_READY_CALLBACK cb,
  969. void* x1_argument_in_void_userdata);
  970. /*! Set callback function
  971. @param hGrabber Handle to a grabber object.
  972. @param cb Callback function of type FRAME_READY_CALLBACK, can be NULL, if no callback is needed
  973. @param dlcb Callback function of type DEVICE:LOST_CALLBACK, can be NULL, if no device lost handler is needed
  974. @param x1_argument_in_void_userdata Pointer to some userdata.
  975. @sa FRAME_READY_CALLBACK
  976. */
  977. int AC IC_SetCallbacks(
  978. HGRABBER hGrabber,
  979. FRAME_READY_CALLBACK cb,
  980. void* x1_argument_in_void_userdata,
  981. DEVICE_LOST_CALLBACK dlCB,
  982. void* x2_argument_in_void_userdata);
  983. /////////////////////////////////////////////////////////////////////////
  984. /*! Set Continuous mode
  985. In continuous mode, the callback is called for each frame,
  986. so that there is no need to use IC_SnapImage etc.
  987. @param hGrabber Handle to a grabber object.
  988. @param cont 0 : Snap continouos, 1 : do not automatically snap.
  989. @retval IC_SUCCESS Success
  990. @retval IC_NOT_IN_LIVEMODE The device is currently streaming, therefore setting continuous mode failed.
  991. @retval IC_NO_HANDLE Internal Grabber does not exist or hGrabber is NULL
  992. @remarks
  993. Not available in live mode.
  994. */
  995. int AC IC_SetContinuousMode( HGRABBER hGrabber, int cont ); ///<Set Continuous mode.
  996. //////////////////////////////////////////////////////////////////////////
  997. /*! SignalDetected
  998. Detects whether a video signal is available.
  999. @param hGrabber Handle to a grabber object.
  1000. @retval IC_SUCCESS Signal detected
  1001. @retval IC_ERROR No video signal detected
  1002. @retval IC_NO_HANDLE Invalid grabber handle
  1003. @retval IC_NO_DEVICE No video capture device opened
  1004. @retval IC_NOT_IN_LIVEMODE No live mode, startlive was not called
  1005. */
  1006. int AC IC_SignalDetected( HGRABBER hGrabber ); ///<Detects whether a video signal is available.
  1007. //////////////////////////////////////////////////////////////////////////
  1008. /*! Get trigger modes.
  1009. Simple sample to list the video capture devices:
  1010. @param hGrabber Handle to a grabber object.
  1011. @param szModeList Twodimensional array of char that will recieve the mode list.
  1012. @param iSze Size of the array (first dimension)
  1013. @retval 0 : No trigger modes available
  1014. @retval >0 : Count of available trigger modes
  1015. @retval IC_NO_HANDLE Invalid grabber handle
  1016. @retval IC_NO_DEVICE No video capture device opened
  1017. @code
  1018. char szModes[20][10];
  1019. int iModeCount;
  1020. iModeCount = IC_GetTriggerModes(hGrabber, (char*)szModes,20);
  1021. for( int i = 0; i < min( iModeCount, 20); i++ )
  1022. {
  1023. printf("%2d. %s\n",i+1,szModes[i]);
  1024. }
  1025. @endcode
  1026. */
  1027. int AC IC_GetTriggerModes( HGRABBER hGrabber, char *szModeList, int iSize ); ///<Get trigger modes.
  1028. //////////////////////////////////////////////////////////////////////////
  1029. /*! Set the trigger mode.
  1030. Sets the mode that has been retrieved by a call to IC_GetTriggerModes.
  1031. @param hGrabber Handle to a grabber object.
  1032. @param szMode String containing the name of the mode.
  1033. @retval IC_SUCCESS Success.
  1034. @retval IC_NOT_AVAILABLE Triggermode is not supported by the current device.
  1035. @retval IC_ERROR An error occurred
  1036. @retval IC_NO_HANDLE Invalid grabber handle
  1037. @retval IC_NO_DEVICE No video capture device opened
  1038. */
  1039. int AC IC_SetTriggerMode( HGRABBER hGrabber, char* szMode ); ///<Set the trigger mode.
  1040. //////////////////////////////////////////////////////////////////////////
  1041. /*! Set the trigger polarity
  1042. Sample:
  1043. @code
  1044. IC_SetTriggerPolarity(hGrabber, 0);
  1045. @endcode
  1046. or
  1047. @code
  1048. IC_SetTriggerPolarity(hGrabber, 1);
  1049. @endcode
  1050. @param hGrabber Handle to a grabber object.
  1051. @param iPolarity
  1052. @li 0 : Polarity on direction
  1053. @li 1 : Polarity the other direction
  1054. @retval IC SUCCESS : Polarity could be set successfully
  1055. @retval IC_NOT_AVAILABLE Triggerpolarity is not supported by the current device.
  1056. @retval IC_NO_HANDLE Invalid grabber handle
  1057. @retval IC_NO_DEVICE No video capture device opened
  1058. */
  1059. int AC IC_SetTriggerPolarity( HGRABBER hGrabber, int iPolarity ); ///< Set the trigger polarity.
  1060. int AC IC_GetExpRegValRange( HGRABBER hGrabber, long *lMin, long *lMax ); ///< Retrieve exposure register values lower and upper limits.
  1061. int AC IC_GetExpRegVal( HGRABBER hGrabber, long *lValue ); ///< Retrieve the current register value of exposure.
  1062. int AC IC_SetExpRegVal( HGRABBER hGrabber, long lValue ); ///<Set a register value for exposure.
  1063. int AC IC_EnableExpRegValAuto( HGRABBER hGrabber, int iOnOff ); ///<Enable or disable automatic of exposure.
  1064. int AC IC_GetExpRegValAuto( HGRABBER hGrabber, int *iOnOff );///<Check whether automatic exposure is enabled.
  1065. //////////////////////////////////////////////////////////////////////////
  1066. /*! Functions for the absolute values interface of exposure.
  1067. */
  1068. int AC IC_IsExpAbsValAvailable( HGRABBER hGrabber);
  1069. int AC IC_GetExpAbsValRange(HGRABBER hGrabber, float *fMin, float *fMax);
  1070. int AC IC_GetExpAbsVal(HGRABBER hGrabber, float *fValue);
  1071. int AC IC_SetExpAbsVal(HGRABBER hGrabber, float fValue );
  1072. ///////////////////////////////////////////////////////////////////
  1073. /*! Gets the current value of Colorenhancement property
  1074. Sample:
  1075. @code
  1076. int OnOFF
  1077. IC_GetColorEnhancement(hGrabber, &OnOFF);
  1078. @endcode
  1079. @param hGrabber Handle to a grabber object.
  1080. @param OnOff
  1081. @li 0 : Color enhancement is off
  1082. @li 1 : Color enhancement is on
  1083. @retval IC_SUCCESS : Success
  1084. @retval IC_NOT:AVAILABLE : The property is not supported by the current device
  1085. @retval IC_NO_HANDLE Invalid grabber handle
  1086. @retval IC_NO_DEVICE No video capture device opened
  1087. */
  1088. int AC IC_GetColorEnhancement(HGRABBER hGrabber, int *OnOff);
  1089. ///////////////////////////////////////////////////////////////////
  1090. /*! Sets the value of Colorenhancement property
  1091. Sample:
  1092. @code
  1093. int OnOFF = 1
  1094. IC_GetColorEnhancement(hGrabber, OnOFF);
  1095. @endcode
  1096. @param hGrabber Handle to a grabber object.
  1097. @param OnOff
  1098. @li 0 : Color enhancement is off
  1099. @li 1 : Color enhancement is on
  1100. @retval IC_SUCCESS : Success
  1101. @retval IC_NOT:AVAILABLE : The property is not supported by the current device
  1102. @retval IC_NO_HANDLE Invalid grabber handle
  1103. @retval IC_NO_DEVICE No video capture device opened
  1104. */
  1105. int AC IC_SetColorEnhancement(HGRABBER hGrabber, int OnOff);
  1106. ///////////////////////////////////////////////////////////////////
  1107. /*! Sends a software trigger to the camera. The camera must support
  1108. external trigger. The external trigger has to be enabled previously
  1109. @param hGrabber Handle to a grabber object.
  1110. @retval IC_SUCCESS : Success
  1111. @retval IC_NOT:AVAILABLE : The property is not supported by the current device
  1112. @retval IC_NO_HANDLE Invalid grabber handle
  1113. @retval IC_NO_DEVICE No video capture device opened
  1114. @sa IC_EnableTrigger
  1115. */
  1116. int AC IC_SoftwareTrigger(HGRABBER hGrabber);
  1117. ///////////////////////////////////////////////////////////////////
  1118. /*! Sets a new frame rate.
  1119. @param hGrabber Handle to a grabber object.
  1120. @param FrameRate The new frame rate.
  1121. @retval IC_SUCCESS : Success
  1122. @retval IC_NOT_AVAILABLE : The property is not supported by the current device
  1123. @retval IC_NO_HANDLE Invalid grabber handle
  1124. @retval IC_NO_DEVICE No video capture device opened
  1125. @retval IC_NOT_IN_LIVEMODE Frame rate can not set, while live video is shown. Stop Live video first!
  1126. */
  1127. int AC IC_SetFrameRate(HGRABBER hGrabber,float FrameRate);
  1128. ///////////////////////////////////////////////////////////////////
  1129. /*! Retrieves the current frame rate
  1130. @param hGrabber Handle to a grabber object.
  1131. @retval The current frame rate. If it is 0.0, then frame rates are not supported.
  1132. */
  1133. float AC IC_GetFrameRate(HGRABBER hGrabber);
  1134. ///////////////////////////////////////////////////////////////////
  1135. /*! Retrieves available frame rates.
  1136. The count of available frame rates depends on the used video capture
  1137. device and the currently used video format. After a video was changed,
  1138. the available frame rates usually are changed by the video capture device
  1139. too.
  1140. @code
  1141. int Index = 0;
  1142. float fps = 0.0f;
  1143. while( IC_GetAvailableFrameRates(hGrabber, Index, &fps ) == IC_SUCCESS )
  1144. {
  1145. printf("Frame rate %d : %f fps\n", Index, fps);
  1146. Index++;
  1147. }
  1148. @endcode
  1149. @param hGrabber Handle to a grabber object.
  1150. @param Index Index of the frame rates, starting at 0
  1151. @param fps Pointer to a float variable, that will receive the frame rate of the passed index.
  1152. @retval IC_SUCCESS, if the frame rate at Index exists, otherwise IC_ERROR,
  1153. */
  1154. int AC IC_GetAvailableFrameRates(HGRABBER hGrabber, int Index, float *fps);
  1155. int AC IC_SetWhiteBalanceAuto( HGRABBER hGrabber, int iOnOff);
  1156. ///////////////////////////////////////////////////////////////////
  1157. /*! Sets the value for white balance red.
  1158. @param hGrabber Handle to a grabber object.
  1159. @param Value Value of the red white balance to be set
  1160. @retval IC_SUCCESS : Success
  1161. @retval IC_NO_HANDLE : Invalid grabber handle
  1162. @retval IC_NO_DEVICE : No video capture device opened
  1163. @retval IC_NOT_AVAILABLE : The property is not supported by the current device
  1164. */
  1165. int AC IC_SetWhiteBalanceRed(HGRABBER hGrabber, long Value);
  1166. ///////////////////////////////////////////////////////////////////
  1167. /*! Sets the value for white balance green.
  1168. @param hGrabber Handle to a grabber object.
  1169. @param Value Value of the green white balance to be set
  1170. @retval IC_SUCCESS : Success
  1171. @retval IC_NO_HANDLE : Invalid grabber handle
  1172. @retval IC_NO_DEVICE : No video capture device opened
  1173. @retval IC_NOT_AVAILABLE : The property is not supported by the current device
  1174. */
  1175. int AC IC_SetWhiteBalanceGreen(HGRABBER hGrabber, long Value);
  1176. ///////////////////////////////////////////////////////////////////
  1177. /*! Sets the value for white balance blue.
  1178. @param hGrabber Handle to a grabber object.
  1179. @param Value Value of the blue white balance to be set
  1180. @retval IC_SUCCESS : Success
  1181. @retval IC_NO_HANDLE : Invalid grabber handle
  1182. @retval IC_NO_DEVICE : No video capture device opened
  1183. @retval IC_NOT_AVAILABLE : The property is not supported by the current device
  1184. */
  1185. int AC IC_SetWhiteBalanceBlue(HGRABBER hGrabber, long Value);
  1186. ///////////////////////////////////////////////////////////////////
  1187. /*! Performs the one push for Focus
  1188. @param hGrabber Handle to a grabber object.
  1189. @param Value Value of the blue white balance to be set
  1190. @retval IC_SUCCESS : Success
  1191. @retval IC_NO_HANDLE : Invalid grabber handle
  1192. @retval IC_NO_DEVICE : No video capture device opened
  1193. @retval IC_NOT_AVAILABLE : The property is not supported by the current device
  1194. */
  1195. int AC IC_FocusOnePush(HGRABBER hGrabber);
  1196. ///////////////////////////////////////////////////////////////////
  1197. /*! Show the internal property page of the camera
  1198. */
  1199. int AC IC_ShowInternalPropertyPage(HGRABBER hGrabber);
  1200. ///////////////////////////////////////////////////////////////////
  1201. /*! Resets all properties to their default values. If a property has
  1202. automation, the automatic will be enabled.
  1203. If the device supports external trigger, the external trigger will
  1204. be disabled.
  1205. @param hGrabber Handle to a grabber object.
  1206. @retval IC_SUCCESS Success
  1207. @retval IC_NO_HANDLE Invalid grabber handle
  1208. @retval IC_NO_DEVICE No video capture device opened
  1209. */
  1210. int AC IC_ResetProperties(HGRABBER hGrabber);
  1211. ///////////////////////////////////////////////////////////////////
  1212. /*! Resets the driver. Do not use, for internl purposes only.
  1213. @param hGrabber Handle to a grabber object.
  1214. @retval IC_SUCCESS Success
  1215. @retval IC_NO_HANDLE Invalid grabber handle
  1216. @retval IC_NO_DEVICE No video capture device opened
  1217. */
  1218. int AC IC_ResetUSBCam(HGRABBER hGrabber);
  1219. ///////////////////////////////////////////////////////////////////
  1220. /*! This function queries the internal property set (KsPropertySet) of the driver.
  1221. It allows an application to access all properties of a video capture devices
  1222. using the enums and GUIDs from the header files fwcam1394propguid.h and
  1223. fwcam1394props.h.
  1224. @param hGrabber Handle to a grabber object.
  1225. @retval IC_SUCCESS Success
  1226. @retval IC_NO_HANDLE Invalid grabber handle
  1227. @retval IC_NO_DEVICE No video capture device opened
  1228. @retval IC_ERROR The property could not have been retrieved
  1229. */
  1230. int AC IC_QueryPropertySet(HGRABBER hGrabber);
  1231. ///////////////////////////////////////////////////////////////////
  1232. /*! This function sets a value or structure to the internal property set
  1233. of the video capture device. The properties and structures are defined
  1234. in the header file fwcam1394props.h. Before using this function, the
  1235. properties set must have been queried once using the function IC_QueryPropertySet().
  1236. @param hGrabber Handle to a grabber object.
  1237. @retval IC_SUCCESS Success
  1238. @retval IC_ERROR Setting of the values failed
  1239. @retval IC_NO_PROPERTYSET The property set was not retrieved or is not available.
  1240. @retval IC_NO_HANDLE Invalid grabber handle
  1241. @retval IC_NO_DEVICE No video capture device opened
  1242. @sa IC_QueryPropertySet
  1243. */
  1244. //int AC IC_PropertySet_Set(HGRABBER hGrabber, FWCAM1394_CUSTOM_PROP prop, FWCAM1394_CUSTOM_PROP_S& rstruct );
  1245. ///////////////////////////////////////////////////////////////////
  1246. /*! Enables or disables the default window size lock of the video window.
  1247. @param hGrabber Handle to a grabber object.
  1248. @param Default 0 = disable, custome size can be set, 1 = enable, the standard size, which is video format, is used.
  1249. @retval IC_SUCCESS Success
  1250. @retval IC_ERROR Setting of the values failed
  1251. @retval IC_NO_PROPERTYSET The property set was not retrieved or is not available.
  1252. @retval IC_NO_HANDLE Invalid grabber handle
  1253. @retval IC_NO_DEVICE No video capture device opened
  1254. */
  1255. int AC IC_SetDefaultWindowPosition(HGRABBER hGrabber, int Default);
  1256. ///////////////////////////////////////////////////////////////////
  1257. /*! This function Sets the position and size of the video window.
  1258. @param hGrabber Handle to a grabber object.
  1259. @param PosX Specifies the x-coordinate of the upper left hand corner of the video window. It defaults to 0.
  1260. @param PosY Specifies the y-coordinate of the upper left hand corner of the video window. It defaults to 0.
  1261. @param width Specifies the width of the video window.
  1262. @param height Specifies the height of the video window.
  1263. @retval IC_SUCCESS Success
  1264. @retval IC_ERROR Setting of the values failed
  1265. @retval IC_DEFAULT_WINDOW_SIZE_SET The property set was not retrieved or is not available.
  1266. @retval IC_NO_HANDLE Invalid grabber handle
  1267. @retval IC_NO_DEVICE No video capture device opened
  1268. */
  1269. int AC IC_SetWindowPosition(HGRABBER hGrabber, int PosX, int PosY, int Width, int Height );
  1270. ///////////////////////////////////////////////////////////////////
  1271. /*! Enumerate the available properties of a video capture device.
  1272. @param hGrabber Handle to a grabber object.
  1273. @param cb Callback functions called by the enum function.
  1274. @param data User data
  1275. @retval IC_SUCCESS No error otherwise an error occured, e.g. no device selected.
  1276. */
  1277. int AC IC_enumProperties(HGRABBER hGrabber, IC_ENUMCB cb, void* data);
  1278. ///////////////////////////////////////////////////////////////////
  1279. /*! Enumerate the available elements of a video capture device and a property.
  1280. @param hGrabber Handle to a grabber object.
  1281. @param Property Name of the property
  1282. @param cb Callback functions called by the enum function.
  1283. @param data User data
  1284. @retval IC_SUCCESS No error otherwise an error occured, e.g. no device selected.
  1285. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE The passed property in Property is not avaialble.
  1286. */
  1287. int AC IC_enumPropertyElements(HGRABBER hGrabber, char* Property, IC_ENUMCB cb, void* data);
  1288. ///////////////////////////////////////////////////////////////////
  1289. /*! Enumerate the available interfaces of of a video capture device, property and element.
  1290. The string passed to the callback function can contain
  1291. - Range
  1292. - Switch
  1293. - Button
  1294. - Mapstrings
  1295. - AbsoluteValues
  1296. - Unknown
  1297. @param hGrabber Handle to a grabber object.
  1298. @param Property Name of the property
  1299. @param Property Name of the elemt
  1300. @param cb Callback functions called by the enum function.
  1301. @param data User data
  1302. @retval IC_SUCCESS No error otherwise an error occured, e.g. no device selected.
  1303. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE The passed property in Property is not avaialble.
  1304. */
  1305. int AC IC_enumPropertyElementInterfaces(HGRABBER hGrabber, char* Property, char* Element, IC_ENUMCB cb, void* data);
  1306. ///////////////////////////////////////////////////////////////////
  1307. /*! Check, whether a property is available.. For a list of properties and elements
  1308. use the VCDPropertyInspector of IC Imaging Control.
  1309. @param hGrabber Handle to a grabber object.
  1310. @param Property The name of the property, e.g. Gain, Exposure
  1311. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is not checked.
  1312. @retval IC_SUCCESS Success
  1313. @retval IC_NO_HANDLE Invalid grabber handle
  1314. @retval IC_NO_DEVICE No video capture device opened
  1315. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1316. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1317. Simple call:
  1318. @code
  1319. if( IC_IsPropertyAvailable( hGrabber, "Brightness",NULL) == IC_SUCCESS )
  1320. {
  1321. printf("Brightness is supported\n");
  1322. }
  1323. else
  1324. {
  1325. printf("Brightness is not supported\n");
  1326. }
  1327. @endcode
  1328. Complex call for a special element:
  1329. @code
  1330. if( IC_IsPropertyAvailable( hGrabber, "Trigger","Software Trigger") == IC_SUCCESS )
  1331. {
  1332. printf("Software trigger is supported\n");
  1333. }
  1334. else
  1335. {
  1336. printf("Software trigger is not supported\n");
  1337. }
  1338. @endcode
  1339. */
  1340. int AC IC_IsPropertyAvailable(HGRABBER hGrabber, char* Property, char *Element );
  1341. ///////////////////////////////////////////////////////////////////
  1342. /*! This returns the range of a property. For a list of properties and elements
  1343. use the VCDPropertyInspector of IC Imaging Control.
  1344. @param hGrabber Handle to a grabber object.
  1345. @param Property The name of the property, e.g. Gain, Exposure
  1346. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is "Value".
  1347. @param Min Receives the min value of the property
  1348. @param Max Receives the max value of the property
  1349. @retval IC_SUCCESS Success
  1350. @retval IC_NO_HANDLE Invalid grabber handle
  1351. @retval IC_NO_DEVICE No video capture device opened
  1352. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1353. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1354. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1355. @code
  1356. HGRABBER hGrabber; // The handle of the grabber object.
  1357. int Min;
  1358. int Max;
  1359. int Result = IC_ERROR;
  1360. HGRABBER hGrabber;
  1361. if( IC_InitLibrary(0) )
  1362. {
  1363. hGrabber = IC_CreateGrabber();
  1364. IC_OpenVideoCaptureDevice(hGrabber, "DFx 31BG03.H");
  1365. if( hGrabber )
  1366. {
  1367. Result = IC_GetPropertyValueRange(hGrabber,"Exposure","Auto Reference", &Min, &Max );
  1368. if( Result == IC_SUCCESS )
  1369. printf("Expsure Auto Reference Min %d, Max %d\n", Min, Max);
  1370. Result = IC_GetPropertyValueRange(hGrabber,"Exposure",NULL, &Min, &Max );
  1371. if( Result == IC_SUCCESS )
  1372. printf("Exposure Value Min %d, Max %d\n", Min, Max);
  1373. }
  1374. IC_ReleaseGrabber( hGrabber );
  1375. @endcode
  1376. */
  1377. int AC IC_GetPropertyValueRange(HGRABBER hGrabber, char* Property, char *Element, int *Min, int *Max );
  1378. ///////////////////////////////////////////////////////////////////
  1379. /*! This returns the current value of a property. For a list of properties and elements
  1380. use the VCDPropertyInspector of IC Imaging Control.
  1381. @param hGrabber Handle to a grabber object.
  1382. @param Property The name of the property, e.g. Gain, Exposure
  1383. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is "Value".
  1384. @param Value Receives the value of the property
  1385. @retval IC_SUCCESS Success
  1386. @retval IC_NO_HANDLE Invalid grabber handle
  1387. @retval IC_NO_DEVICE No video capture device opened
  1388. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1389. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1390. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1391. */
  1392. int AC IC_GetPropertyValue(HGRABBER hGrabber, char* Property, char *Element, int *Value );
  1393. ///////////////////////////////////////////////////////////////////
  1394. /*! This sets a new value of a property. For a list of properties and elements
  1395. use the VCDPropertyInspector of IC Imaging Control.
  1396. @param hGrabber Handle to a grabber object.
  1397. @param Property The name of the property, e.g. Gain, Exposure
  1398. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is "Value".
  1399. @param Value Receives the value of the property
  1400. @retval IC_SUCCESS Success
  1401. @retval IC_NO_HANDLE Invalid grabber handle
  1402. @retval IC_NO_DEVICE No video capture device opened
  1403. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1404. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1405. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1406. */
  1407. int AC IC_SetPropertyValue(HGRABBER hGrabber, char* Property, char *Element, int Value );
  1408. ///////////////////////////////////////////////////////////////////
  1409. /*! This returns the range of an absolute value property. Usually it is used for exposure.
  1410. a list of properties and elements use the VCDPropertyInspector of IC Imaging Control.
  1411. @param hGrabber Handle to a grabber object.
  1412. @param Property The name of the property, e.g. Gain, Exposure
  1413. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is "Value".
  1414. @param Min Receives the min value of the property
  1415. @param Max Receives the max value of the property
  1416. @retval IC_SUCCESS Success
  1417. @retval IC_NO_HANDLE Invalid grabber handle
  1418. @retval IC_NO_DEVICE No video capture device opened
  1419. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1420. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1421. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1422. */
  1423. int AC IC_GetPropertyAbsoluteValueRange(HGRABBER hGrabber, char* Property, char *Element, float *Min, float *Max );
  1424. ///////////////////////////////////////////////////////////////////
  1425. /*! This returns the current value of an absolute value property.
  1426. Usually it is used for exposure. For a list of properties and elements
  1427. use the VCDPropertyInspector of IC Imaging Control.
  1428. @param hGrabber Handle to a grabber object.
  1429. @param Property The name of the property, e.g. Gain, Exposure
  1430. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is "Value".
  1431. @param Value Receives the value of the property
  1432. @retval IC_SUCCESS Success
  1433. @retval IC_NO_HANDLE Invalid grabber handle
  1434. @retval IC_NO_DEVICE No video capture device opened
  1435. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1436. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1437. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1438. */
  1439. int AC IC_GetPropertyAbsoluteValue(HGRABBER hGrabber, char* Property, char *Element, float *Value );
  1440. ///////////////////////////////////////////////////////////////////
  1441. /*! This sets a new value of an absolute value property. Usually it is used for exposure.
  1442. a list of properties and elements
  1443. use the VCDPropertyInspector of IC Imaging Control.
  1444. @param hGrabber Handle to a grabber object.
  1445. @param Property The name of the property, e.g. Gain, Exposure
  1446. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is "Value".
  1447. @param Value Receives the value of the property
  1448. @retval IC_SUCCESS Success
  1449. @retval IC_NO_HANDLE Invalid grabber handle
  1450. @retval IC_NO_DEVICE No video capture device opened
  1451. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1452. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1453. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1454. */
  1455. int AC IC_SetPropertyAbsoluteValue(HGRABBER hGrabber, char* Property, char *Element, float Value );
  1456. ///////////////////////////////////////////////////////////////////
  1457. /*! This returns the current value of a switch property. Switch properties
  1458. are usually used for enabling and disabling of automatics.
  1459. For a list of properties and elements
  1460. use the VCDPropertyInspector of IC Imaging Control.
  1461. @param hGrabber Handle to a grabber object.
  1462. @param Property The name of the property, e.g. Gain, Exposure
  1463. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is "Auto".
  1464. @param On Receives the value of the property
  1465. @retval IC_SUCCESS Success
  1466. @retval IC_NO_HANDLE Invalid grabber handle
  1467. @retval IC_NO_DEVICE No video capture device opened
  1468. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1469. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1470. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1471. */
  1472. int AC IC_GetPropertySwitch(HGRABBER hGrabber, char* Property, char *Element, int *On );
  1473. ///////////////////////////////////////////////////////////////////
  1474. /*! This sets the value of a switch property. Switch properties
  1475. are usually used for enabling and disabling of automatics.
  1476. For a list of properties and elements
  1477. use the VCDPropertyInspector of IC Imaging Control.
  1478. @param hGrabber Handle to a grabber object.
  1479. @param Property The name of the property, e.g. Gain, Exposure
  1480. @param Element The type of the interface, e.g. Value, Auto. If NULL, it is "Auto".
  1481. @param On Receives the value of the property
  1482. @retval IC_SUCCESS Success
  1483. @retval IC_NO_HANDLE Invalid grabber handle
  1484. @retval IC_NO_DEVICE No video capture device opened
  1485. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1486. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1487. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1488. */
  1489. int AC IC_SetPropertySwitch(HGRABBER hGrabber, char* Property, char *Element, int On );
  1490. //////////////////////////////////////////////////////////////////
  1491. /*! This executes the on push on a property. These properties are used
  1492. for white balance one push or for software trigger.
  1493. For a list of properties and elements
  1494. use the VCDPropertyInspector of IC Imaging Control.
  1495. @param hGrabber Handle to a grabber object.
  1496. @param Property The name of the property, e.g. "Trigger"
  1497. @param Element The type of the interface, e.g. "Software Trigger"
  1498. @param On Receives the value of the property
  1499. @retval IC_SUCCESS Success
  1500. @retval IC_NO_HANDLE Invalid grabber handle
  1501. @retval IC_NO_DEVICE No video capture device opened
  1502. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1503. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1504. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1505. */
  1506. int AC IC_PropertyOnePush(HGRABBER hGrabber, char* Property, char *Element );
  1507. //////////////////////////////////////////////////////////////////
  1508. /*!
  1509. @param hGrabber Handle to a grabber object.
  1510. @param Property The name of the property, e.g. "Strobe"
  1511. @param Element The type of the interface, e.g. "Mode"
  1512. @param StringCount Receives the count of strings, that is modes, availble
  1513. @param Strings pointer to an array of char*, that will contain the mode strings. The array size should be StringCount * 20. Parameter can be null in order to query the number of strings
  1514. @retval IC_SUCCESS Success
  1515. @retval IC_NO_HANDLE Invalid grabber handle
  1516. @retval IC_NO_DEVICE No video capture device opened
  1517. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1518. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1519. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1520. */
  1521. int AC IC_GetPropertyMapStrings(HGRABBER hGrabber, char* Property, char *Element, int *StringCount, char **Strings );
  1522. //////////////////////////////////////////////////////////////////
  1523. /*! Return the current set string of a mapstring interface
  1524. @param hGrabber Handle to a grabber object.
  1525. @param Property The name of the property, e.g. "Strobe"
  1526. @param Element The type of the interface, e.g. "Mode"
  1527. @param String pointer to a char*. Size should be atleast 50. There is no check! This contains the result.
  1528. @retval IC_SUCCESS Success
  1529. @retval IC_NO_HANDLE Invalid grabber handle
  1530. @retval IC_NO_DEVICE No video capture device opened
  1531. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1532. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1533. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1534. */
  1535. int AC IC_GetPropertyMapString(HGRABBER hGrabber, char* Property, char *Element, char *String );
  1536. //////////////////////////////////////////////////////////////////
  1537. /*! Set the string of a mapstring interface
  1538. @param hGrabber Handle to a grabber object.
  1539. @param Property The name of the property, e.g. "Strobe"
  1540. @param Element The type of the interface, e.g. "Mode"
  1541. @param String pointer to a char*. Size should be atleast 50. There is no check! This contains the result.
  1542. @retval IC_SUCCESS Success
  1543. @retval IC_NO_HANDLE Invalid grabber handle
  1544. @retval IC_NO_DEVICE No video capture device opened
  1545. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE A requested property item is not available
  1546. @retval IC_PROPERTY_ELEMENT_NOT_AVAILABLE A requested element of a given property item is not available
  1547. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE requested element has not the interface, which is needed.
  1548. */
  1549. int AC IC_SetPropertyMapString(HGRABBER hGrabber, char* Property, char *Element, char *String );
  1550. //////////////////////////////////////////////////////////////////
  1551. /*! Query number of avaialable frame filters
  1552. @retval The count of found frame filters.
  1553. */
  1554. int AC IC_GetAvailableFrameFilterCount();
  1555. //////////////////////////////////////////////////////////////////
  1556. /*! Query a list of framefilters
  1557. @param szFilterList A two dimensional char array that recieves the list of found frame filters
  1558. @param iSize The number of entries in the above list.
  1559. @code
  1560. char szFilterList[80][40];
  1561. int iCount;
  1562. iCount = IC_GetAvailableFrameFilterCount();
  1563. iFormatCount = IC_GetAvailableFrameFilters(szFormatList,iCount );
  1564. for( i = 0; i < iCount; i++ )
  1565. {
  1566. printf("%2d. %s\n",i+1,szFormatList[i]);
  1567. }
  1568. @endcode
  1569. */
  1570. int AC IC_GetAvailableFrameFilters(char **szFilterList, int iSize );
  1571. //////////////////////////////////////////////////////////////////
  1572. /*! Create a frame filter
  1573. @param szFilterName Name of the filter to create
  1574. @param FilterHandle Address of a pointer, that will receive the handle of the created filter
  1575. @retval IC_SUCCESS Success
  1576. @retval IC_ERROR If the filter creation failed.
  1577. @sa IC_DeleteFrameFilter
  1578. */
  1579. int AC IC_CreateFrameFilter(char *szFilterName, HFRAMEFILTER *FilterHandle );
  1580. //////////////////////////////////////////////////////////////////
  1581. /*! Add the frame filter to the device's filter list. It is possible to add several
  1582. frame filter to a grabber, so a filter chain for image processing can be created.
  1583. A frame filter is removed by a call to IC_RemoveFrameFilter
  1584. @param hGrabber Handle to a grabber object.
  1585. @param FilterHandle Handle to a frame filter object.
  1586. @retval IC_SUCCESS Success
  1587. @retval IC_ERROR Either hGrabber or FilterHandle was NULL
  1588. @sa IC_RemoveFrameFilterFromDevice
  1589. @sa IC_CreateFrameFilter
  1590. */
  1591. int AC IC_AddFrameFilterToDevice(HGRABBER hGrabber, HFRAMEFILTER FilterHandle );
  1592. //////////////////////////////////////////////////////////////////
  1593. /*! Removes a previously added frame filter from the frame filter list
  1594. @param hGrabber Handle to a grabber object, that uses the passed frame filter.
  1595. @param FilterHandle Handle to a frame filter object, to be removed
  1596. @sa IC_AddFrameFilterToDevice
  1597. @sa IC_CreateFrameFilter
  1598. */
  1599. void AC IC_RemoveFrameFilterFromDevice(HGRABBER hGrabber, HFRAMEFILTER FilterHandle );
  1600. //////////////////////////////////////////////////////////////////
  1601. /*! Deletes a previously created frame filter. Make sure, the frame filter to be deleted
  1602. is not in use anymore, otherwise a null pointer access violation will occur.
  1603. @param FilterHandle Handle to a frame filter object.
  1604. */
  1605. void AC IC_DeleteFrameFilter( HFRAMEFILTER FilterHandle );
  1606. ///////////////////////////////////////////////////////////////
  1607. /* Delete the memory allocated by the HFRAMEFILTER structure. Please remove the frame filter from the HGrabber,
  1608. before deleting it.
  1609. @param FilterHandle Handle to a frame filter object.
  1610. @retval IC_SUCCESS Success
  1611. @retval IC_ERROR Either hGrabber or FilterHandle was NULL or the frame filter has no dialog.
  1612. */
  1613. int AC IC_FrameFilterShowDialog( HFRAMEFILTER FilterHandle );
  1614. ///////////////////////////////////////////////////////////////
  1615. /*! Query a parameter value of a frame filter
  1616. @param FilterHandle Handle to a frame filter object.
  1617. @param ParameterName Name of the parameter whose value is to be queried
  1618. @param Data pointer to the data, that receives the value. Memory must be allocated before.
  1619. @retval IC_SUCCESS Success
  1620. @retval IC_ERROR Maybe the parameter name does not exist.
  1621. */
  1622. int AC IC_FrameFilterGetParameter(HFRAMEFILTER FilterHandle, char* ParameterName, void* Data );
  1623. /*! Set an int parameter value of a frame filter
  1624. @param FilterHandle Handle to a frame filter object.
  1625. @param ParameterName Name of the parameter whose value is to be set
  1626. @param Data The data, that contains the value.
  1627. @retval IC_SUCCESS Success
  1628. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE the parameter givven by ParameterName does not exist
  1629. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE The data type, e.g. int does not match to the parameter type, e.g. float
  1630. @retval IC_ERROR Unknown error
  1631. */
  1632. int AC IC_FrameFilterSetParameterInt(HFRAMEFILTER FilterHandle, char* ParameterName, int Data );
  1633. /*! Set a float parameter value of a frame filter
  1634. @param FilterHandle Handle to a frame filter object.
  1635. @param ParameterName Name of the parameter whose value is to be set
  1636. @param Data The data, that contains the value.
  1637. @retval IC_SUCCESS Success
  1638. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE the parameter givven by ParameterName does not exist
  1639. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE The data type, e.g. int does not match to the parameter type, e.g. float
  1640. @retval IC_ERROR Unknown error
  1641. */
  1642. int AC IC_FrameFilterSetParameterFloat(HFRAMEFILTER FilterHandle, char* ParameterName, float Data );
  1643. /*! Set a boolean parameter value of a frame filter. boolean means int here.
  1644. @param FilterHandle Handle to a frame filter object.
  1645. @param ParameterName Name of the parameter whose value is to be set
  1646. @param Data The data, that contains the value.
  1647. @retval IC_SUCCESS Success
  1648. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE the parameter givven by ParameterName does not exist
  1649. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE The data type, e.g. int does not match to the parameter type, e.g. float
  1650. @retval IC_ERROR Unknown error
  1651. */
  1652. int AC IC_FrameFilterSetParameterBoolean(HFRAMEFILTER FilterHandle, char* ParameterName, int Data );
  1653. /*! Set a string parameter value of a frame filter
  1654. @param FilterHandle Handle to a frame filter object.
  1655. @param ParameterName Name of the parameter whose value is to be set
  1656. @param Data The data, that contains the value.
  1657. @retval IC_SUCCESS Success
  1658. @retval IC_PROPERTY_ITEM_NOT_AVAILABLE the parameter givven by ParameterName does not exist
  1659. @retval IC_PROPERTY_ELEMENT_WRONG_INTERFACE The data type, e.g. int does not match to the parameter type, e.g. float
  1660. @retval IC_ERROR Unknown error
  1661. */
  1662. int AC IC_FrameFilterSetParameterString(HFRAMEFILTER FilterHandle, char* ParameterName, char* Data );
  1663. ////////////////////////////////////////////////////////////////////////////
  1664. /*! Remove all frame filters from the Grabber's device path
  1665. @param hGrabber Handle to a grabber object.
  1666. */
  1667. int AC IC_FrameFilterDeviceClear(HGRABBER hGrabber );
  1668. typedef struct CODECHANDLE_t__ { int unused; } CODECHANDLE_t; ///<Internal structure of the grabber object handle.
  1669. //////////////////////////////////////////////////////////////////////////
  1670. /*!
  1671. */
  1672. #define HCODEC CODECHANDLE_t* ///< Type of grabber object handle. Used for all functions.
  1673. ////////////////////////////////////////////////////////////////////////////
  1674. /*! Callback type definition for the codec enumenration callback called by
  1675. IC_enumCodecs
  1676. @retval 1 : Terminate the enumeration, 0 continue enumrating
  1677. */
  1678. typedef int _cdecl ENUMCODECCB( char* CodecName, void*);
  1679. ////////////////////////////////////////////////////////////////////////////
  1680. /*! Enumerate all installed codecs. It calls the callback function passed by
  1681. the cb parameter. It ends, if cb returns 0 or all codecs have been enumerated.
  1682. @param cb pallack function of type ENUMCODECCB
  1683. @param data Pointer to user data
  1684. */
  1685. void AC IC_enumCodecs(ENUMCODECCB cb, void* data);
  1686. ////////////////////////////////////////////////////////////////////////////
  1687. /*! Creates the codec by the passed name
  1688. @param Name Name of the codec to be created
  1689. @retval NULL on error, otherwise the created HCODEC
  1690. */
  1691. HCODEC IC_Codec_Create(char* Name);
  1692. void AC IC_Codec_Release(HCODEC Codec);
  1693. ////////////////////////////////////////////////////////////////////////////
  1694. /*! Queries a name of a codec passed by _Codec
  1695. @param _Codec Handle to the codec
  1696. @param l Size in bytes of the memory allocated for name
  1697. @param name String that will receive the name of the codec terminated by a \0
  1698. @retval IC_SUCCESS on success
  1699. @retval IC_NO_HANDLE if _Codec or Name is NULL
  1700. */
  1701. int AC IC_Codec_getName(HCODEC Codec, int l, char* Name);
  1702. ////////////////////////////////////////////////////////////////////////////
  1703. /*! Return whether a codec passed by _Codec has a property dialog
  1704. @param _Codec Handle to the codec
  1705. @retval IC_SUCCESS The codec has a dialog
  1706. @retval IC_ERROR The codec has no dialog
  1707. @retval IC_NO_HANDLE _Codec is NULL
  1708. */
  1709. int AC IC_Codec_hasDialog(HCODEC Codec);
  1710. ////////////////////////////////////////////////////////////////////////////
  1711. /*! Shows the property dialog of a codec passed by _Codec
  1712. @param name String that will receive the name of the codec terminated by a \0
  1713. @retval IC_SUCCESS on success
  1714. @retval IC_ERROR On error, e.g. something went wrong with the codec's dialog.
  1715. @retval IC_NO_HANDLE if _Codec or Name is NULL
  1716. */
  1717. int AC IC_Codec_showDialog(HCODEC Codec);
  1718. ////////////////////////////////////////////////////////////////////////////
  1719. /*! Assigns the selected Codec to the Grabber. AVI Capture is prepared. Image
  1720. capture does not work anymore.
  1721. After doing so, a call to IC_Startlive() starts AVI Capture and IC_Stoplive stopps it,
  1722. @param hlGrabber Handle to a grabber with a valid device
  1723. @param Codec Handle to the selected codec.
  1724. @retval IC_SUCCESS on success
  1725. */
  1726. int AC IC_SetCodec(HGRABBER hlGrabber,HCODEC Codec);
  1727. ////////////////////////////////////////////////////////////////////////////
  1728. /*! Set the file name for the AVI file
  1729. After doing so, a call to IC_Startlive() starts AVI Capture and IC_Stoplive stopps it,
  1730. @param hlGrabber Handle to a grabber with a valid device
  1731. @param FileName Filename
  1732. @retval IC_SUCCESS on success
  1733. @retval IC_NO_HANDLE if the grabber is invalid
  1734. */
  1735. int IC_SetAVIFileName(HGRABBER hlGrabber,char * FileName);
  1736. ////////////////////////////////////////////////////////////////////////////
  1737. /*! Pauses or continues AVI Capture. This allows, to start the stream and see the live video
  1738. but images are not saved into the AVI file.
  1739. @param hlGrabber Handle to a grabber with a valid device
  1740. @param pause 1 = Pause, nothing saved, 0 = save images!
  1741. @retval IC_SUCCESS on success
  1742. @retval IC_NO_HANDLE if the grabber is invalid
  1743. */
  1744. int IC_enableAVICapturePause(HGRABBER hlGrabber, int Pause );
  1745. #if defined(__cplusplus)
  1746. }
  1747. #endif
  1748. #endif