HTextResult.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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_HTEXTRESULT
  8. #define HCPP_HTEXTRESULT
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a text segmentation result.
  12. class LIntExport HTextResult : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HTextResult():HHandle() {}
  17. // Copy constructor
  18. HTextResult(const HTextResult& source) : HHandle(source) {}
  19. // Copy constructor
  20. HTextResult(const HHandle& handle);
  21. // Create HTextResult from handle, taking ownership
  22. explicit HTextResult(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 ('text_result')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /*****************************************************************************
  36. * Operator-based class constructors
  37. *****************************************************************************/
  38. // find_text: Find text in an image.
  39. explicit HTextResult(const HImage& Image, const HTextModel& TextModel);
  40. /***************************************************************************
  41. * Operators *
  42. ***************************************************************************/
  43. // Clear a text result.
  44. static void ClearTextResult(const HTextResultArray& TextResultID);
  45. // Clear a text result.
  46. void ClearTextResult() const;
  47. // Query an iconic value of a text segmentation result.
  48. HObject GetTextObject(const HTuple& ResultName) const;
  49. // Query an iconic value of a text segmentation result.
  50. HObject GetTextObject(const HString& ResultName) const;
  51. // Query an iconic value of a text segmentation result.
  52. HObject GetTextObject(const char* ResultName) const;
  53. #ifdef _WIN32
  54. // Query an iconic value of a text segmentation result.
  55. HObject GetTextObject(const wchar_t* ResultName) const;
  56. #endif
  57. // Query a control value of a text segmentation result.
  58. HTuple GetTextResult(const HTuple& ResultName) const;
  59. // Query a control value of a text segmentation result.
  60. HTuple GetTextResult(const HString& ResultName) const;
  61. // Query a control value of a text segmentation result.
  62. HTuple GetTextResult(const char* ResultName) const;
  63. #ifdef _WIN32
  64. // Query a control value of a text segmentation result.
  65. HTuple GetTextResult(const wchar_t* ResultName) const;
  66. #endif
  67. // Find text in an image.
  68. void FindText(const HImage& Image, const HTextModel& TextModel);
  69. };
  70. // forward declarations and types for internal array implementation
  71. template<class T> class HSmartPtr;
  72. template<class T> class HHandleBaseArrayRef;
  73. typedef HHandleBaseArrayRef<HTextResult> HTextResultArrayRef;
  74. typedef HSmartPtr< HTextResultArrayRef > HTextResultArrayPtr;
  75. // Represents multiple tool instances
  76. class LIntExport HTextResultArray : public HHandleBaseArray
  77. {
  78. public:
  79. // Create empty array
  80. HTextResultArray();
  81. // Create array from native array of tool instances
  82. HTextResultArray(HTextResult* classes, Hlong length);
  83. // Copy constructor
  84. HTextResultArray(const HTextResultArray &tool_array);
  85. // Destructor
  86. virtual ~HTextResultArray();
  87. // Assignment operator
  88. HTextResultArray &operator=(const HTextResultArray &tool_array);
  89. // Clears array and all tool instances
  90. virtual void Clear();
  91. // Get array of native tool instances
  92. const HTextResult* Tools() const;
  93. // Get number of tools
  94. virtual Hlong Length() const;
  95. // Create tool array from tuple of handles
  96. virtual void SetFromTuple(const HTuple& handles);
  97. // Get tuple of handles for tool array
  98. virtual HTuple ConvertToTuple() const;
  99. protected:
  100. // Smart pointer to internal data container
  101. HTextResultArrayPtr *mArrayPtr;
  102. };
  103. }
  104. #endif