43 #ifndef __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
44 #define __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
50 namespace cv {
namespace gpu {
namespace device
61 template <
typename T> __device__ __forceinline__ D
at_low(
int x,
const T*
data)
const
66 template <
typename T> __device__ __forceinline__ D
at_high(
int x,
const T*
data)
const
71 template <
typename T> __device__ __forceinline__ D
at(
int x,
const T*
data)
const
86 template <
typename T> __device__ __forceinline__ D
at_low(
int y,
const T*
data,
size_t step)
const
91 template <
typename T> __device__ __forceinline__ D
at_high(
int y,
const T*
data,
size_t step)
const
96 template <
typename T> __device__ __forceinline__ D
at(
int y,
const T*
data,
size_t step)
const
113 template <
typename T> __device__ __forceinline__ D
at(
int y,
int x,
const T*
data,
size_t step)
const
118 template <
typename Ptr2D> __device__ __forceinline__ D
at(
typename Ptr2D::index_type
y,
typename Ptr2D::index_type
x,
const Ptr2D&
src)
const
148 __device__ __forceinline__
int idx_col(
int x)
const
153 template <
typename T> __device__ __forceinline__ D
at_low(
int x,
const T*
data)
const
158 template <
typename T> __device__ __forceinline__ D
at_high(
int x,
const T*
data)
const
163 template <
typename T> __device__ __forceinline__ D
at(
int x,
const T*
data)
const
188 __device__ __forceinline__
int idx_row(
int y)
const
193 template <
typename T> __device__ __forceinline__ D
at_low(
int y,
const T*
data,
size_t step)
const
198 template <
typename T> __device__ __forceinline__ D
at_high(
int y,
const T*
data,
size_t step)
const
203 template <
typename T> __device__ __forceinline__ D
at(
int y,
const T*
data,
size_t step)
const
228 __device__ __forceinline__
int idx_row(
int y)
const
243 __device__ __forceinline__
int idx_col(
int x)
const
248 template <
typename T> __device__ __forceinline__ D
at(
int y,
int x,
const T*
data,
size_t step)
const
253 template <
typename Ptr2D> __device__ __forceinline__ D
at(
typename Ptr2D::index_type
y,
typename Ptr2D::index_type
x,
const Ptr2D&
src)
const
282 __device__ __forceinline__
int idx_col(
int x)
const
287 template <
typename T> __device__ __forceinline__ D
at_low(
int x,
const T*
data)
const
292 template <
typename T> __device__ __forceinline__ D
at_high(
int x,
const T*
data)
const
297 template <
typename T> __device__ __forceinline__ D
at(
int x,
const T*
data)
const
322 __device__ __forceinline__
int idx_row(
int y)
const
327 template <
typename T> __device__ __forceinline__ D
at_low(
int y,
const T*
data,
size_t step)
const
332 template <
typename T> __device__ __forceinline__ D
at_high(
int y,
const T*
data,
size_t step)
const
337 template <
typename T> __device__ __forceinline__ D
at(
int y,
const T*
data,
size_t step)
const
362 __device__ __forceinline__
int idx_row(
int y)
const
377 __device__ __forceinline__
int idx_col(
int x)
const
382 template <
typename T> __device__ __forceinline__ D
at(
int y,
int x,
const T*
data,
size_t step)
const
387 template <
typename Ptr2D> __device__ __forceinline__ D
at(
typename Ptr2D::index_type
y,
typename Ptr2D::index_type
x,
const Ptr2D&
src)
const
416 __device__ __forceinline__
int idx_col(
int x)
const
421 template <
typename T> __device__ __forceinline__ D
at_low(
int x,
const T*
data)
const
426 template <
typename T> __device__ __forceinline__ D
at_high(
int x,
const T*
data)
const
431 template <
typename T> __device__ __forceinline__ D
at(
int x,
const T*
data)
const
456 __device__ __forceinline__
int idx_row(
int y)
const
461 template <
typename T> __device__ __forceinline__ D
at_low(
int y,
const T*
data,
size_t step)
const
466 template <
typename T> __device__ __forceinline__ D
at_high(
int y,
const T*
data,
size_t step)
const
471 template <
typename T> __device__ __forceinline__ D
at(
int y,
const T*
data,
size_t step)
const
496 __device__ __forceinline__
int idx_row(
int y)
const
511 __device__ __forceinline__
int idx_col(
int x)
const
516 template <
typename T> __device__ __forceinline__ D
at(
int y,
int x,
const T*
data,
size_t step)
const
521 template <
typename Ptr2D> __device__ __forceinline__ D
at(
typename Ptr2D::index_type
y,
typename Ptr2D::index_type
x,
const Ptr2D&
src)
const
537 explicit __host__ __device__ __forceinline__
BrdRowWrap(
int width_) :
width(width_) {}
538 template <
typename U> __host__ __device__ __forceinline__
BrdRowWrap(
int width_,
U) :
width(width_) {}
542 return (x >= 0) * x + (x < 0) * (x - ((x -
width + 1) /
width) *
width);
550 __device__ __forceinline__
int idx_col(
int x)
const
555 template <
typename T> __device__ __forceinline__ D
at_low(
int x,
const T*
data)
const
560 template <
typename T> __device__ __forceinline__ D
at_high(
int x,
const T*
data)
const
565 template <
typename T> __device__ __forceinline__ D
at(
int x,
const T*
data)
const
578 template <
typename U> __host__ __device__ __forceinline__
BrdColWrap(
int height_,
U) :
height(height_) {}
590 __device__ __forceinline__
int idx_row(
int y)
const
595 template <
typename T> __device__ __forceinline__ D
at_low(
int y,
const T*
data,
size_t step)
const
600 template <
typename T> __device__ __forceinline__ D
at_high(
int y,
const T*
data,
size_t step)
const
605 template <
typename T> __device__ __forceinline__ D
at(
int y,
const T*
data,
size_t step)
const
617 __host__ __device__ __forceinline__
BrdWrap(
int height_,
int width_) :
621 template <
typename U>
622 __host__ __device__ __forceinline__
BrdWrap(
int height_,
int width_,
U) :
637 __device__ __forceinline__
int idx_row(
int y)
const
644 return (x >= 0) * x + (x < 0) * (x - ((x -
width + 1) /
width) *
width);
652 __device__ __forceinline__
int idx_col(
int x)
const
657 template <
typename T> __device__ __forceinline__ D
at(
int y,
int x,
const T*
data,
size_t step)
const
662 template <
typename Ptr2D> __device__ __forceinline__ D
at(
typename Ptr2D::index_type
y,
typename Ptr2D::index_type
x,
const Ptr2D&
src)
const
679 __host__ __device__ __forceinline__
BorderReader(
const Ptr2D& ptr_,
const B& b_) :
ptr(ptr_),
b(b_) {}
683 return b.at(y, x,
ptr);
714 #endif // __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
__device__ __forceinline__ D at_high(int x, const T *data) const
Definition: border_interpolate.hpp:560
const void * src
Definition: core_c.h:1568
const int last_row
Definition: border_interpolate.hpp:476
__host__ __device__ __forceinline__ BrdReplicate(int height, int width, U)
Definition: border_interpolate.hpp:216
GLenum GLint GLint y
Definition: core_c.h:613
__device__ __forceinline__ int idx_row_low(int y) const
Definition: border_interpolate.hpp:627
const int width
Definition: border_interpolate.hpp:709
__device__ __forceinline__ int idx_row_high(int y) const
Definition: border_interpolate.hpp:317
const int height
Definition: border_interpolate.hpp:667
__host__ __device__ __forceinline__ BrdReflect101(int height, int width, U)
Definition: border_interpolate.hpp:350
const int width
Definition: border_interpolate.hpp:124
__device__ __forceinline__ int idx_row_high(int y) const
Definition: border_interpolate.hpp:491
__device__ __forceinline__ int idx_row_low(int y) const
Definition: border_interpolate.hpp:312
__device__ __forceinline__ int idx_row(int y) const
Definition: border_interpolate.hpp:637
__device__ __forceinline__ D at(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:203
D result_type
Definition: border_interpolate.hpp:481
D result_type
Definition: border_interpolate.hpp:107
__device__ __forceinline__ int idx_col(int x) const
Definition: border_interpolate.hpp:148
const Ptr2D src
Definition: border_interpolate.hpp:707
D result_type
Definition: border_interpolate.hpp:347
__host__ __device__ __forceinline__ BrdColReplicate(int height)
Definition: border_interpolate.hpp:175
__device__ __forceinline__ int idx_col_high(int x) const
Definition: border_interpolate.hpp:277
const int last_row
Definition: border_interpolate.hpp:208
__device__ __forceinline__ D at(int x, const T *data) const
Definition: border_interpolate.hpp:565
__device__ __forceinline__ int idx_row_high(int y) const
Definition: border_interpolate.hpp:183
__device__ __forceinline__ int idx_row_low(int y) const
Definition: border_interpolate.hpp:486
D result_type
Definition: border_interpolate.hpp:615
__device__ __forceinline__ int idx_row_high(int y) const
Definition: border_interpolate.hpp:451
__host__ __device__ __forceinline__ BrdConstant(int height_, int width_, const D &val_=VecTraits< D >::all(0))
Definition: border_interpolate.hpp:109
__device__ __forceinline__ int idx_col_high(int x) const
Definition: border_interpolate.hpp:372
const D val
Definition: border_interpolate.hpp:77
const CvArr * U
Definition: core_c.h:733
Definition: border_interpolate.hpp:305
const int last_col
Definition: border_interpolate.hpp:302
const int last_col
Definition: border_interpolate.hpp:436
CV_EXPORTS void abs(const GpuMat &src, GpuMat &dst, Stream &stream=Stream::Null())
__device__ __forceinline__ D at_high(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:332
__host__ __device__ __forceinline__ BrdReflect(int height, int width)
Definition: border_interpolate.hpp:483
__device__ __forceinline__ D at(int x, const T *data) const
Definition: border_interpolate.hpp:297
__host__ __device__ __forceinline__ BrdReplicate(int height, int width)
Definition: border_interpolate.hpp:215
__device__ __forceinline__ int idx_col_low(int x) const
Definition: border_interpolate.hpp:367
__device__ __forceinline__ int idx_row_high(int y) const
Definition: border_interpolate.hpp:223
GLuint src
Definition: core_c.h:1650
__device__ __forceinline__ int idx_row_low(int y) const
Definition: border_interpolate.hpp:446
__device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D &src) const
Definition: border_interpolate.hpp:118
__host__ __device__ __forceinline__ BrdColReplicate(int height, U)
Definition: border_interpolate.hpp:176
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: core_c.h:403
const CvMat const CvMat const CvMat CvMat CvMat CvMat CvMat CvSize CvMat CvMat * T
Definition: calib3d.hpp:270
__device__ __forceinline__ D at_high(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:466
__device__ __forceinline__ D at(int x, const T *data) const
Definition: border_interpolate.hpp:431
__device__ __forceinline__ D at_high(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:600
Definition: border_interpolate.hpp:131
__host__ __device__ __forceinline__ BrdWrap(int height_, int width_)
Definition: border_interpolate.hpp:617
void int step
Definition: core_c.h:403
Definition: border_interpolate.hpp:105
const D val
Definition: border_interpolate.hpp:102
__host__ __device__ __forceinline__ BrdColReflect(int height, U)
Definition: border_interpolate.hpp:444
__device__ __forceinline__ D at_high(int x, const T *data) const
Definition: border_interpolate.hpp:158
__device__ __forceinline__ int idx_row(int y) const
Definition: border_interpolate.hpp:590
__host__ __device__ __forceinline__ BrdRowWrap(int width_)
Definition: border_interpolate.hpp:537
__device__ __forceinline__ int idx_row(int y) const
Definition: border_interpolate.hpp:228
__host__ __device__ __forceinline__ BorderReader(const Ptr2D &ptr_, const B &b_)
Definition: border_interpolate.hpp:679
__device__ __forceinline__ int idx_col_low(int x) const
Definition: border_interpolate.hpp:138
__host__ __device__ __forceinline__ BrdRowReplicate(int width, U)
Definition: border_interpolate.hpp:136
__device__ __forceinline__ D at(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:605
__host__ __device__ __forceinline__ BrdColWrap(int height_, U)
Definition: border_interpolate.hpp:578
Definition: border_interpolate.hpp:479
__device__ __forceinline__ D at(int x, const T *data) const
Definition: border_interpolate.hpp:163
const D val
Definition: border_interpolate.hpp:125
__device__ __forceinline__ int idx_col_low(int x) const
Definition: border_interpolate.hpp:272
__device__ __forceinline__ D at_high(int x, const T *data) const
Definition: border_interpolate.hpp:66
__device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D &src) const
Definition: border_interpolate.hpp:662
unsigned char uchar
Definition: common.hpp:100
__device__ __forceinline__ elem_type operator()(index_type y, index_type x) const
Definition: border_interpolate.hpp:681
__device__ __forceinline__ int idx_row_low(int y) const
Definition: border_interpolate.hpp:178
Definition: border_interpolate.hpp:399
__host__ __device__ __forceinline__ BorderReader(const Ptr2D &src_, const BrdConstant< D > &b)
Definition: border_interpolate.hpp:697
const int width
Definition: border_interpolate.hpp:668
const int last_col
Definition: border_interpolate.hpp:527
__device__ __forceinline__ D at_high(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:198
__device__ __forceinline__ int idx_col_high(int x) const
Definition: border_interpolate.hpp:238
__device__ __forceinline__ int idx_row_low(int y) const
Definition: border_interpolate.hpp:580
D result_type
Definition: border_interpolate.hpp:307
__device__ __forceinline__ int idx_col(int x) const
Definition: border_interpolate.hpp:416
__device__ __forceinline__ int idx_col_low(int x) const
Definition: border_interpolate.hpp:642
__device__ __forceinline__ D at(int x, const T *data) const
Definition: border_interpolate.hpp:71
__device__ __forceinline__ int idx_col(int x) const
Definition: border_interpolate.hpp:377
__device__ __forceinline__ D at_low(int x, const T *data) const
Definition: border_interpolate.hpp:61
__device__ __forceinline__ int idx_row_low(int y) const
Definition: border_interpolate.hpp:218
__device__ __forceinline__ int idx_row_high(int y) const
Definition: border_interpolate.hpp:585
GLenum GLsizei GLsizei height
const int height
Definition: border_interpolate.hpp:101
__device__ __forceinline__ D at(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:96
__device__ __forceinline__ int idx_row_high(int y) const
Definition: border_interpolate.hpp:632
CV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst)
computes per-element minimum of two arrays (dst = min(src1, src2))
Definition: border_interpolate.hpp:171
const D val
Definition: border_interpolate.hpp:710
__device__ __forceinline__ D at_low(int x, const T *data) const
Definition: border_interpolate.hpp:153
__host__ __device__ __forceinline__ BrdWrap(int height_, int width_, U)
Definition: border_interpolate.hpp:622
__host__ __device__ __forceinline__ BrdRowConstant(int width_, const D &val_=VecTraits< D >::all(0))
Definition: border_interpolate.hpp:59
__host__ __device__ __forceinline__ BrdColReflect101(int height)
Definition: border_interpolate.hpp:309
const int height
Definition: border_interpolate.hpp:708
__device__ __forceinline__ D at_low(int x, const T *data) const
Definition: border_interpolate.hpp:287
Definition: border_interpolate.hpp:674
GLenum GLint x
Definition: core_c.h:632
__device__ __forceinline__ int idx_col(int x) const
Definition: border_interpolate.hpp:550
CV_EXPORTS MatExpr abs(const Mat &m)
__host__ __device__ __forceinline__ BrdRowReplicate(int width)
Definition: border_interpolate.hpp:135
D result_type
Definition: border_interpolate.hpp:213
__device__ __forceinline__ D at_high(int x, const T *data) const
Definition: border_interpolate.hpp:426
__device__ __forceinline__ int idx_col_low(int x) const
Definition: border_interpolate.hpp:540
Definition: border_interpolate.hpp:55
__device__ __forceinline__ int idx_row(int y) const
Definition: border_interpolate.hpp:322
BrdConstant< D >::result_type elem_type
Definition: border_interpolate.hpp:694
D result_type
Definition: border_interpolate.hpp:173
__device__ __forceinline__ D at(int y, int x, const T *data, size_t step) const
Definition: border_interpolate.hpp:516
__device__ __forceinline__ int idx_col_low(int x) const
Definition: border_interpolate.hpp:233
__host__ __device__ __forceinline__ BrdRowReflect(int width)
Definition: border_interpolate.hpp:403
__device__ __forceinline__ int idx_col(int x) const
Definition: border_interpolate.hpp:511
__device__ __forceinline__ D at_low(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:86
__device__ __forceinline__ int idx_col_high(int x) const
Definition: border_interpolate.hpp:411
__device__ __forceinline__ int idx_row_high(int y) const
Definition: border_interpolate.hpp:357
__device__ __forceinline__ int idx_col(int x) const
Definition: border_interpolate.hpp:243
D result_type
Definition: border_interpolate.hpp:57
__device__ __forceinline__ int idx_row_low(int y) const
Definition: border_interpolate.hpp:352
GLboolean GLboolean GLboolean b
Definition: legacy.hpp:633
D result_type
Definition: border_interpolate.hpp:535
__device__ __forceinline__ D at(int y, int x, const T *data, size_t step) const
Definition: border_interpolate.hpp:657
Definition: border_interpolate.hpp:345
__host__ __device__ __forceinline__ BrdReflect(int height, int width, U)
Definition: border_interpolate.hpp:484
__device__ __forceinline__ D at(int y, int x, const T *data, size_t step) const
Definition: border_interpolate.hpp:113
const B b
Definition: border_interpolate.hpp:687
__device__ __forceinline__ int idx_row(int y) const
Definition: border_interpolate.hpp:496
__device__ __forceinline__ D at_low(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:595
Ptr2D::index_type index_type
Definition: border_interpolate.hpp:677
Definition: border_interpolate.hpp:80
__device__ __forceinline__ _Tp saturate_cast(uchar v)
Definition: saturate_cast.hpp:50
__device__ __forceinline__ D at_low(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:461
__host__ __device__ __forceinline__ BrdColConstant(int height_, const D &val_=VecTraits< D >::all(0))
Definition: border_interpolate.hpp:84
Definition: border_interpolate.hpp:613
__device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D &src) const
Definition: border_interpolate.hpp:521
__host__ __device__ __forceinline__ BrdColReflect(int height)
Definition: border_interpolate.hpp:443
D result_type
Definition: border_interpolate.hpp:267
__host__ __device__ __forceinline__ BrdRowReflect101(int width, U)
Definition: border_interpolate.hpp:270
Ptr2D::index_type index_type
Definition: border_interpolate.hpp:695
__device__ __forceinline__ D at(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:337
__device__ __forceinline__ int idx_col_low(int x) const
Definition: border_interpolate.hpp:406
D result_type
Definition: border_interpolate.hpp:401
__device__ __forceinline__ int idx_col_high(int x) const
Definition: border_interpolate.hpp:143
Definition: border_interpolate.hpp:211
const int width
Definition: border_interpolate.hpp:570
__device__ __forceinline__ D at(int y, int x, const T *data, size_t step) const
Definition: border_interpolate.hpp:382
__device__ __forceinline__ D at_high(int x, const T *data) const
Definition: border_interpolate.hpp:292
__device__ __forceinline__ int idx_col_high(int x) const
Definition: border_interpolate.hpp:545
__device__ __forceinline__ int idx_col(int x) const
Definition: border_interpolate.hpp:652
const int last_col
Definition: border_interpolate.hpp:168
D result_type
Definition: border_interpolate.hpp:441
const int height
Definition: border_interpolate.hpp:123
__device__ __forceinline__ int idx_col(int x) const
Definition: border_interpolate.hpp:282
const int last_row
Definition: border_interpolate.hpp:526
__device__ __forceinline__ D at_low(int x, const T *data) const
Definition: border_interpolate.hpp:421
__host__ __device__ __forceinline__ BrdRowWrap(int width_, U)
Definition: border_interpolate.hpp:538
__host__ __device__ __forceinline__ BrdRowReflect(int width, U)
Definition: border_interpolate.hpp:404
Definition: border_interpolate.hpp:573
Definition: border_interpolate.hpp:533
__device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D &src) const
Definition: border_interpolate.hpp:253
const int last_row
Definition: border_interpolate.hpp:342
const int height
Definition: border_interpolate.hpp:610
__device__ __forceinline__ D at_high(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:91
int x
Definition: highgui_c.h:186
const CvMat * B
Definition: calib3d.hpp:161
const int last_col
Definition: border_interpolate.hpp:259
const Ptr2D ptr
Definition: border_interpolate.hpp:686
__device__ __forceinline__ int idx_col_high(int x) const
Definition: border_interpolate.hpp:647
D result_type
Definition: border_interpolate.hpp:133
D result_type
Definition: border_interpolate.hpp:575
__device__ __forceinline__ D at_low(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:193
const int width
Definition: border_interpolate.hpp:76
__device__ __forceinline__ int idx_col_low(int x) const
Definition: border_interpolate.hpp:501
const int last_row
Definition: border_interpolate.hpp:258
__device__ __forceinline__ int idx_row(int y) const
Definition: border_interpolate.hpp:456
__device__ __forceinline__ D at_low(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:327
__device__ __forceinline__ D at(int y, const T *data, size_t step) const
Definition: border_interpolate.hpp:471
D result_type
Definition: border_interpolate.hpp:82
__host__ __device__ __forceinline__ BrdReflect101(int height, int width)
Definition: border_interpolate.hpp:349
__host__ __device__ __forceinline__ BrdColWrap(int height_)
Definition: border_interpolate.hpp:577
__host__ __device__ __forceinline__ BrdRowReflect101(int width)
Definition: border_interpolate.hpp:269
Definition: border_interpolate.hpp:265
__device__ __forceinline__ D at_low(int x, const T *data) const
Definition: border_interpolate.hpp:555
__device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D &src) const
Definition: border_interpolate.hpp:387
Definition: vec_traits.hpp:160
B::result_type elem_type
Definition: border_interpolate.hpp:676
const int last_col
Definition: border_interpolate.hpp:393
__host__ __device__ __forceinline__ BrdColReflect101(int height, U)
Definition: border_interpolate.hpp:310
const int last_row
Definition: border_interpolate.hpp:392
__device__ __forceinline__ D at(int y, int x, const T *data, size_t step) const
Definition: border_interpolate.hpp:248
__device__ __forceinline__ int idx_col_high(int x) const
Definition: border_interpolate.hpp:506
__device__ __forceinline__ int idx_row(int y) const
Definition: border_interpolate.hpp:188
__device__ __forceinline__ int idx_row(int y) const
Definition: border_interpolate.hpp:362
Definition: border_interpolate.hpp:439