transform.hpp 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. /*M///////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
  4. //
  5. // By downloading, copying, installing or using the software you agree to this license.
  6. // If you do not agree to this license, do not download, install,
  7. // copy or use the software.
  8. //
  9. //
  10. // License Agreement
  11. // For Open Source Computer Vision Library
  12. //
  13. // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
  14. // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
  15. // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
  16. // Third party copyrights are property of their respective owners.
  17. //
  18. // Redistribution and use in source and binary forms, with or without modification,
  19. // are permitted provided that the following conditions are met:
  20. //
  21. // * Redistribution's of source code must retain the above copyright notice,
  22. // this list of conditions and the following disclaimer.
  23. //
  24. // * Redistribution's in binary form must reproduce the above copyright notice,
  25. // this list of conditions and the following disclaimer in the documentation
  26. // and/or other materials provided with the distribution.
  27. //
  28. // * The name of the copyright holders may not be used to endorse or promote products
  29. // derived from this software without specific prior written permission.
  30. //
  31. // This software is provided by the copyright holders and contributors "as is" and
  32. // any express or implied warranties, including, but not limited to, the implied
  33. // warranties of merchantability and fitness for a particular purpose are disclaimed.
  34. // In no event shall the Intel Corporation or contributors be liable for any direct,
  35. // indirect, incidental, special, exemplary, or consequential damages
  36. // (including, but not limited to, procurement of substitute goods or services;
  37. // loss of use, data, or profits; or business interruption) however caused
  38. // and on any theory of liability, whether in contract, strict liability,
  39. // or tort (including negligence or otherwise) arising in any way out of
  40. // the use of this software, even if advised of the possibility of such damage.
  41. //
  42. //M*/
  43. #pragma once
  44. #ifndef OPENCV_CUDEV_GRID_TRANSFORM_HPP
  45. #define OPENCV_CUDEV_GRID_TRANSFORM_HPP
  46. #include "../common.hpp"
  47. #include "../util/tuple.hpp"
  48. #include "../ptr2d/traits.hpp"
  49. #include "../ptr2d/gpumat.hpp"
  50. #include "../ptr2d/glob.hpp"
  51. #include "../ptr2d/mask.hpp"
  52. #include "../ptr2d/zip.hpp"
  53. #include "detail/transform.hpp"
  54. namespace cv { namespace cudev {
  55. //! @addtogroup cudev
  56. //! @{
  57. template <class Policy, class SrcPtr, typename DstType, class UnOp, class MaskPtr>
  58. __host__ void gridTransformUnary_(const SrcPtr& src, GpuMat_<DstType>& dst, const UnOp& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  59. {
  60. const int rows = getRows(src);
  61. const int cols = getCols(src);
  62. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  63. dst.create(rows, cols);
  64. grid_transform_detail::transform_unary<Policy>(shrinkPtr(src), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream));
  65. }
  66. template <class Policy, class SrcPtr, typename DstType, class UnOp, class MaskPtr>
  67. __host__ void gridTransformUnary_(const SrcPtr& src, const GlobPtrSz<DstType>& dst, const UnOp& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  68. {
  69. const int rows = getRows(src);
  70. const int cols = getCols(src);
  71. CV_Assert( getRows(dst) == rows && getCols(dst) == cols );
  72. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  73. grid_transform_detail::transform_unary<Policy>(shrinkPtr(src), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream));
  74. }
  75. template <class Policy, class SrcPtr, typename DstType, class UnOp>
  76. __host__ void gridTransformUnary_(const SrcPtr& src, GpuMat_<DstType>& dst, const UnOp& op, Stream& stream = Stream::Null())
  77. {
  78. const int rows = getRows(src);
  79. const int cols = getCols(src);
  80. dst.create(rows, cols);
  81. grid_transform_detail::transform_unary<Policy>(shrinkPtr(src), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
  82. }
  83. template <class Policy, class SrcPtr, typename DstType, class UnOp>
  84. __host__ void gridTransformUnary_(const SrcPtr& src, const GlobPtrSz<DstType>& dst, const UnOp& op, Stream& stream = Stream::Null())
  85. {
  86. const int rows = getRows(src);
  87. const int cols = getCols(src);
  88. CV_Assert( getRows(dst) == rows && getCols(dst) == cols );
  89. grid_transform_detail::transform_unary<Policy>(shrinkPtr(src), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
  90. }
  91. template <class Policy, class SrcPtr1, class SrcPtr2, typename DstType, class BinOp, class MaskPtr>
  92. __host__ void gridTransformBinary_(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const BinOp& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  93. {
  94. const int rows = getRows(src1);
  95. const int cols = getCols(src1);
  96. CV_Assert( getRows(src2) == rows && getCols(src2) == cols );
  97. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  98. dst.create(rows, cols);
  99. grid_transform_detail::transform_binary<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream));
  100. }
  101. template <class Policy, class SrcPtr1, class SrcPtr2, typename DstType, class BinOp, class MaskPtr>
  102. __host__ void gridTransformBinary_(const SrcPtr1& src1, const SrcPtr2& src2, const GlobPtrSz<DstType>& dst, const BinOp& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  103. {
  104. const int rows = getRows(src1);
  105. const int cols = getCols(src1);
  106. CV_Assert( getRows(dst) == rows && getCols(dst) == cols );
  107. CV_Assert( getRows(src2) == rows && getCols(src2) == cols );
  108. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  109. grid_transform_detail::transform_binary<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream));
  110. }
  111. template <class Policy, class SrcPtr1, class SrcPtr2, typename DstType, class BinOp>
  112. __host__ void gridTransformBinary_(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const BinOp& op, Stream& stream = Stream::Null())
  113. {
  114. const int rows = getRows(src1);
  115. const int cols = getCols(src1);
  116. CV_Assert( getRows(src2) == rows && getCols(src2) == cols );
  117. dst.create(rows, cols);
  118. grid_transform_detail::transform_binary<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
  119. }
  120. template <class Policy, class SrcPtr1, class SrcPtr2, typename DstType, class BinOp>
  121. __host__ void gridTransformBinary_(const SrcPtr1& src1, const SrcPtr2& src2, const GlobPtrSz<DstType>& dst, const BinOp& op, Stream& stream = Stream::Null())
  122. {
  123. const int rows = getRows(src1);
  124. const int cols = getCols(src1);
  125. CV_Assert( getRows(dst) == rows && getCols(dst) == cols );
  126. CV_Assert( getRows(src2) == rows && getCols(src2) == cols );
  127. grid_transform_detail::transform_binary<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
  128. }
  129. template <class Policy, class SrcPtr, typename D0, typename D1, class OpTuple, class MaskPtr>
  130. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  131. {
  132. CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );
  133. const int rows = getRows(src);
  134. const int cols = getCols(src);
  135. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  136. get<0>(dst).create(rows, cols);
  137. get<1>(dst).create(rows, cols);
  138. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  139. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
  140. op,
  141. shrinkPtr(mask),
  142. rows, cols,
  143. StreamAccessor::getStream(stream));
  144. }
  145. template <class Policy, class SrcPtr, typename D0, typename D1, class OpTuple, class MaskPtr>
  146. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1> >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  147. {
  148. CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );
  149. const int rows = getRows(src);
  150. const int cols = getCols(src);
  151. CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
  152. CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
  153. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  154. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  155. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
  156. op,
  157. shrinkPtr(mask),
  158. rows, cols,
  159. StreamAccessor::getStream(stream));
  160. }
  161. template <class Policy, class SrcPtr, typename D0, typename D1, class OpTuple>
  162. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  163. {
  164. CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );
  165. const int rows = getRows(src);
  166. const int cols = getCols(src);
  167. get<0>(dst).create(rows, cols);
  168. get<1>(dst).create(rows, cols);
  169. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  170. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
  171. op,
  172. WithOutMask(),
  173. rows, cols,
  174. StreamAccessor::getStream(stream));
  175. }
  176. template <class Policy, class SrcPtr, typename D0, typename D1, class OpTuple>
  177. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  178. {
  179. CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );
  180. const int rows = getRows(src);
  181. const int cols = getCols(src);
  182. CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
  183. CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
  184. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  185. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
  186. op,
  187. WithOutMask(),
  188. rows, cols,
  189. StreamAccessor::getStream(stream));
  190. }
  191. template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, class OpTuple, class MaskPtr>
  192. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>& >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  193. {
  194. CV_StaticAssert( tuple_size<OpTuple>::value == 3, "" );
  195. const int rows = getRows(src);
  196. const int cols = getCols(src);
  197. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  198. get<0>(dst).create(rows, cols);
  199. get<1>(dst).create(rows, cols);
  200. get<2>(dst).create(rows, cols);
  201. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  202. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst))),
  203. op,
  204. shrinkPtr(mask),
  205. rows, cols,
  206. StreamAccessor::getStream(stream));
  207. }
  208. template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, class OpTuple, class MaskPtr>
  209. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2> >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  210. {
  211. CV_StaticAssert( tuple_size<OpTuple>::value == 3, "" );
  212. const int rows = getRows(src);
  213. const int cols = getCols(src);
  214. CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
  215. CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
  216. CV_Assert( getRows(get<2>(dst)) == rows && getCols(get<2>(dst)) == cols );
  217. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  218. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  219. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst))),
  220. op,
  221. shrinkPtr(mask),
  222. rows, cols,
  223. StreamAccessor::getStream(stream));
  224. }
  225. template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, class OpTuple>
  226. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  227. {
  228. CV_StaticAssert( tuple_size<OpTuple>::value == 3, "" );
  229. const int rows = getRows(src);
  230. const int cols = getCols(src);
  231. get<0>(dst).create(rows, cols);
  232. get<1>(dst).create(rows, cols);
  233. get<2>(dst).create(rows, cols);
  234. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  235. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst))),
  236. op,
  237. WithOutMask(),
  238. rows, cols,
  239. StreamAccessor::getStream(stream));
  240. }
  241. template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, class OpTuple>
  242. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  243. {
  244. CV_StaticAssert( tuple_size<OpTuple>::value == 3, "" );
  245. const int rows = getRows(src);
  246. const int cols = getCols(src);
  247. CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
  248. CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
  249. CV_Assert( getRows(get<2>(dst)) == rows && getCols(get<2>(dst)) == cols );
  250. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  251. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst))),
  252. op,
  253. WithOutMask(),
  254. rows, cols,
  255. StreamAccessor::getStream(stream));
  256. }
  257. template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple, class MaskPtr>
  258. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>&, GpuMat_<D3>& >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  259. {
  260. CV_StaticAssert( tuple_size<OpTuple>::value == 4, "" );
  261. const int rows = getRows(src);
  262. const int cols = getCols(src);
  263. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  264. get<0>(dst).create(rows, cols);
  265. get<1>(dst).create(rows, cols);
  266. get<2>(dst).create(rows, cols);
  267. get<3>(dst).create(rows, cols);
  268. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  269. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst), get<3>(dst))),
  270. op,
  271. shrinkPtr(mask),
  272. rows, cols,
  273. StreamAccessor::getStream(stream));
  274. }
  275. template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple, class MaskPtr>
  276. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2>, GlobPtrSz<D3> >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  277. {
  278. CV_StaticAssert( tuple_size<OpTuple>::value == 4, "" );
  279. const int rows = getRows(src);
  280. const int cols = getCols(src);
  281. CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
  282. CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
  283. CV_Assert( getRows(get<2>(dst)) == rows && getCols(get<2>(dst)) == cols );
  284. CV_Assert( getRows(get<3>(dst)) == rows && getCols(get<3>(dst)) == cols );
  285. CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
  286. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  287. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst), get<3>(dst))),
  288. op,
  289. shrinkPtr(mask),
  290. rows, cols,
  291. StreamAccessor::getStream(stream));
  292. }
  293. template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple>
  294. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>&, GpuMat_<D3>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  295. {
  296. CV_StaticAssert( tuple_size<OpTuple>::value == 4, "" );
  297. const int rows = getRows(src);
  298. const int cols = getCols(src);
  299. get<0>(dst).create(rows, cols);
  300. get<1>(dst).create(rows, cols);
  301. get<2>(dst).create(rows, cols);
  302. get<3>(dst).create(rows, cols);
  303. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  304. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst), get<3>(dst))),
  305. op,
  306. WithOutMask(),
  307. rows, cols,
  308. StreamAccessor::getStream(stream));
  309. }
  310. template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple>
  311. __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2>, GlobPtrSz<D3> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  312. {
  313. CV_StaticAssert( tuple_size<OpTuple>::value == 4, "" );
  314. const int rows = getRows(src);
  315. const int cols = getCols(src);
  316. CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
  317. CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
  318. CV_Assert( getRows(get<2>(dst)) == rows && getCols(get<2>(dst)) == cols );
  319. CV_Assert( getRows(get<3>(dst)) == rows && getCols(get<3>(dst)) == cols );
  320. grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
  321. shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst), get<3>(dst))),
  322. op,
  323. WithOutMask(),
  324. rows, cols,
  325. StreamAccessor::getStream(stream));
  326. }
  327. // Default Policy
  328. struct DefaultTransformPolicy
  329. {
  330. enum {
  331. block_size_x = 32,
  332. block_size_y = 8,
  333. shift = 4
  334. };
  335. };
  336. template <class SrcPtr, typename DstType, class Op, class MaskPtr>
  337. __host__ void gridTransformUnary(const SrcPtr& src, GpuMat_<DstType>& dst, const Op& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  338. {
  339. gridTransformUnary_<DefaultTransformPolicy>(src, dst, op, mask, stream);
  340. }
  341. template <class SrcPtr, typename DstType, class Op, class MaskPtr>
  342. __host__ void gridTransformUnary(const SrcPtr& src, const GlobPtrSz<DstType>& dst, const Op& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  343. {
  344. gridTransformUnary_<DefaultTransformPolicy>(src, dst, op, mask, stream);
  345. }
  346. template <class SrcPtr, typename DstType, class Op>
  347. __host__ void gridTransformUnary(const SrcPtr& src, GpuMat_<DstType>& dst, const Op& op, Stream& stream = Stream::Null())
  348. {
  349. gridTransformUnary_<DefaultTransformPolicy>(src, dst, op, stream);
  350. }
  351. template <class SrcPtr, typename DstType, class Op>
  352. __host__ void gridTransformUnary(const SrcPtr& src, const GlobPtrSz<DstType>& dst, const Op& op, Stream& stream = Stream::Null())
  353. {
  354. gridTransformUnary_<DefaultTransformPolicy>(src, dst, op, stream);
  355. }
  356. template <class SrcPtr1, class SrcPtr2, typename DstType, class Op, class MaskPtr>
  357. __host__ void gridTransformBinary(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const Op& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  358. {
  359. gridTransformBinary_<DefaultTransformPolicy>(src1, src2, dst, op, mask, stream);
  360. }
  361. template <class SrcPtr1, class SrcPtr2, typename DstType, class Op, class MaskPtr>
  362. __host__ void gridTransformBinary(const SrcPtr1& src1, const SrcPtr2& src2, const GlobPtrSz<DstType>& dst, const Op& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  363. {
  364. gridTransformBinary_<DefaultTransformPolicy>(src1, src2, dst, op, mask, stream);
  365. }
  366. template <class SrcPtr1, class SrcPtr2, typename DstType, class Op>
  367. __host__ void gridTransformBinary(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const Op& op, Stream& stream = Stream::Null())
  368. {
  369. gridTransformBinary_<DefaultTransformPolicy>(src1, src2, dst, op, stream);
  370. }
  371. template <class SrcPtr1, class SrcPtr2, typename DstType, class Op>
  372. __host__ void gridTransformBinary(const SrcPtr1& src1, const SrcPtr2& src2, const GlobPtrSz<DstType>& dst, const Op& op, Stream& stream = Stream::Null())
  373. {
  374. gridTransformBinary_<DefaultTransformPolicy>(src1, src2, dst, op, stream);
  375. }
  376. template <class SrcPtr, typename D0, typename D1, class OpTuple, class MaskPtr>
  377. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  378. {
  379. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
  380. }
  381. template <class SrcPtr, typename D0, typename D1, class OpTuple, class MaskPtr>
  382. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1> >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  383. {
  384. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
  385. }
  386. template <class SrcPtr, typename D0, typename D1, class OpTuple>
  387. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  388. {
  389. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
  390. }
  391. template <class SrcPtr, typename D0, typename D1, class OpTuple>
  392. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  393. {
  394. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
  395. }
  396. template <class SrcPtr, typename D0, typename D1, typename D2, class OpTuple, class MaskPtr>
  397. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>& >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  398. {
  399. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
  400. }
  401. template <class SrcPtr, typename D0, typename D1, typename D2, class OpTuple, class MaskPtr>
  402. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2> >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  403. {
  404. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
  405. }
  406. template <class SrcPtr, typename D0, typename D1, typename D2, class OpTuple>
  407. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  408. {
  409. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
  410. }
  411. template <class SrcPtr, typename D0, typename D1, typename D2, class OpTuple>
  412. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  413. {
  414. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
  415. }
  416. template <class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple, class MaskPtr>
  417. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>&, GpuMat_<D3>& >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  418. {
  419. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
  420. }
  421. template <class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple, class MaskPtr>
  422. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2>, GlobPtrSz<D3> >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
  423. {
  424. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
  425. }
  426. template <class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple>
  427. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>&, GpuMat_<D3>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  428. {
  429. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
  430. }
  431. template <class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple>
  432. __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2>, GlobPtrSz<D3> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
  433. {
  434. gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
  435. }
  436. //! @}
  437. }}
  438. #endif