From 3b05acf9362a4e554a8590639a1fda7a2658d4e9 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Thu, 22 Aug 2013 12:03:17 +0400 Subject: [PATCH] reorganize code for further modifiction --- modules/gpu/src/cuda/resize.cu | 136 ++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 84 deletions(-) diff --git a/modules/gpu/src/cuda/resize.cu b/modules/gpu/src/cuda/resize.cu index e720297..c244ca7 100644 --- a/modules/gpu/src/cuda/resize.cu +++ b/modules/gpu/src/cuda/resize.cu @@ -42,20 +42,19 @@ #if !defined CUDA_DISABLER -#include "internal_shared.hpp" +#include +#include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/border_interpolate.hpp" #include "opencv2/gpu/device/vec_traits.hpp" #include "opencv2/gpu/device/vec_math.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" #include "opencv2/gpu/device/filters.hpp" -#include -#include namespace cv { namespace gpu { namespace device { namespace imgproc { - template __global__ void resize(const Ptr2D src, float fx, float fy, PtrStepSz dst) + template __global__ void resize(const Ptr2D src, const float fx, const float fy, PtrStepSz dst) { const int x = blockDim.x * blockIdx.x + threadIdx.x; const int y = blockDim.y * blockIdx.y + threadIdx.y; @@ -69,23 +68,12 @@ namespace cv { namespace gpu { namespace device } } - template __global__ void resize_area(const Ptr2D src, float fx, float fy, PtrStepSz dst) - { - const int x = blockDim.x * blockIdx.x + threadIdx.x; - const int y = blockDim.y * blockIdx.y + threadIdx.y; - - if (x < dst.cols && y < dst.rows) - { - dst(y, x) = saturate_cast(src(y, x)); - } - } - template