HColorTransLUT.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 22.05
  3. * Usage: Interface to C++
  4. *
  5. * Software by: MVTec Software GmbH, www.mvtec.com
  6. ***********************************************************/
  7. #ifndef HCPP_HCOLORTRANSLUT
  8. #define HCPP_HCOLORTRANSLUT
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a color space transformation lookup table
  12. class LIntExport HColorTransLUT : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HColorTransLUT():HHandle() {}
  17. // Copy constructor
  18. HColorTransLUT(const HColorTransLUT& source) : HHandle(source) {}
  19. // Copy constructor
  20. HColorTransLUT(const HHandle& handle);
  21. // Create HColorTransLUT from handle, taking ownership
  22. explicit HColorTransLUT(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 ('color_trans_lut')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /*****************************************************************************
  36. * Operator-based class constructors
  37. *****************************************************************************/
  38. // create_color_trans_lut: Creates the look-up-table for transformation of an image from the RGB color space to an arbitrary color space.
  39. explicit HColorTransLUT(const HString& ColorSpace, const HString& TransDirection, Hlong NumBits);
  40. // create_color_trans_lut: Creates the look-up-table for transformation of an image from the RGB color space to an arbitrary color space.
  41. explicit HColorTransLUT(const char* ColorSpace, const char* TransDirection, Hlong NumBits);
  42. #ifdef _WIN32
  43. // create_color_trans_lut: Creates the look-up-table for transformation of an image from the RGB color space to an arbitrary color space.
  44. explicit HColorTransLUT(const wchar_t* ColorSpace, const wchar_t* TransDirection, Hlong NumBits);
  45. #endif
  46. /***************************************************************************
  47. * Operators *
  48. ***************************************************************************/
  49. // Release the look-up-table needed for color space transformation.
  50. void ClearColorTransLut() const;
  51. // Color space transformation using pre-generated look-up-table.
  52. HImage ApplyColorTransLut(const HImage& Image1, const HImage& Image2, const HImage& Image3, HImage* ImageResult2, HImage* ImageResult3) const;
  53. // Creates the look-up-table for transformation of an image from the RGB color space to an arbitrary color space.
  54. void CreateColorTransLut(const HString& ColorSpace, const HString& TransDirection, Hlong NumBits);
  55. // Creates the look-up-table for transformation of an image from the RGB color space to an arbitrary color space.
  56. void CreateColorTransLut(const char* ColorSpace, const char* TransDirection, Hlong NumBits);
  57. #ifdef _WIN32
  58. // Creates the look-up-table for transformation of an image from the RGB color space to an arbitrary color space.
  59. void CreateColorTransLut(const wchar_t* ColorSpace, const wchar_t* TransDirection, Hlong NumBits);
  60. #endif
  61. };
  62. // forward declarations and types for internal array implementation
  63. template<class T> class HSmartPtr;
  64. template<class T> class HHandleBaseArrayRef;
  65. typedef HHandleBaseArrayRef<HColorTransLUT> HColorTransLUTArrayRef;
  66. typedef HSmartPtr< HColorTransLUTArrayRef > HColorTransLUTArrayPtr;
  67. // Represents multiple tool instances
  68. class LIntExport HColorTransLUTArray : public HHandleBaseArray
  69. {
  70. public:
  71. // Create empty array
  72. HColorTransLUTArray();
  73. // Create array from native array of tool instances
  74. HColorTransLUTArray(const HColorTransLUT* classes, Hlong length);
  75. // Copy constructor
  76. HColorTransLUTArray(const HColorTransLUTArray &tool_array);
  77. // Destructor
  78. virtual ~HColorTransLUTArray();
  79. // Assignment operator
  80. HColorTransLUTArray &operator=(const HColorTransLUTArray &tool_array);
  81. // Clears array and all tool instances
  82. virtual void Clear();
  83. // Get array of native tool instances
  84. const HColorTransLUT* Tools() const;
  85. // Get number of tools
  86. virtual Hlong Length() const;
  87. // Create tool array from tuple of handles
  88. virtual void SetFromTuple(const HTuple& handles);
  89. // Get tuple of handles for tool array
  90. virtual HTuple ConvertToTuple() const;
  91. protected:
  92. // Smart pointer to internal data container
  93. HColorTransLUTArrayPtr *mArrayPtr;
  94. };
  95. }
  96. #endif