HBaseGP.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*****************************************************************************
  2. * HBaseGP.h
  3. *****************************************************************************
  4. *
  5. * Project: HALCON/libhalcon
  6. * Description: Basic tools
  7. *
  8. * (c) 1996-2022 by MVTec Software GmbH
  9. * www.mvtec.com
  10. *
  11. *****************************************************************************
  12. *
  13. *
  14. */
  15. #ifndef HBASEGP_H
  16. #define HBASEGP_H
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif
  20. extern HLibExport Herror HSetImageTime(Hproc_handle proc_handle,
  21. Himage* image);
  22. extern HLibExport Herror HImageName2Type(const char* str, int* kind);
  23. extern HLibExport Herror HPrepNewImage(Hproc_handle proc_handle, HIMGDIM width,
  24. HIMGDIM height);
  25. extern HLibExport double Hatan2(double x, double y);
  26. extern HLibExport Herror HStripQuotes(Hproc_handle proc_handle, char* in,
  27. char** out);
  28. /* for some functions we have an old version without the Hproc_handle parameter
  29. * -> keep them for binary compatibility (The progress versions before
  30. * HALCON 18.12 must be binary compatible with all current
  31. * image acquisition interfaces released with HALCON 13)
  32. * and a new version with Hproc_handle for optimizing the memory allocation */
  33. extern HLibExport char* HGetHalconRoot(void);
  34. extern HLibExport char* HGetHalconRootPh(Hproc_handle ph);
  35. #if defined(__APPLE__)
  36. extern HLibExport char* HGetHalconFrameworkRootPh(Hproc_handle ph);
  37. #endif
  38. extern HLibExport char* HGetHalconLibraryPath(void);
  39. extern HLibExport char* HGetHalconLibraryPathPh(Hproc_handle ph);
  40. extern HLibExport bool HSetEnv(const char* name, const char* value);
  41. extern HLibExport bool HSetEnvPh(Hproc_handle ph, const char* name,
  42. const char* value);
  43. extern HLibExport char* HGetEnv(const char* name);
  44. extern HLibExport char* HGetEnvPh(Hproc_handle ph, const char* name);
  45. extern HLibExport void HGetEnvFree(char* mem);
  46. extern HLibExport Herror HGetEnvFreePh(Hproc_handle ph, char* mem);
  47. extern HLibExport char* HGetEnvRaw(Hproc_handle ph, const char* name);
  48. extern HLibExport Herror HIncrRL(Hproc_handle proc_handle);
  49. extern HLibExport Herror HIncrRLNum(Hproc_handle proc_handle, size_t num);
  50. HC_DEPRECATED("HCopyData is deprecated, please use memcpy instead.")
  51. extern HLibExport Herror HCopyData(const void* source, void* destination,
  52. size_t size);
  53. HC_DEPRECATED("HSetData is deprecated, please use memset instead.")
  54. extern HLibExport Herror HSetData(void* c, int val, size_t size);
  55. #define HBackupDataLocal(PROC_HANDLE, SRC_PTR, NUM, DEST_PTR) \
  56. HXBackupDataLocal(PROC_HANDLE, (const void*)SRC_PTR, \
  57. sizeof(*SRC_PTR) * NUM, (void*)(DEST_PTR))
  58. extern HLibExport Herror HXBackupDataLocal(Hproc_handle proc_id,
  59. const void* source, size_t size,
  60. void* destination);
  61. #define HRestoreData(SRC_PTR, NUM, DEST_PTR) \
  62. memcpy((DEST_PTR), (SRC_PTR), sizeof(*(SRC_PTR)) * NUM)
  63. HC_DEPRECATED("HClearData is deprecated, please use memset instead.")
  64. extern HLibExport Herror HClearData(void* c, size_t size);
  65. extern HLibExport Herror HCopyImage(const Himage* in, Himage* out);
  66. extern HLibExport Herror HClearImage(Himage* image);
  67. extern HLibExport Herror HSetImage(Himage* image, double grayval);
  68. extern HLibExport Herror HAdaptImsize(Hproc_handle proc_handle, HIMGDIM width,
  69. HIMGDIM height);
  70. extern HLibExport Herror HFreeTmpImage(Hproc_handle proc_handle,
  71. Himage* image);
  72. extern HLibExport Herror HTmpImage(Hproc_handle proc_handle, Himage* image,
  73. int kind, HIMGDIM width, HIMGDIM height,
  74. bool clear);
  75. extern HLibExport Herror HFreeLocalImage(Hproc_handle proc_handle,
  76. Himage* image);
  77. extern HLibExport Herror HLocalImageToGlobal(Hproc_handle proc_handle,
  78. Himage* image);
  79. extern HLibExport Herror HLocalImage(Hproc_handle proc_handle, Himage* image,
  80. int kind, HIMGDIM width, HIMGDIM height,
  81. bool clear);
  82. extern HLibExport Herror HCrImage(Hproc_handle proc_handle, Hkey key_in,
  83. int num, int type, HIMGDIM width,
  84. HIMGDIM height, Hkey* key_out,
  85. Himage* image);
  86. extern HLibExport Herror HCrImageMatrix(Hproc_handle proc_id, Himage* image,
  87. Hkey key);
  88. extern HLibExport Herror HCrImageMKeyCkD(Hproc_handle proc_handle,
  89. Hrlregion* domain[], Hkey key_in[],
  90. int num_keys, int num, int type,
  91. HIMGDIM width, HIMGDIM height,
  92. Hkey* key_out, Himage* image);
  93. extern HLibExport Herror HCrImageMKey(Hproc_handle proc_handle, Hkey key_in[],
  94. int num_keys, int num, int type,
  95. HIMGDIM width, HIMGDIM height,
  96. Hkey* key_out, Himage* image);
  97. extern HLibExport Herror HFreeImage(Hproc_handle proc_handle, Himage* image);
  98. extern HLibExport Herror HNewImage(Hproc_handle proc_handle, Himage* image,
  99. int kind, HIMGDIM width, HIMGDIM height);
  100. extern HLibExport Herror HAllocImageMatrix(Hproc_handle proc_handle,
  101. Himage* image, int kind,
  102. HIMGDIM width, HIMGDIM height,
  103. bool clear);
  104. extern HLibExport Herror HNewImagePtr(Hproc_handle proc_handle, Himage* image,
  105. int kind, HIMGDIM width, HIMGDIM height,
  106. void* data, bool initImg);
  107. Herror HSortDouble(Hproc_handle proc_handle, double* array, INT4_8 num,
  108. bool ascending);
  109. Herror HSortINT4_8(Hproc_handle proc_handle, INT4_8* array, INT4_8 num,
  110. bool ascending);
  111. Herror HSortString(Hproc_handle proc_handle, char** array, INT4_8 num,
  112. bool ascending);
  113. Herror HSortHcpar(Hproc_handle proc_handle, Hcpar* array, INT4_8 num,
  114. bool ascending);
  115. #if defined(__cplusplus)
  116. }
  117. #endif
  118. #endif