hal.hpp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. #ifndef CV_IMGPROC_HAL_HPP
  2. #define CV_IMGPROC_HAL_HPP
  3. #include "opencv2/core/cvdef.h"
  4. #include "opencv2/core/cvstd.hpp"
  5. #include "opencv2/core/utility.hpp"
  6. #include "opencv2/core/hal/interface.h"
  7. namespace cv { namespace hal {
  8. //! @addtogroup imgproc_hal_functions
  9. //! @{
  10. //---------------------------
  11. //! @cond IGNORED
  12. struct CV_EXPORTS Filter2D
  13. {
  14. CV_DEPRECATED static Ptr<hal::Filter2D> create(uchar * , size_t , int ,
  15. int , int ,
  16. int , int ,
  17. int , int ,
  18. int , double ,
  19. int , int ,
  20. bool , bool );
  21. virtual void apply(uchar * , size_t ,
  22. uchar * , size_t ,
  23. int , int ,
  24. int , int ,
  25. int , int ) = 0;
  26. virtual ~Filter2D() {}
  27. };
  28. struct CV_EXPORTS SepFilter2D
  29. {
  30. CV_DEPRECATED static Ptr<hal::SepFilter2D> create(int , int , int ,
  31. uchar * , int ,
  32. uchar * , int ,
  33. int , int ,
  34. double , int );
  35. virtual void apply(uchar * , size_t ,
  36. uchar * , size_t ,
  37. int , int ,
  38. int , int ,
  39. int , int ) = 0;
  40. virtual ~SepFilter2D() {}
  41. };
  42. struct CV_EXPORTS Morph
  43. {
  44. CV_DEPRECATED static Ptr<hal::Morph> create(int , int , int , int , int ,
  45. int , uchar * , size_t ,
  46. int , int ,
  47. int , int ,
  48. int , const double *,
  49. int , bool , bool );
  50. virtual void apply(uchar * , size_t , uchar * , size_t , int , int ,
  51. int , int , int , int ,
  52. int , int , int , int ) = 0;
  53. virtual ~Morph() {}
  54. };
  55. //! @endcond
  56. //---------------------------
  57. CV_EXPORTS void filter2D(int stype, int dtype, int kernel_type,
  58. uchar * src_data, size_t src_step,
  59. uchar * dst_data, size_t dst_step,
  60. int width, int height,
  61. int full_width, int full_height,
  62. int offset_x, int offset_y,
  63. uchar * kernel_data, size_t kernel_step,
  64. int kernel_width, int kernel_height,
  65. int anchor_x, int anchor_y,
  66. double delta, int borderType,
  67. bool isSubmatrix);
  68. CV_EXPORTS void sepFilter2D(int stype, int dtype, int ktype,
  69. uchar * src_data, size_t src_step,
  70. uchar * dst_data, size_t dst_step,
  71. int width, int height,
  72. int full_width, int full_height,
  73. int offset_x, int offset_y,
  74. uchar * kernelx_data, int kernelx_len,
  75. uchar * kernely_data, int kernely_len,
  76. int anchor_x, int anchor_y,
  77. double delta, int borderType);
  78. CV_EXPORTS void morph(int op, int src_type, int dst_type,
  79. uchar * src_data, size_t src_step,
  80. uchar * dst_data, size_t dst_step,
  81. int width, int height,
  82. int roi_width, int roi_height, int roi_x, int roi_y,
  83. int roi_width2, int roi_height2, int roi_x2, int roi_y2,
  84. int kernel_type, uchar * kernel_data, size_t kernel_step,
  85. int kernel_width, int kernel_height, int anchor_x, int anchor_y,
  86. int borderType, const double borderValue[4],
  87. int iterations, bool isSubmatrix);
  88. CV_EXPORTS void resize(int src_type,
  89. const uchar * src_data, size_t src_step, int src_width, int src_height,
  90. uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
  91. double inv_scale_x, double inv_scale_y, int interpolation);
  92. CV_EXPORTS void warpAffine(int src_type,
  93. const uchar * src_data, size_t src_step, int src_width, int src_height,
  94. uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
  95. const double M[6], int interpolation, int borderType, const double borderValue[4]);
  96. CV_EXPORTS void warpAffineBlocklineNN(int *adelta, int *bdelta, short* xy, int X0, int Y0, int bw);
  97. CV_EXPORTS void warpAffineBlockline(int *adelta, int *bdelta, short* xy, short* alpha, int X0, int Y0, int bw);
  98. CV_EXPORTS void warpPerspective(int src_type,
  99. const uchar * src_data, size_t src_step, int src_width, int src_height,
  100. uchar * dst_data, size_t dst_step, int dst_width, int dst_height,
  101. const double M[9], int interpolation, int borderType, const double borderValue[4]);
  102. CV_EXPORTS void warpPerspectiveBlocklineNN(const double *M, short* xy, double X0, double Y0, double W0, int bw);
  103. CV_EXPORTS void warpPerspectiveBlockline(const double *M, short* xy, short* alpha, double X0, double Y0, double W0, int bw);
  104. CV_EXPORTS void cvtBGRtoBGR(const uchar * src_data, size_t src_step,
  105. uchar * dst_data, size_t dst_step,
  106. int width, int height,
  107. int depth, int scn, int dcn, bool swapBlue);
  108. CV_EXPORTS void cvtBGRtoBGR5x5(const uchar * src_data, size_t src_step,
  109. uchar * dst_data, size_t dst_step,
  110. int width, int height,
  111. int scn, bool swapBlue, int greenBits);
  112. CV_EXPORTS void cvtBGR5x5toBGR(const uchar * src_data, size_t src_step,
  113. uchar * dst_data, size_t dst_step,
  114. int width, int height,
  115. int dcn, bool swapBlue, int greenBits);
  116. CV_EXPORTS void cvtBGRtoGray(const uchar * src_data, size_t src_step,
  117. uchar * dst_data, size_t dst_step,
  118. int width, int height,
  119. int depth, int scn, bool swapBlue);
  120. CV_EXPORTS void cvtGraytoBGR(const uchar * src_data, size_t src_step,
  121. uchar * dst_data, size_t dst_step,
  122. int width, int height,
  123. int depth, int dcn);
  124. CV_EXPORTS void cvtBGR5x5toGray(const uchar * src_data, size_t src_step,
  125. uchar * dst_data, size_t dst_step,
  126. int width, int height,
  127. int greenBits);
  128. CV_EXPORTS void cvtGraytoBGR5x5(const uchar * src_data, size_t src_step,
  129. uchar * dst_data, size_t dst_step,
  130. int width, int height,
  131. int greenBits);
  132. CV_EXPORTS void cvtBGRtoYUV(const uchar * src_data, size_t src_step,
  133. uchar * dst_data, size_t dst_step,
  134. int width, int height,
  135. int depth, int scn, bool swapBlue, bool isCbCr,
  136. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  137. CV_EXPORTS void cvtYUVtoBGR(const uchar * src_data, size_t src_step,
  138. uchar * dst_data, size_t dst_step,
  139. int width, int height,
  140. int depth, int dcn, bool swapBlue, bool isCbCr,
  141. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  142. CV_EXPORTS void cvtBGRtoXYZ(const uchar * src_data, size_t src_step,
  143. uchar * dst_data, size_t dst_step,
  144. int width, int height,
  145. int depth, int scn, bool swapBlue);
  146. CV_EXPORTS void cvtXYZtoBGR(const uchar * src_data, size_t src_step,
  147. uchar * dst_data, size_t dst_step,
  148. int width, int height,
  149. int depth, int dcn, bool swapBlue);
  150. CV_EXPORTS void cvtBGRtoHSV(const uchar * src_data, size_t src_step,
  151. uchar * dst_data, size_t dst_step,
  152. int width, int height,
  153. int depth, int scn, bool swapBlue, bool isFullRange, bool isHSV);
  154. CV_EXPORTS void cvtHSVtoBGR(const uchar * src_data, size_t src_step,
  155. uchar * dst_data, size_t dst_step,
  156. int width, int height,
  157. int depth, int dcn, bool swapBlue, bool isFullRange, bool isHSV);
  158. CV_EXPORTS void cvtBGRtoLab(const uchar * src_data, size_t src_step,
  159. uchar * dst_data, size_t dst_step,
  160. int width, int height,
  161. int depth, int scn, bool swapBlue, bool isLab, bool srgb);
  162. CV_EXPORTS void cvtLabtoBGR(const uchar * src_data, size_t src_step,
  163. uchar * dst_data, size_t dst_step,
  164. int width, int height,
  165. int depth, int dcn, bool swapBlue, bool isLab, bool srgb);
  166. CV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,
  167. uchar * dst_data, size_t dst_step,
  168. int dst_width, int dst_height,
  169. int dcn, bool swapBlue, int uIdx,
  170. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  171. //! Separate Y and UV planes
  172. CV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_data, size_t src_step,
  173. uchar * dst_data, size_t dst_step,
  174. int dst_width, int dst_height,
  175. int dcn, bool swapBlue, int uIdx,
  176. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  177. CV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * y_data, size_t y_step, const uchar * uv_data, size_t uv_step,
  178. uchar * dst_data, size_t dst_step,
  179. int dst_width, int dst_height,
  180. int dcn, bool swapBlue, int uIdx,
  181. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  182. CV_EXPORTS void cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
  183. uchar * dst_data, size_t dst_step,
  184. int dst_width, int dst_height,
  185. int dcn, bool swapBlue, int uIdx,
  186. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  187. CV_EXPORTS void cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step,
  188. uchar * dst_data, size_t dst_step,
  189. int width, int height,
  190. int scn, bool swapBlue, int uIdx,
  191. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  192. //! Separate Y and UV planes
  193. CV_EXPORTS void cvtBGRtoTwoPlaneYUV(const uchar * src_data, size_t src_step,
  194. uchar * y_data, uchar * uv_data, size_t dst_step,
  195. int width, int height,
  196. int scn, bool swapBlue, int uIdx);
  197. CV_EXPORTS void cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step,
  198. uchar * dst_data, size_t dst_step,
  199. int width, int height,
  200. int dcn, bool swapBlue, int uIdx, int ycn,
  201. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  202. CV_EXPORTS void cvtOnePlaneBGRtoYUV(const uchar * src_data, size_t src_step,
  203. uchar * dst_data, size_t dst_step,
  204. int width, int height,
  205. int scn, bool swapBlue, int uIdx, int ycn,
  206. AlgorithmHint hint = ALGO_HINT_DEFAULT);
  207. CV_EXPORTS void cvtRGBAtoMultipliedRGBA(const uchar * src_data, size_t src_step,
  208. uchar * dst_data, size_t dst_step,
  209. int width, int height);
  210. CV_EXPORTS void cvtMultipliedRGBAtoRGBA(const uchar * src_data, size_t src_step,
  211. uchar * dst_data, size_t dst_step,
  212. int width, int height);
  213. CV_EXPORTS void integral(int depth, int sdepth, int sqdepth,
  214. const uchar* src, size_t srcstep,
  215. uchar* sum, size_t sumstep,
  216. uchar* sqsum, size_t sqsumstep,
  217. uchar* tilted, size_t tstep,
  218. int width, int height, int cn);
  219. //! @}
  220. }}
  221. #endif // CV_IMGPROC_HAL_HPP