Commit 90d16271 authored by Namgoo Lee's avatar Namgoo Lee

[moved from opencv] Move Ptr-related code from lut.cu to lut.cpp

original commit: https://github.com/opencv/opencv/commit/a54affeb8d9bb52b43228fa89ca31c68ff088202
parent 75fcfa60
......@@ -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<LookUpTable> cv::cuda::createLookUpTable(InputArray) { throw_no_cuda(); return Ptr<LookUpTable>(); }
void cv::cuda::copyMakeBorder(InputArray, OutputArray, int, int, int, int, int, Scalar, Stream&) { throw_no_cuda(); }
#else /* !defined (HAVE_CUDA) */
......
......@@ -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<uchar, cudaTextureType1D, cudaReadModeElementType> 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<uchar, cudaTextureType1D, cudaReadModeElementType> texLutTable;
LookUpTableImpl::LookUpTableImpl(InputArray _lut)
{
......@@ -200,11 +188,7 @@ namespace
syncOutput(dst, _dst, stream);
}
}
Ptr<LookUpTable> cv::cuda::createLookUpTable(InputArray lut)
{
return makePtr<LookUpTableImpl>(lut);
}
} }
#endif
// 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<LookUpTable> cv::cuda::createLookUpTable(InputArray) { throw_no_cuda(); return Ptr<LookUpTable>(); }
#else /* !defined (HAVE_CUDA) || defined (CUDA_DISABLER) */
Ptr<LookUpTable> cv::cuda::createLookUpTable(InputArray lut)
{
return makePtr<LookUpTableImpl>(lut);
}
#endif
// 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 <cuda_runtime.h>
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__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment