border_interpolate.hpp
Go to the documentation of this file.
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 // Third party copyrights are property of their respective owners.
16 //
17 // Redistribution and use in source and binary forms, with or without modification,
18 // are permitted provided that the following conditions are met:
19 //
20 // * Redistribution's of source code must retain the above copyright notice,
21 // this list of conditions and the following disclaimer.
22 //
23 // * Redistribution's in binary form must reproduce the above copyright notice,
24 // this list of conditions and the following disclaimer in the documentation
25 // and/or other materials provided with the distribution.
26 //
27 // * The name of the copyright holders may not be used to endorse or promote products
28 // derived from this software without specific prior written permission.
29 //
30 // This software is provided by the copyright holders and contributors "as is" and
31 // any express or implied warranties, including, but not limited to, the implied
32 // warranties of merchantability and fitness for a particular purpose are disclaimed.
33 // In no event shall the Intel Corporation or contributors be liable for any direct,
34 // indirect, incidental, special, exemplary, or consequential damages
35 // (including, but not limited to, procurement of substitute goods or services;
36 // loss of use, data, or profits; or business interruption) however caused
37 // and on any theory of liability, whether in contract, strict liability,
38 // or tort (including negligence or otherwise) arising in any way out of
39 // the use of this software, even if advised of the possibility of such damage.
40 //
41 //M*/
42 
43 #ifndef __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
44 #define __OPENCV_GPU_BORDER_INTERPOLATE_HPP__
45 
46 #include "saturate_cast.hpp"
47 #include "vec_traits.hpp"
48 #include "vec_math.hpp"
49 
50 namespace cv { namespace gpu { namespace device
51 {
53  // BrdConstant
54 
55  template <typename D> struct BrdRowConstant
56  {
57  typedef D result_type;
58 
59  explicit __host__ __device__ __forceinline__ BrdRowConstant(int width_, const D& val_ = VecTraits<D>::all(0)) : width(width_), val(val_) {}
60 
61  template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const
62  {
63  return x >= 0 ? saturate_cast<D>(data[x]) : val;
64  }
65 
66  template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const
67  {
68  return x < width ? saturate_cast<D>(data[x]) : val;
69  }
70 
71  template <typename T> __device__ __forceinline__ D at(int x, const T* data) const
72  {
73  return (x >= 0 && x < width) ? saturate_cast<D>(data[x]) : val;
74  }
75 
76  const int width;
77  const D val;
78  };
79 
80  template <typename D> struct BrdColConstant
81  {
82  typedef D result_type;
83 
84  explicit __host__ __device__ __forceinline__ BrdColConstant(int height_, const D& val_ = VecTraits<D>::all(0)) : height(height_), val(val_) {}
85 
86  template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const
87  {
88  return y >= 0 ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;
89  }
90 
91  template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const
92  {
93  return y < height ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;
94  }
95 
96  template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const
97  {
98  return (y >= 0 && y < height) ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;
99  }
100 
101  const int height;
102  const D val;
103  };
104 
105  template <typename D> struct BrdConstant
106  {
107  typedef D result_type;
108 
109  __host__ __device__ __forceinline__ BrdConstant(int height_, int width_, const D& val_ = VecTraits<D>::all(0)) : height(height_), width(width_), val(val_)
110  {
111  }
112 
113  template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const
114  {
115  return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(((const T*)((const uchar*)data + y * step))[x]) : val;
116  }
117 
118  template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const
119  {
120  return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(src(y, x)) : val;
121  }
122 
123  const int height;
124  const int width;
125  const D val;
126  };
127 
129  // BrdReplicate
130 
131  template <typename D> struct BrdRowReplicate
132  {
133  typedef D result_type;
134 
135  explicit __host__ __device__ __forceinline__ BrdRowReplicate(int width) : last_col(width - 1) {}
136  template <typename U> __host__ __device__ __forceinline__ BrdRowReplicate(int width, U) : last_col(width - 1) {}
137 
138  __device__ __forceinline__ int idx_col_low(int x) const
139  {
140  return ::max(x, 0);
141  }
142 
143  __device__ __forceinline__ int idx_col_high(int x) const
144  {
146  }
147 
148  __device__ __forceinline__ int idx_col(int x) const
149  {
150  return idx_col_low(idx_col_high(x));
151  }
152 
153  template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const
154  {
155  return saturate_cast<D>(data[idx_col_low(x)]);
156  }
157 
158  template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const
159  {
160  return saturate_cast<D>(data[idx_col_high(x)]);
161  }
162 
163  template <typename T> __device__ __forceinline__ D at(int x, const T* data) const
164  {
165  return saturate_cast<D>(data[idx_col(x)]);
166  }
167 
168  const int last_col;
169  };
170 
171  template <typename D> struct BrdColReplicate
172  {
173  typedef D result_type;
174 
175  explicit __host__ __device__ __forceinline__ BrdColReplicate(int height) : last_row(height - 1) {}
176  template <typename U> __host__ __device__ __forceinline__ BrdColReplicate(int height, U) : last_row(height - 1) {}
177 
178  __device__ __forceinline__ int idx_row_low(int y) const
179  {
180  return ::max(y, 0);
181  }
182 
183  __device__ __forceinline__ int idx_row_high(int y) const
184  {
186  }
187 
188  __device__ __forceinline__ int idx_row(int y) const
189  {
190  return idx_row_low(idx_row_high(y));
191  }
192 
193  template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const
194  {
195  return saturate_cast<D>(*(const T*)((const char*)data + idx_row_low(y) * step));
196  }
197 
198  template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const
199  {
200  return saturate_cast<D>(*(const T*)((const char*)data + idx_row_high(y) * step));
201  }
202 
203  template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const
204  {
205  return saturate_cast<D>(*(const T*)((const char*)data + idx_row(y) * step));
206  }
207 
208  const int last_row;
209  };
210 
211  template <typename D> struct BrdReplicate
212  {
213  typedef D result_type;
214 
215  __host__ __device__ __forceinline__ BrdReplicate(int height, int width) : last_row(height - 1), last_col(width - 1) {}
216  template <typename U> __host__ __device__ __forceinline__ BrdReplicate(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}
217 
218  __device__ __forceinline__ int idx_row_low(int y) const
219  {
220  return ::max(y, 0);
221  }
222 
223  __device__ __forceinline__ int idx_row_high(int y) const
224  {
226  }
227 
228  __device__ __forceinline__ int idx_row(int y) const
229  {
230  return idx_row_low(idx_row_high(y));
231  }
232 
233  __device__ __forceinline__ int idx_col_low(int x) const
234  {
235  return ::max(x, 0);
236  }
237 
238  __device__ __forceinline__ int idx_col_high(int x) const
239  {
241  }
242 
243  __device__ __forceinline__ int idx_col(int x) const
244  {
245  return idx_col_low(idx_col_high(x));
246  }
247 
248  template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const
249  {
250  return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);
251  }
252 
253  template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const
254  {
255  return saturate_cast<D>(src(idx_row(y), idx_col(x)));
256  }
257 
258  const int last_row;
259  const int last_col;
260  };
261 
263  // BrdReflect101
264 
265  template <typename D> struct BrdRowReflect101
266  {
267  typedef D result_type;
268 
269  explicit __host__ __device__ __forceinline__ BrdRowReflect101(int width) : last_col(width - 1) {}
270  template <typename U> __host__ __device__ __forceinline__ BrdRowReflect101(int width, U) : last_col(width - 1) {}
271 
272  __device__ __forceinline__ int idx_col_low(int x) const
273  {
274  return ::abs(x) % (last_col + 1);
275  }
276 
277  __device__ __forceinline__ int idx_col_high(int x) const
278  {
279  return ::abs(last_col - ::abs(last_col - x)) % (last_col + 1);
280  }
281 
282  __device__ __forceinline__ int idx_col(int x) const
283  {
284  return idx_col_low(idx_col_high(x));
285  }
286 
287  template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const
288  {
289  return saturate_cast<D>(data[idx_col_low(x)]);
290  }
291 
292  template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const
293  {
294  return saturate_cast<D>(data[idx_col_high(x)]);
295  }
296 
297  template <typename T> __device__ __forceinline__ D at(int x, const T* data) const
298  {
299  return saturate_cast<D>(data[idx_col(x)]);
300  }
301 
302  const int last_col;
303  };
304 
305  template <typename D> struct BrdColReflect101
306  {
307  typedef D result_type;
308 
309  explicit __host__ __device__ __forceinline__ BrdColReflect101(int height) : last_row(height - 1) {}
310  template <typename U> __host__ __device__ __forceinline__ BrdColReflect101(int height, U) : last_row(height - 1) {}
311 
312  __device__ __forceinline__ int idx_row_low(int y) const
313  {
314  return ::abs(y) % (last_row + 1);
315  }
316 
317  __device__ __forceinline__ int idx_row_high(int y) const
318  {
319  return ::abs(last_row - ::abs(last_row - y)) % (last_row + 1);
320  }
321 
322  __device__ __forceinline__ int idx_row(int y) const
323  {
324  return idx_row_low(idx_row_high(y));
325  }
326 
327  template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const
328  {
329  return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));
330  }
331 
332  template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const
333  {
334  return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));
335  }
336 
337  template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const
338  {
339  return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));
340  }
341 
342  const int last_row;
343  };
344 
345  template <typename D> struct BrdReflect101
346  {
347  typedef D result_type;
348 
349  __host__ __device__ __forceinline__ BrdReflect101(int height, int width) : last_row(height - 1), last_col(width - 1) {}
350  template <typename U> __host__ __device__ __forceinline__ BrdReflect101(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}
351 
352  __device__ __forceinline__ int idx_row_low(int y) const
353  {
354  return ::abs(y) % (last_row + 1);
355  }
356 
357  __device__ __forceinline__ int idx_row_high(int y) const
358  {
359  return ::abs(last_row - ::abs(last_row - y)) % (last_row + 1);
360  }
361 
362  __device__ __forceinline__ int idx_row(int y) const
363  {
364  return idx_row_low(idx_row_high(y));
365  }
366 
367  __device__ __forceinline__ int idx_col_low(int x) const
368  {
369  return ::abs(x) % (last_col + 1);
370  }
371 
372  __device__ __forceinline__ int idx_col_high(int x) const
373  {
374  return ::abs(last_col - ::abs(last_col - x)) % (last_col + 1);
375  }
376 
377  __device__ __forceinline__ int idx_col(int x) const
378  {
379  return idx_col_low(idx_col_high(x));
380  }
381 
382  template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const
383  {
384  return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);
385  }
386 
387  template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const
388  {
389  return saturate_cast<D>(src(idx_row(y), idx_col(x)));
390  }
391 
392  const int last_row;
393  const int last_col;
394  };
395 
397  // BrdReflect
398 
399  template <typename D> struct BrdRowReflect
400  {
401  typedef D result_type;
402 
403  explicit __host__ __device__ __forceinline__ BrdRowReflect(int width) : last_col(width - 1) {}
404  template <typename U> __host__ __device__ __forceinline__ BrdRowReflect(int width, U) : last_col(width - 1) {}
405 
406  __device__ __forceinline__ int idx_col_low(int x) const
407  {
408  return (::abs(x) - (x < 0)) % (last_col + 1);
409  }
410 
411  __device__ __forceinline__ int idx_col_high(int x) const
412  {
413  return ::abs(last_col - ::abs(last_col - x) + (x > last_col)) % (last_col + 1);
414  }
415 
416  __device__ __forceinline__ int idx_col(int x) const
417  {
418  return idx_col_high(::abs(x) - (x < 0));
419  }
420 
421  template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const
422  {
423  return saturate_cast<D>(data[idx_col_low(x)]);
424  }
425 
426  template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const
427  {
428  return saturate_cast<D>(data[idx_col_high(x)]);
429  }
430 
431  template <typename T> __device__ __forceinline__ D at(int x, const T* data) const
432  {
433  return saturate_cast<D>(data[idx_col(x)]);
434  }
435 
436  const int last_col;
437  };
438 
439  template <typename D> struct BrdColReflect
440  {
441  typedef D result_type;
442 
443  explicit __host__ __device__ __forceinline__ BrdColReflect(int height) : last_row(height - 1) {}
444  template <typename U> __host__ __device__ __forceinline__ BrdColReflect(int height, U) : last_row(height - 1) {}
445 
446  __device__ __forceinline__ int idx_row_low(int y) const
447  {
448  return (::abs(y) - (y < 0)) % (last_row + 1);
449  }
450 
451  __device__ __forceinline__ int idx_row_high(int y) const
452  {
453  return ::abs(last_row - ::abs(last_row - y) + (y > last_row)) % (last_row + 1);
454  }
455 
456  __device__ __forceinline__ int idx_row(int y) const
457  {
458  return idx_row_high(::abs(y) - (y < 0));
459  }
460 
461  template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const
462  {
463  return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));
464  }
465 
466  template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const
467  {
468  return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));
469  }
470 
471  template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const
472  {
473  return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));
474  }
475 
476  const int last_row;
477  };
478 
479  template <typename D> struct BrdReflect
480  {
481  typedef D result_type;
482 
483  __host__ __device__ __forceinline__ BrdReflect(int height, int width) : last_row(height - 1), last_col(width - 1) {}
484  template <typename U> __host__ __device__ __forceinline__ BrdReflect(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}
485 
486  __device__ __forceinline__ int idx_row_low(int y) const
487  {
488  return (::abs(y) - (y < 0)) % (last_row + 1);
489  }
490 
491  __device__ __forceinline__ int idx_row_high(int y) const
492  {
493  return /*::abs*/(last_row - ::abs(last_row - y) + (y > last_row)) /*% (last_row + 1)*/;
494  }
495 
496  __device__ __forceinline__ int idx_row(int y) const
497  {
498  return idx_row_low(idx_row_high(y));
499  }
500 
501  __device__ __forceinline__ int idx_col_low(int x) const
502  {
503  return (::abs(x) - (x < 0)) % (last_col + 1);
504  }
505 
506  __device__ __forceinline__ int idx_col_high(int x) const
507  {
508  return (last_col - ::abs(last_col - x) + (x > last_col));
509  }
510 
511  __device__ __forceinline__ int idx_col(int x) const
512  {
513  return idx_col_low(idx_col_high(x));
514  }
515 
516  template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const
517  {
518  return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);
519  }
520 
521  template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const
522  {
523  return saturate_cast<D>(src(idx_row(y), idx_col(x)));
524  }
525 
526  const int last_row;
527  const int last_col;
528  };
529 
531  // BrdWrap
532 
533  template <typename D> struct BrdRowWrap
534  {
535  typedef D result_type;
536 
537  explicit __host__ __device__ __forceinline__ BrdRowWrap(int width_) : width(width_) {}
538  template <typename U> __host__ __device__ __forceinline__ BrdRowWrap(int width_, U) : width(width_) {}
539 
540  __device__ __forceinline__ int idx_col_low(int x) const
541  {
542  return (x >= 0) * x + (x < 0) * (x - ((x - width + 1) / width) * width);
543  }
544 
545  __device__ __forceinline__ int idx_col_high(int x) const
546  {
547  return (x < width) * x + (x >= width) * (x % width);
548  }
549 
550  __device__ __forceinline__ int idx_col(int x) const
551  {
552  return idx_col_high(idx_col_low(x));
553  }
554 
555  template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const
556  {
557  return saturate_cast<D>(data[idx_col_low(x)]);
558  }
559 
560  template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const
561  {
562  return saturate_cast<D>(data[idx_col_high(x)]);
563  }
564 
565  template <typename T> __device__ __forceinline__ D at(int x, const T* data) const
566  {
567  return saturate_cast<D>(data[idx_col(x)]);
568  }
569 
570  const int width;
571  };
572 
573  template <typename D> struct BrdColWrap
574  {
575  typedef D result_type;
576 
577  explicit __host__ __device__ __forceinline__ BrdColWrap(int height_) : height(height_) {}
578  template <typename U> __host__ __device__ __forceinline__ BrdColWrap(int height_, U) : height(height_) {}
579 
580  __device__ __forceinline__ int idx_row_low(int y) const
581  {
582  return (y >= 0) * y + (y < 0) * (y - ((y - height + 1) / height) * height);
583  }
584 
585  __device__ __forceinline__ int idx_row_high(int y) const
586  {
587  return (y < height) * y + (y >= height) * (y % height);
588  }
589 
590  __device__ __forceinline__ int idx_row(int y) const
591  {
592  return idx_row_high(idx_row_low(y));
593  }
594 
595  template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const
596  {
597  return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));
598  }
599 
600  template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const
601  {
602  return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));
603  }
604 
605  template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const
606  {
607  return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));
608  }
609 
610  const int height;
611  };
612 
613  template <typename D> struct BrdWrap
614  {
615  typedef D result_type;
616 
617  __host__ __device__ __forceinline__ BrdWrap(int height_, int width_) :
618  height(height_), width(width_)
619  {
620  }
621  template <typename U>
622  __host__ __device__ __forceinline__ BrdWrap(int height_, int width_, U) :
623  height(height_), width(width_)
624  {
625  }
626 
627  __device__ __forceinline__ int idx_row_low(int y) const
628  {
629  return (y >= 0) * y + (y < 0) * (y - ((y - height + 1) / height) * height);
630  }
631 
632  __device__ __forceinline__ int idx_row_high(int y) const
633  {
634  return (y < height) * y + (y >= height) * (y % height);
635  }
636 
637  __device__ __forceinline__ int idx_row(int y) const
638  {
639  return idx_row_high(idx_row_low(y));
640  }
641 
642  __device__ __forceinline__ int idx_col_low(int x) const
643  {
644  return (x >= 0) * x + (x < 0) * (x - ((x - width + 1) / width) * width);
645  }
646 
647  __device__ __forceinline__ int idx_col_high(int x) const
648  {
649  return (x < width) * x + (x >= width) * (x % width);
650  }
651 
652  __device__ __forceinline__ int idx_col(int x) const
653  {
654  return idx_col_high(idx_col_low(x));
655  }
656 
657  template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const
658  {
659  return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);
660  }
661 
662  template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const
663  {
664  return saturate_cast<D>(src(idx_row(y), idx_col(x)));
665  }
666 
667  const int height;
668  const int width;
669  };
670 
672  // BorderReader
673 
674  template <typename Ptr2D, typename B> struct BorderReader
675  {
676  typedef typename B::result_type elem_type;
677  typedef typename Ptr2D::index_type index_type;
678 
679  __host__ __device__ __forceinline__ BorderReader(const Ptr2D& ptr_, const B& b_) : ptr(ptr_), b(b_) {}
680 
681  __device__ __forceinline__ elem_type operator ()(index_type y, index_type x) const
682  {
683  return b.at(y, x, ptr);
684  }
685 
686  const Ptr2D ptr;
687  const B b;
688  };
689 
690  // under win32 there is some bug with templated types that passed as kernel parameters
691  // with this specialization all works fine
692  template <typename Ptr2D, typename D> struct BorderReader< Ptr2D, BrdConstant<D> >
693  {
695  typedef typename Ptr2D::index_type index_type;
696 
697  __host__ __device__ __forceinline__ BorderReader(const Ptr2D& src_, const BrdConstant<D>& b) :
698  src(src_), height(b.height), width(b.width), val(b.val)
699  {
700  }
701 
702  __device__ __forceinline__ D operator ()(index_type y, index_type x) const
703  {
704  return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(src(y, x)) : val;
705  }
706 
707  const Ptr2D src;
708  const int height;
709  const int width;
710  const D val;
711  };
712 }}} // namespace cv { namespace gpu { namespace device
713 
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
GLenum GLsizei width
__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
GLuint GLfloat * val
__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