diff --git a/modules/cudaarithm/src/core.cpp b/modules/cudaarithm/src/core.cpp index 7dd51f9781..6d97e15dbb 100644 --- a/modules/cudaarithm/src/core.cpp +++ b/modules/cudaarithm/src/core.cpp @@ -57,8 +57,6 @@ void cv::cuda::transpose(InputArray, OutputArray, Stream&) { throw_no_cuda(); } void cv::cuda::flip(InputArray, OutputArray, int, Stream&) { throw_no_cuda(); } -Ptr cv::cuda::createLookUpTable(InputArray) { throw_no_cuda(); return Ptr(); } - void cv::cuda::copyMakeBorder(InputArray, OutputArray, int, int, int, int, int, Scalar, Stream&) { throw_no_cuda(); } #else /* !defined (HAVE_CUDA) */ diff --git a/modules/cudaarithm/src/cuda/lut.cu b/modules/cudaarithm/src/cuda/lut.cu index 1769116d30..336f9b2885 100644 --- a/modules/cudaarithm/src/cuda/lut.cu +++ b/modules/cudaarithm/src/cuda/lut.cu @@ -48,6 +48,8 @@ #else +#include "../lut.hpp" + #include "opencv2/cudaarithm.hpp" #include "opencv2/cudev.hpp" #include "opencv2/core/private.cuda.hpp" @@ -56,23 +58,9 @@ using namespace cv; using namespace cv::cuda; using namespace cv::cudev; -namespace -{ - texture texLutTable; - - class LookUpTableImpl : public LookUpTable - { - public: - LookUpTableImpl(InputArray lut); - ~LookUpTableImpl(); - - void transform(InputArray src, OutputArray dst, Stream& stream = Stream::Null()) CV_OVERRIDE; +namespace cv { namespace cuda { - private: - GpuMat d_lut; - cudaTextureObject_t texLutTableObj; - bool cc30; - }; + texture texLutTable; LookUpTableImpl::LookUpTableImpl(InputArray _lut) { @@ -200,11 +188,7 @@ namespace syncOutput(dst, _dst, stream); } -} -Ptr cv::cuda::createLookUpTable(InputArray lut) -{ - return makePtr(lut); -} +} } #endif diff --git a/modules/cudaarithm/src/lut.cpp b/modules/cudaarithm/src/lut.cpp new file mode 100644 index 0000000000..a4b4e02650 --- /dev/null +++ b/modules/cudaarithm/src/lut.cpp @@ -0,0 +1,23 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#include "precomp.hpp" + +#include "lut.hpp" + +using namespace cv; +using namespace cv::cuda; + +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) + +Ptr cv::cuda::createLookUpTable(InputArray) { throw_no_cuda(); return Ptr(); } + +#else /* !defined (HAVE_CUDA) || defined (CUDA_DISABLER) */ + +Ptr cv::cuda::createLookUpTable(InputArray lut) +{ + return makePtr(lut); +} + +#endif diff --git a/modules/cudaarithm/src/lut.hpp b/modules/cudaarithm/src/lut.hpp new file mode 100644 index 0000000000..2c63e9acdf --- /dev/null +++ b/modules/cudaarithm/src/lut.hpp @@ -0,0 +1,30 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef __CUDAARITHM_LUT_HPP__ +#define __CUDAARITHM_LUT_HPP__ + +#include "opencv2/cudaarithm.hpp" + +#include + +namespace cv { namespace cuda { + +class LookUpTableImpl : public LookUpTable +{ +public: + LookUpTableImpl(InputArray lut); + ~LookUpTableImpl(); + + void transform(InputArray src, OutputArray dst, Stream& stream = Stream::Null()) CV_OVERRIDE; + +private: + GpuMat d_lut; + cudaTextureObject_t texLutTableObj; + bool cc30; +}; + +} } + +#endif // __CUDAARITHM_LUT_HPP__