HDataCode2D.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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_HDATACODE2D
  8. #define HCPP_HDATACODE2D
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a 2D data code reader.
  12. class LIntExport HDataCode2D : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HDataCode2D():HHandle() {}
  17. // Copy constructor
  18. HDataCode2D(const HDataCode2D& source) : HHandle(source) {}
  19. // Copy constructor
  20. HDataCode2D(const HHandle& handle);
  21. // Create HDataCode2D from handle, taking ownership
  22. explicit HDataCode2D(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 ('datacode_2d')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. // Deep copy of all data represented by this object instance
  36. HDataCode2D Clone() const;
  37. /*****************************************************************************
  38. * Operator-based class constructors
  39. *****************************************************************************/
  40. // read_data_code_2d_model: Read a 2D data code model from a file and create a new model.
  41. explicit HDataCode2D(const HString& FileName);
  42. // read_data_code_2d_model: Read a 2D data code model from a file and create a new model.
  43. explicit HDataCode2D(const char* FileName);
  44. #ifdef _WIN32
  45. // read_data_code_2d_model: Read a 2D data code model from a file and create a new model.
  46. explicit HDataCode2D(const wchar_t* FileName);
  47. #endif
  48. // create_data_code_2d_model: Create a model of a 2D data code class.
  49. explicit HDataCode2D(const HString& SymbolType, const HTuple& GenParamName, const HTuple& GenParamValue);
  50. // create_data_code_2d_model: Create a model of a 2D data code class.
  51. explicit HDataCode2D(const HString& SymbolType, const HString& GenParamName, const HString& GenParamValue);
  52. // create_data_code_2d_model: Create a model of a 2D data code class.
  53. explicit HDataCode2D(const char* SymbolType, const char* GenParamName, const char* GenParamValue);
  54. #ifdef _WIN32
  55. // create_data_code_2d_model: Create a model of a 2D data code class.
  56. explicit HDataCode2D(const wchar_t* SymbolType, const wchar_t* GenParamName, const wchar_t* GenParamValue);
  57. #endif
  58. /***************************************************************************
  59. * Operators *
  60. ***************************************************************************/
  61. // Access iconic objects that were created during the search for 2D data code symbols.
  62. HObject GetDataCode2dObjects(const HTuple& CandidateHandle, const HString& ObjectName) const;
  63. // Access iconic objects that were created during the search for 2D data code symbols.
  64. HObject GetDataCode2dObjects(Hlong CandidateHandle, const HString& ObjectName) const;
  65. // Access iconic objects that were created during the search for 2D data code symbols.
  66. HObject GetDataCode2dObjects(Hlong CandidateHandle, const char* ObjectName) const;
  67. #ifdef _WIN32
  68. // Access iconic objects that were created during the search for 2D data code symbols.
  69. HObject GetDataCode2dObjects(Hlong CandidateHandle, const wchar_t* ObjectName) const;
  70. #endif
  71. // Get the alphanumerical results that were accumulated during the search for 2D data code symbols.
  72. HTuple GetDataCode2dResults(const HTuple& CandidateHandle, const HTuple& ResultNames) const;
  73. // Get the alphanumerical results that were accumulated during the search for 2D data code symbols.
  74. HTuple GetDataCode2dResults(const HString& CandidateHandle, const HString& ResultNames) const;
  75. // Get the alphanumerical results that were accumulated during the search for 2D data code symbols.
  76. HTuple GetDataCode2dResults(const char* CandidateHandle, const char* ResultNames) const;
  77. #ifdef _WIN32
  78. // Get the alphanumerical results that were accumulated during the search for 2D data code symbols.
  79. HTuple GetDataCode2dResults(const wchar_t* CandidateHandle, const wchar_t* ResultNames) const;
  80. #endif
  81. // Detect and read 2D data code symbols in an image or train the 2D data code model.
  82. HXLDCont FindDataCode2d(const HImage& Image, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ResultHandles, HTuple* DecodedDataStrings) const;
  83. // Detect and read 2D data code symbols in an image or train the 2D data code model.
  84. HXLDCont FindDataCode2d(const HImage& Image, const HString& GenParamName, Hlong GenParamValue, Hlong* ResultHandles, HString* DecodedDataStrings) const;
  85. // Detect and read 2D data code symbols in an image or train the 2D data code model.
  86. HXLDCont FindDataCode2d(const HImage& Image, const char* GenParamName, Hlong GenParamValue, Hlong* ResultHandles, HString* DecodedDataStrings) const;
  87. #ifdef _WIN32
  88. // Detect and read 2D data code symbols in an image or train the 2D data code model.
  89. HXLDCont FindDataCode2d(const HImage& Image, const wchar_t* GenParamName, Hlong GenParamValue, Hlong* ResultHandles, HString* DecodedDataStrings) const;
  90. #endif
  91. // Set selected parameters of the 2D data code model.
  92. void SetDataCode2dParam(const HTuple& GenParamName, const HTuple& GenParamValue) const;
  93. // Set selected parameters of the 2D data code model.
  94. void SetDataCode2dParam(const HString& GenParamName, const HString& GenParamValue) const;
  95. // Set selected parameters of the 2D data code model.
  96. void SetDataCode2dParam(const char* GenParamName, const char* GenParamValue) const;
  97. #ifdef _WIN32
  98. // Set selected parameters of the 2D data code model.
  99. void SetDataCode2dParam(const wchar_t* GenParamName, const wchar_t* GenParamValue) const;
  100. #endif
  101. // Get one or several parameters that describe the 2D data code model.
  102. HTuple GetDataCode2dParam(const HTuple& GenParamName) const;
  103. // Get one or several parameters that describe the 2D data code model.
  104. HTuple GetDataCode2dParam(const HString& GenParamName) const;
  105. // Get one or several parameters that describe the 2D data code model.
  106. HTuple GetDataCode2dParam(const char* GenParamName) const;
  107. #ifdef _WIN32
  108. // Get one or several parameters that describe the 2D data code model.
  109. HTuple GetDataCode2dParam(const wchar_t* GenParamName) const;
  110. #endif
  111. // Get for a given 2D data code model the names of the generic parameters or objects that can be used in the other 2D data code operators.
  112. HTuple QueryDataCode2dParams(const HString& QueryName) const;
  113. // Get for a given 2D data code model the names of the generic parameters or objects that can be used in the other 2D data code operators.
  114. HTuple QueryDataCode2dParams(const char* QueryName) const;
  115. #ifdef _WIN32
  116. // Get for a given 2D data code model the names of the generic parameters or objects that can be used in the other 2D data code operators.
  117. HTuple QueryDataCode2dParams(const wchar_t* QueryName) const;
  118. #endif
  119. // Deserialize a serialized 2D data code model.
  120. void DeserializeDataCode2dModel(const HSerializedItem& SerializedItemHandle);
  121. // Serialize a 2D data code model.
  122. HSerializedItem SerializeDataCode2dModel() const;
  123. // Read a 2D data code model from a file and create a new model.
  124. void ReadDataCode2dModel(const HString& FileName);
  125. // Read a 2D data code model from a file and create a new model.
  126. void ReadDataCode2dModel(const char* FileName);
  127. #ifdef _WIN32
  128. // Read a 2D data code model from a file and create a new model.
  129. void ReadDataCode2dModel(const wchar_t* FileName);
  130. #endif
  131. // Writes a 2D data code model into a file.
  132. void WriteDataCode2dModel(const HString& FileName) const;
  133. // Writes a 2D data code model into a file.
  134. void WriteDataCode2dModel(const char* FileName) const;
  135. #ifdef _WIN32
  136. // Writes a 2D data code model into a file.
  137. void WriteDataCode2dModel(const wchar_t* FileName) const;
  138. #endif
  139. // Delete a 2D data code model and free the allocated memory.
  140. void ClearDataCode2dModel() const;
  141. // Create a model of a 2D data code class.
  142. void CreateDataCode2dModel(const HString& SymbolType, const HTuple& GenParamName, const HTuple& GenParamValue);
  143. // Create a model of a 2D data code class.
  144. void CreateDataCode2dModel(const HString& SymbolType, const HString& GenParamName, const HString& GenParamValue);
  145. // Create a model of a 2D data code class.
  146. void CreateDataCode2dModel(const char* SymbolType, const char* GenParamName, const char* GenParamValue);
  147. #ifdef _WIN32
  148. // Create a model of a 2D data code class.
  149. void CreateDataCode2dModel(const wchar_t* SymbolType, const wchar_t* GenParamName, const wchar_t* GenParamValue);
  150. #endif
  151. };
  152. // forward declarations and types for internal array implementation
  153. template<class T> class HSmartPtr;
  154. template<class T> class HHandleBaseArrayRef;
  155. typedef HHandleBaseArrayRef<HDataCode2D> HDataCode2DArrayRef;
  156. typedef HSmartPtr< HDataCode2DArrayRef > HDataCode2DArrayPtr;
  157. // Represents multiple tool instances
  158. class LIntExport HDataCode2DArray : public HHandleBaseArray
  159. {
  160. public:
  161. // Create empty array
  162. HDataCode2DArray();
  163. // Create array from native array of tool instances
  164. HDataCode2DArray(HDataCode2D* classes, Hlong length);
  165. // Copy constructor
  166. HDataCode2DArray(const HDataCode2DArray &tool_array);
  167. // Destructor
  168. virtual ~HDataCode2DArray();
  169. // Assignment operator
  170. HDataCode2DArray &operator=(const HDataCode2DArray &tool_array);
  171. // Clears array and all tool instances
  172. virtual void Clear();
  173. // Get array of native tool instances
  174. const HDataCode2D* Tools() const;
  175. // Get number of tools
  176. virtual Hlong Length() const;
  177. // Create tool array from tuple of handles
  178. virtual void SetFromTuple(const HTuple& handles);
  179. // Get tuple of handles for tool array
  180. virtual HTuple ConvertToTuple() const;
  181. protected:
  182. // Smart pointer to internal data container
  183. HDataCode2DArrayPtr *mArrayPtr;
  184. };
  185. }
  186. #endif