HFramegrabber.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 20.11
  3. * Usage: Interface to C++
  4. *
  5. * Software by: MVTec Software GmbH, www.mvtec.com
  6. ***********************************************************/
  7. #ifndef HCPP_HFRAMEGRABBER
  8. #define HCPP_HFRAMEGRABBER
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of an image acquisition device.
  12. class LIntExport HFramegrabber : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HFramegrabber():HHandle() {}
  17. // Copy constructor
  18. HFramegrabber(const HFramegrabber& source) : HHandle(source) {}
  19. // Copy constructor
  20. HFramegrabber(const HHandle& handle);
  21. // Create HFramegrabber from handle, taking ownership
  22. explicit HFramegrabber(Hlong handle);
  23. bool operator==(const HHandle& obj) const
  24. {
  25. return HHandleBase::operator==(obj);
  26. }
  27. bool operator!=(const HHandle& obj) const
  28. {
  29. return HHandleBase::operator!=(obj);
  30. }
  31. protected:
  32. // Verify matching semantic type ('framegrabber')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /*****************************************************************************
  36. * Operator-based class constructors
  37. *****************************************************************************/
  38. // open_framegrabber: Open and configure an image acquisition device.
  39. explicit HFramegrabber(const HString& Name, Hlong HorizontalResolution, Hlong VerticalResolution, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, const HString& Field, const HTuple& BitsPerChannel, const HTuple& ColorSpace, const HTuple& Generic, const HString& ExternalTrigger, const HTuple& CameraType, const HTuple& Device, const HTuple& Port, const HTuple& LineIn);
  40. // open_framegrabber: Open and configure an image acquisition device.
  41. explicit HFramegrabber(const HString& Name, Hlong HorizontalResolution, Hlong VerticalResolution, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, const HString& Field, Hlong BitsPerChannel, const HString& ColorSpace, double Generic, const HString& ExternalTrigger, const HString& CameraType, const HString& Device, Hlong Port, Hlong LineIn);
  42. // open_framegrabber: Open and configure an image acquisition device.
  43. explicit HFramegrabber(const char* Name, Hlong HorizontalResolution, Hlong VerticalResolution, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, const char* Field, Hlong BitsPerChannel, const char* ColorSpace, double Generic, const char* ExternalTrigger, const char* CameraType, const char* Device, Hlong Port, Hlong LineIn);
  44. #ifdef _WIN32
  45. // open_framegrabber: Open and configure an image acquisition device.
  46. explicit HFramegrabber(const wchar_t* Name, Hlong HorizontalResolution, Hlong VerticalResolution, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, const wchar_t* Field, Hlong BitsPerChannel, const wchar_t* ColorSpace, double Generic, const wchar_t* ExternalTrigger, const wchar_t* CameraType, const wchar_t* Device, Hlong Port, Hlong LineIn);
  47. #endif
  48. /***************************************************************************
  49. * Operators *
  50. ***************************************************************************/
  51. // Query specific parameters of an image acquisition device.
  52. HTuple GetFramegrabberParam(const HTuple& Param) const;
  53. // Query specific parameters of an image acquisition device.
  54. HTuple GetFramegrabberParam(const HString& Param) const;
  55. // Query specific parameters of an image acquisition device.
  56. HTuple GetFramegrabberParam(const char* Param) const;
  57. #ifdef _WIN32
  58. // Query specific parameters of an image acquisition device.
  59. HTuple GetFramegrabberParam(const wchar_t* Param) const;
  60. #endif
  61. // Set specific parameters of an image acquisition device.
  62. void SetFramegrabberParam(const HTuple& Param, const HTuple& Value) const;
  63. // Set specific parameters of an image acquisition device.
  64. void SetFramegrabberParam(const HString& Param, const HString& Value) const;
  65. // Set specific parameters of an image acquisition device.
  66. void SetFramegrabberParam(const char* Param, const char* Value) const;
  67. #ifdef _WIN32
  68. // Set specific parameters of an image acquisition device.
  69. void SetFramegrabberParam(const wchar_t* Param, const wchar_t* Value) const;
  70. #endif
  71. // Query callback function of an image acquisition device.
  72. void* GetFramegrabberCallback(const HString& CallbackType, void** UserContext) const;
  73. // Query callback function of an image acquisition device.
  74. void* GetFramegrabberCallback(const char* CallbackType, void** UserContext) const;
  75. #ifdef _WIN32
  76. // Query callback function of an image acquisition device.
  77. void* GetFramegrabberCallback(const wchar_t* CallbackType, void** UserContext) const;
  78. #endif
  79. // Register a callback function for an image acquisition device.
  80. void SetFramegrabberCallback(const HString& CallbackType, void* CallbackFunction, void* UserContext) const;
  81. // Register a callback function for an image acquisition device.
  82. void SetFramegrabberCallback(const char* CallbackType, void* CallbackFunction, void* UserContext) const;
  83. #ifdef _WIN32
  84. // Register a callback function for an image acquisition device.
  85. void SetFramegrabberCallback(const wchar_t* CallbackType, void* CallbackFunction, void* UserContext) const;
  86. #endif
  87. // Asynchronous grab of images and preprocessed image data from the specified image acquisition device.
  88. HImage GrabDataAsync(HRegion* Region, HXLDCont* Contours, double MaxDelay, HTuple* Data) const;
  89. // Asynchronous grab of images and preprocessed image data from the specified image acquisition device.
  90. HImage GrabDataAsync(HRegion* Region, HXLDCont* Contours, double MaxDelay, HString* Data) const;
  91. // Synchronous grab of images and preprocessed image data from the specified image acquisition device.
  92. HImage GrabData(HRegion* Region, HXLDCont* Contours, HTuple* Data) const;
  93. // Synchronous grab of images and preprocessed image data from the specified image acquisition device.
  94. HImage GrabData(HRegion* Region, HXLDCont* Contours, HString* Data) const;
  95. // Asynchronous grab of an image from the specified image acquisition device.
  96. HImage GrabImageAsync(double MaxDelay) const;
  97. // Start an asynchronous grab from the specified image acquisition device.
  98. void GrabImageStart(double MaxDelay) const;
  99. // Synchronous grab of an image from the specified image acquisition device.
  100. HImage GrabImage() const;
  101. // Close specified image acquisition device.
  102. void CloseFramegrabber() const;
  103. // Open and configure an image acquisition device.
  104. void OpenFramegrabber(const HString& Name, Hlong HorizontalResolution, Hlong VerticalResolution, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, const HString& Field, const HTuple& BitsPerChannel, const HTuple& ColorSpace, const HTuple& Generic, const HString& ExternalTrigger, const HTuple& CameraType, const HTuple& Device, const HTuple& Port, const HTuple& LineIn);
  105. // Open and configure an image acquisition device.
  106. void OpenFramegrabber(const HString& Name, Hlong HorizontalResolution, Hlong VerticalResolution, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, const HString& Field, Hlong BitsPerChannel, const HString& ColorSpace, double Generic, const HString& ExternalTrigger, const HString& CameraType, const HString& Device, Hlong Port, Hlong LineIn);
  107. // Open and configure an image acquisition device.
  108. void OpenFramegrabber(const char* Name, Hlong HorizontalResolution, Hlong VerticalResolution, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, const char* Field, Hlong BitsPerChannel, const char* ColorSpace, double Generic, const char* ExternalTrigger, const char* CameraType, const char* Device, Hlong Port, Hlong LineIn);
  109. #ifdef _WIN32
  110. // Open and configure an image acquisition device.
  111. void OpenFramegrabber(const wchar_t* Name, Hlong HorizontalResolution, Hlong VerticalResolution, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, const wchar_t* Field, Hlong BitsPerChannel, const wchar_t* ColorSpace, double Generic, const wchar_t* ExternalTrigger, const wchar_t* CameraType, const wchar_t* Device, Hlong Port, Hlong LineIn);
  112. #endif
  113. // Query look-up table of the image acquisition device.
  114. void GetFramegrabberLut(HTuple* ImageRed, HTuple* ImageGreen, HTuple* ImageBlue) const;
  115. // Set look-up table of the image acquisition device.
  116. void SetFramegrabberLut(const HTuple& ImageRed, const HTuple& ImageGreen, const HTuple& ImageBlue) const;
  117. };
  118. // forward declarations and types for internal array implementation
  119. template<class T> class HSmartPtr;
  120. template<class T> class HHandleBaseArrayRef;
  121. typedef HHandleBaseArrayRef<HFramegrabber> HFramegrabberArrayRef;
  122. typedef HSmartPtr< HFramegrabberArrayRef > HFramegrabberArrayPtr;
  123. // Represents multiple tool instances
  124. class LIntExport HFramegrabberArray : public HHandleBaseArray
  125. {
  126. public:
  127. // Create empty array
  128. HFramegrabberArray();
  129. // Create array from native array of tool instances
  130. HFramegrabberArray(HFramegrabber* classes, Hlong length);
  131. // Copy constructor
  132. HFramegrabberArray(const HFramegrabberArray &tool_array);
  133. // Destructor
  134. virtual ~HFramegrabberArray();
  135. // Assignment operator
  136. HFramegrabberArray &operator=(const HFramegrabberArray &tool_array);
  137. // Clears array and all tool instances
  138. virtual void Clear();
  139. // Get array of native tool instances
  140. const HFramegrabber* Tools() const;
  141. // Get number of tools
  142. virtual Hlong Length() const;
  143. // Create tool array from tuple of handles
  144. virtual void SetFromTuple(const HTuple& handles);
  145. // Get tuple of handles for tool array
  146. virtual HTuple ConvertToTuple() const;
  147. protected:
  148. // Smart pointer to internal data container
  149. HFramegrabberArrayPtr *mArrayPtr;
  150. };
  151. }
  152. #endif