Home | History | Annotate | Download | only in grid
      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 
     44 #pragma once
     45 
     46 #ifndef __OPENCV_CUDEV_GRID_TRANSFORM_HPP__
     47 #define __OPENCV_CUDEV_GRID_TRANSFORM_HPP__
     48 
     49 #include "../common.hpp"
     50 #include "../util/tuple.hpp"
     51 #include "../ptr2d/traits.hpp"
     52 #include "../ptr2d/gpumat.hpp"
     53 #include "../ptr2d/glob.hpp"
     54 #include "../ptr2d/mask.hpp"
     55 #include "../ptr2d/zip.hpp"
     56 #include "detail/transform.hpp"
     57 
     58 namespace cv { namespace cudev {
     59 
     60 //! @addtogroup cudev
     61 //! @{
     62 
     63 template <class Policy, class SrcPtr, typename DstType, class UnOp, class MaskPtr>
     64 __host__ void gridTransformUnary_(const SrcPtr& src, GpuMat_<DstType>& dst, const UnOp& op, const MaskPtr& mask, Stream& stream = Stream::Null())
     65 {
     66     const int rows = getRows(src);
     67     const int cols = getCols(src);
     68 
     69     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
     70 
     71     dst.create(rows, cols);
     72 
     73     grid_transform_detail::transform_unary<Policy>(shrinkPtr(src), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream));
     74 }
     75 
     76 template <class Policy, class SrcPtr, typename DstType, class UnOp, class MaskPtr>
     77 __host__ void gridTransformUnary_(const SrcPtr& src, const GlobPtrSz<DstType>& dst, const UnOp& op, const MaskPtr& mask, Stream& stream = Stream::Null())
     78 {
     79     const int rows = getRows(src);
     80     const int cols = getCols(src);
     81 
     82     CV_Assert( getRows(dst) == rows && getCols(dst) == cols );
     83     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
     84 
     85     grid_transform_detail::transform_unary<Policy>(shrinkPtr(src), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream));
     86 }
     87 
     88 template <class Policy, class SrcPtr, typename DstType, class UnOp>
     89 __host__ void gridTransformUnary_(const SrcPtr& src, GpuMat_<DstType>& dst, const UnOp& op, Stream& stream = Stream::Null())
     90 {
     91     const int rows = getRows(src);
     92     const int cols = getCols(src);
     93 
     94     dst.create(rows, cols);
     95 
     96     grid_transform_detail::transform_unary<Policy>(shrinkPtr(src), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
     97 }
     98 
     99 template <class Policy, class SrcPtr, typename DstType, class UnOp>
    100 __host__ void gridTransformUnary_(const SrcPtr& src, const GlobPtrSz<DstType>& dst, const UnOp& op, Stream& stream = Stream::Null())
    101 {
    102     const int rows = getRows(src);
    103     const int cols = getCols(src);
    104 
    105     CV_Assert( getRows(dst) == rows && getCols(dst) == cols );
    106 
    107     grid_transform_detail::transform_unary<Policy>(shrinkPtr(src), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
    108 }
    109 
    110 template <class Policy, class SrcPtr1, class SrcPtr2, typename DstType, class BinOp, class MaskPtr>
    111 __host__ void gridTransformBinary_(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const BinOp& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    112 {
    113     const int rows = getRows(src1);
    114     const int cols = getCols(src1);
    115 
    116     CV_Assert( getRows(src2) == rows && getCols(src2) == cols );
    117     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
    118 
    119     dst.create(rows, cols);
    120 
    121     grid_transform_detail::transform_binary<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream));
    122 }
    123 
    124 template <class Policy, class SrcPtr1, class SrcPtr2, typename DstType, class BinOp, class MaskPtr>
    125 __host__ void gridTransformBinary_(const SrcPtr1& src1, const SrcPtr2& src2, const GlobPtrSz<DstType>& dst, const BinOp& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    126 {
    127     const int rows = getRows(src1);
    128     const int cols = getCols(src1);
    129 
    130     CV_Assert( getRows(dst) == rows && getCols(dst) == cols );
    131     CV_Assert( getRows(src2) == rows && getCols(src2) == cols );
    132     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
    133 
    134     grid_transform_detail::transform_binary<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream));
    135 }
    136 
    137 template <class Policy, class SrcPtr1, class SrcPtr2, typename DstType, class BinOp>
    138 __host__ void gridTransformBinary_(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const BinOp& op, Stream& stream = Stream::Null())
    139 {
    140     const int rows = getRows(src1);
    141     const int cols = getCols(src1);
    142 
    143     CV_Assert( getRows(src2) == rows && getCols(src2) == cols );
    144 
    145     dst.create(rows, cols);
    146 
    147     grid_transform_detail::transform_binary<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
    148 }
    149 
    150 template <class Policy, class SrcPtr1, class SrcPtr2, typename DstType, class BinOp>
    151 __host__ void gridTransformBinary_(const SrcPtr1& src1, const SrcPtr2& src2, const GlobPtrSz<DstType>& dst, const BinOp& op, Stream& stream = Stream::Null())
    152 {
    153     const int rows = getRows(src1);
    154     const int cols = getCols(src1);
    155 
    156     CV_Assert( getRows(dst) == rows && getCols(dst) == cols );
    157     CV_Assert( getRows(src2) == rows && getCols(src2) == cols );
    158 
    159     grid_transform_detail::transform_binary<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
    160 }
    161 
    162 template <class Policy, class SrcPtr, typename D0, typename D1, class OpTuple, class MaskPtr>
    163 __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    164 {
    165     CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );
    166 
    167     const int rows = getRows(src);
    168     const int cols = getCols(src);
    169 
    170     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
    171 
    172     get<0>(dst).create(rows, cols);
    173     get<1>(dst).create(rows, cols);
    174 
    175     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    176                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
    177                                                    op,
    178                                                    shrinkPtr(mask),
    179                                                    rows, cols,
    180                                                    StreamAccessor::getStream(stream));
    181 }
    182 
    183 template <class Policy, class SrcPtr, typename D0, typename D1, class OpTuple, class MaskPtr>
    184 __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1> >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    185 {
    186     CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );
    187 
    188     const int rows = getRows(src);
    189     const int cols = getCols(src);
    190 
    191     CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
    192     CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
    193     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
    194 
    195     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    196                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
    197                                                    op,
    198                                                    shrinkPtr(mask),
    199                                                    rows, cols,
    200                                                    StreamAccessor::getStream(stream));
    201 }
    202 
    203 template <class Policy, class SrcPtr, typename D0, typename D1, class OpTuple>
    204 __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    205 {
    206     CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );
    207 
    208     const int rows = getRows(src);
    209     const int cols = getCols(src);
    210 
    211     get<0>(dst).create(rows, cols);
    212     get<1>(dst).create(rows, cols);
    213 
    214     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    215                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
    216                                                    op,
    217                                                    WithOutMask(),
    218                                                    rows, cols,
    219                                                    StreamAccessor::getStream(stream));
    220 }
    221 
    222 template <class Policy, class SrcPtr, typename D0, typename D1, class OpTuple>
    223 __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    224 {
    225     CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );
    226 
    227     const int rows = getRows(src);
    228     const int cols = getCols(src);
    229 
    230     CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
    231     CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
    232 
    233     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    234                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
    235                                                    op,
    236                                                    WithOutMask(),
    237                                                    rows, cols,
    238                                                    StreamAccessor::getStream(stream));
    239 }
    240 
    241 template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, class OpTuple, class MaskPtr>
    242 __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())
    243 {
    244     CV_StaticAssert( tuple_size<OpTuple>::value == 3, "" );
    245 
    246     const int rows = getRows(src);
    247     const int cols = getCols(src);
    248 
    249     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
    250 
    251     get<0>(dst).create(rows, cols);
    252     get<1>(dst).create(rows, cols);
    253     get<2>(dst).create(rows, cols);
    254 
    255     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    256                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst))),
    257                                                    op,
    258                                                    shrinkPtr(mask),
    259                                                    rows, cols,
    260                                                    StreamAccessor::getStream(stream));
    261 }
    262 
    263 template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, class OpTuple, class MaskPtr>
    264 __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())
    265 {
    266     CV_StaticAssert( tuple_size<OpTuple>::value == 3, "" );
    267 
    268     const int rows = getRows(src);
    269     const int cols = getCols(src);
    270 
    271     CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
    272     CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
    273     CV_Assert( getRows(get<2>(dst)) == rows && getCols(get<2>(dst)) == cols );
    274     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
    275 
    276     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    277                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst))),
    278                                                    op,
    279                                                    shrinkPtr(mask),
    280                                                    rows, cols,
    281                                                    StreamAccessor::getStream(stream));
    282 }
    283 
    284 template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, class OpTuple>
    285 __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    286 {
    287     CV_StaticAssert( tuple_size<OpTuple>::value == 3, "" );
    288 
    289     const int rows = getRows(src);
    290     const int cols = getCols(src);
    291 
    292     get<0>(dst).create(rows, cols);
    293     get<1>(dst).create(rows, cols);
    294     get<2>(dst).create(rows, cols);
    295 
    296     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    297                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst))),
    298                                                    op,
    299                                                    WithOutMask(),
    300                                                    rows, cols,
    301                                                    StreamAccessor::getStream(stream));
    302 }
    303 
    304 template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, class OpTuple>
    305 __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    306 {
    307     CV_StaticAssert( tuple_size<OpTuple>::value == 3, "" );
    308 
    309     const int rows = getRows(src);
    310     const int cols = getCols(src);
    311 
    312     CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
    313     CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
    314     CV_Assert( getRows(get<2>(dst)) == rows && getCols(get<2>(dst)) == cols );
    315 
    316     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    317                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst))),
    318                                                    op,
    319                                                    WithOutMask(),
    320                                                    rows, cols,
    321                                                    StreamAccessor::getStream(stream));
    322 }
    323 
    324 template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple, class MaskPtr>
    325 __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())
    326 {
    327     CV_StaticAssert( tuple_size<OpTuple>::value == 4, "" );
    328 
    329     const int rows = getRows(src);
    330     const int cols = getCols(src);
    331 
    332     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
    333 
    334     get<0>(dst).create(rows, cols);
    335     get<1>(dst).create(rows, cols);
    336     get<2>(dst).create(rows, cols);
    337     get<3>(dst).create(rows, cols);
    338 
    339     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    340                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst), get<3>(dst))),
    341                                                    op,
    342                                                    shrinkPtr(mask),
    343                                                    rows, cols,
    344                                                    StreamAccessor::getStream(stream));
    345 }
    346 
    347 template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple, class MaskPtr>
    348 __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())
    349 {
    350     CV_StaticAssert( tuple_size<OpTuple>::value == 4, "" );
    351 
    352     const int rows = getRows(src);
    353     const int cols = getCols(src);
    354 
    355     CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
    356     CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
    357     CV_Assert( getRows(get<2>(dst)) == rows && getCols(get<2>(dst)) == cols );
    358     CV_Assert( getRows(get<3>(dst)) == rows && getCols(get<3>(dst)) == cols );
    359     CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
    360 
    361     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    362                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst), get<3>(dst))),
    363                                                    op,
    364                                                    shrinkPtr(mask),
    365                                                    rows, cols,
    366                                                    StreamAccessor::getStream(stream));
    367 }
    368 
    369 template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple>
    370 __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>&, GpuMat_<D3>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    371 {
    372     CV_StaticAssert( tuple_size<OpTuple>::value == 4, "" );
    373 
    374     const int rows = getRows(src);
    375     const int cols = getCols(src);
    376 
    377     get<0>(dst).create(rows, cols);
    378     get<1>(dst).create(rows, cols);
    379     get<2>(dst).create(rows, cols);
    380     get<3>(dst).create(rows, cols);
    381 
    382     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    383                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst), get<3>(dst))),
    384                                                    op,
    385                                                    WithOutMask(),
    386                                                    rows, cols,
    387                                                    StreamAccessor::getStream(stream));
    388 }
    389 
    390 template <class Policy, class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple>
    391 __host__ void gridTransformTuple_(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2>, GlobPtrSz<D3> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    392 {
    393     CV_StaticAssert( tuple_size<OpTuple>::value == 4, "" );
    394 
    395     const int rows = getRows(src);
    396     const int cols = getCols(src);
    397 
    398     CV_Assert( getRows(get<0>(dst)) == rows && getCols(get<0>(dst)) == cols );
    399     CV_Assert( getRows(get<1>(dst)) == rows && getCols(get<1>(dst)) == cols );
    400     CV_Assert( getRows(get<2>(dst)) == rows && getCols(get<2>(dst)) == cols );
    401     CV_Assert( getRows(get<3>(dst)) == rows && getCols(get<3>(dst)) == cols );
    402 
    403     grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
    404                                                    shrinkPtr(zipPtr(get<0>(dst), get<1>(dst), get<2>(dst), get<3>(dst))),
    405                                                    op,
    406                                                    WithOutMask(),
    407                                                    rows, cols,
    408                                                    StreamAccessor::getStream(stream));
    409 }
    410 
    411 // Default Policy
    412 
    413 struct DefaultTransformPolicy
    414 {
    415     enum {
    416         block_size_x = 32,
    417         block_size_y = 8,
    418         shift = 4
    419     };
    420 };
    421 
    422 template <class SrcPtr, typename DstType, class Op, class MaskPtr>
    423 __host__ void gridTransformUnary(const SrcPtr& src, GpuMat_<DstType>& dst, const Op& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    424 {
    425     gridTransformUnary_<DefaultTransformPolicy>(src, dst, op, mask, stream);
    426 }
    427 
    428 template <class SrcPtr, typename DstType, class Op, class MaskPtr>
    429 __host__ void gridTransformUnary(const SrcPtr& src, const GlobPtrSz<DstType>& dst, const Op& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    430 {
    431     gridTransformUnary_<DefaultTransformPolicy>(src, dst, op, mask, stream);
    432 }
    433 
    434 template <class SrcPtr, typename DstType, class Op>
    435 __host__ void gridTransformUnary(const SrcPtr& src, GpuMat_<DstType>& dst, const Op& op, Stream& stream = Stream::Null())
    436 {
    437     gridTransformUnary_<DefaultTransformPolicy>(src, dst, op, stream);
    438 }
    439 
    440 template <class SrcPtr, typename DstType, class Op>
    441 __host__ void gridTransformUnary(const SrcPtr& src, const GlobPtrSz<DstType>& dst, const Op& op, Stream& stream = Stream::Null())
    442 {
    443     gridTransformUnary_<DefaultTransformPolicy>(src, dst, op, stream);
    444 }
    445 
    446 template <class SrcPtr1, class SrcPtr2, typename DstType, class Op, class MaskPtr>
    447 __host__ void gridTransformBinary(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const Op& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    448 {
    449     gridTransformBinary_<DefaultTransformPolicy>(src1, src2, dst, op, mask, stream);
    450 }
    451 
    452 template <class SrcPtr1, class SrcPtr2, typename DstType, class Op, class MaskPtr>
    453 __host__ void gridTransformBinary(const SrcPtr1& src1, const SrcPtr2& src2, const GlobPtrSz<DstType>& dst, const Op& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    454 {
    455     gridTransformBinary_<DefaultTransformPolicy>(src1, src2, dst, op, mask, stream);
    456 }
    457 
    458 template <class SrcPtr1, class SrcPtr2, typename DstType, class Op>
    459 __host__ void gridTransformBinary(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const Op& op, Stream& stream = Stream::Null())
    460 {
    461     gridTransformBinary_<DefaultTransformPolicy>(src1, src2, dst, op, stream);
    462 }
    463 
    464 template <class SrcPtr1, class SrcPtr2, typename DstType, class Op>
    465 __host__ void gridTransformBinary(const SrcPtr1& src1, const SrcPtr2& src2, const GlobPtrSz<DstType>& dst, const Op& op, Stream& stream = Stream::Null())
    466 {
    467     gridTransformBinary_<DefaultTransformPolicy>(src1, src2, dst, op, stream);
    468 }
    469 
    470 template <class SrcPtr, typename D0, typename D1, class OpTuple, class MaskPtr>
    471 __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    472 {
    473     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
    474 }
    475 
    476 template <class SrcPtr, typename D0, typename D1, class OpTuple, class MaskPtr>
    477 __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1> >& dst, const OpTuple& op, const MaskPtr& mask, Stream& stream = Stream::Null())
    478 {
    479     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
    480 }
    481 
    482 template <class SrcPtr, typename D0, typename D1, class OpTuple>
    483 __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    484 {
    485     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
    486 }
    487 
    488 template <class SrcPtr, typename D0, typename D1, class OpTuple>
    489 __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    490 {
    491     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
    492 }
    493 
    494 template <class SrcPtr, typename D0, typename D1, typename D2, class OpTuple, class MaskPtr>
    495 __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())
    496 {
    497     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
    498 }
    499 
    500 template <class SrcPtr, typename D0, typename D1, typename D2, class OpTuple, class MaskPtr>
    501 __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())
    502 {
    503     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
    504 }
    505 
    506 template <class SrcPtr, typename D0, typename D1, typename D2, class OpTuple>
    507 __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    508 {
    509     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
    510 }
    511 
    512 template <class SrcPtr, typename D0, typename D1, typename D2, class OpTuple>
    513 __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    514 {
    515     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
    516 }
    517 
    518 template <class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple, class MaskPtr>
    519 __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())
    520 {
    521     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
    522 }
    523 
    524 template <class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple, class MaskPtr>
    525 __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())
    526 {
    527     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, mask, stream);
    528 }
    529 
    530 template <class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple>
    531 __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>&, GpuMat_<D2>&, GpuMat_<D3>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    532 {
    533     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
    534 }
    535 
    536 template <class SrcPtr, typename D0, typename D1, typename D2, typename D3, class OpTuple>
    537 __host__ void gridTransformTuple(const SrcPtr& src, const tuple< GlobPtrSz<D0>, GlobPtrSz<D1>, GlobPtrSz<D2>, GlobPtrSz<D3> >& dst, const OpTuple& op, Stream& stream = Stream::Null())
    538 {
    539     gridTransformTuple_<DefaultTransformPolicy>(src, dst, op, stream);
    540 }
    541 
    542 //! @}
    543 
    544 }}
    545 
    546 #endif
    547