mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 12:22:51 +08:00
Move Ptr-related code from lut.cu to lut.cpp
This commit is contained in:
parent
bd1342c164
commit
a54affeb8d
@ -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(); }
|
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(); }
|
void cv::cuda::copyMakeBorder(InputArray, OutputArray, int, int, int, int, int, Scalar, Stream&) { throw_no_cuda(); }
|
||||||
|
|
||||||
#else /* !defined (HAVE_CUDA) */
|
#else /* !defined (HAVE_CUDA) */
|
||||||
|
@ -48,6 +48,8 @@
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include "../lut.hpp"
|
||||||
|
|
||||||
#include "opencv2/cudaarithm.hpp"
|
#include "opencv2/cudaarithm.hpp"
|
||||||
#include "opencv2/cudev.hpp"
|
#include "opencv2/cudev.hpp"
|
||||||
#include "opencv2/core/private.cuda.hpp"
|
#include "opencv2/core/private.cuda.hpp"
|
||||||
@ -56,24 +58,10 @@ using namespace cv;
|
|||||||
using namespace cv::cuda;
|
using namespace cv::cuda;
|
||||||
using namespace cv::cudev;
|
using namespace cv::cudev;
|
||||||
|
|
||||||
namespace
|
namespace cv { namespace cuda {
|
||||||
{
|
|
||||||
texture<uchar, cudaTextureType1D, cudaReadModeElementType> texLutTable;
|
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;
|
|
||||||
|
|
||||||
private:
|
|
||||||
GpuMat d_lut;
|
|
||||||
cudaTextureObject_t texLutTableObj;
|
|
||||||
bool cc30;
|
|
||||||
};
|
|
||||||
|
|
||||||
LookUpTableImpl::LookUpTableImpl(InputArray _lut)
|
LookUpTableImpl::LookUpTableImpl(InputArray _lut)
|
||||||
{
|
{
|
||||||
if (_lut.kind() == _InputArray::CUDA_GPU_MAT)
|
if (_lut.kind() == _InputArray::CUDA_GPU_MAT)
|
||||||
@ -200,11 +188,7 @@ namespace
|
|||||||
|
|
||||||
syncOutput(dst, _dst, stream);
|
syncOutput(dst, _dst, stream);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Ptr<LookUpTable> cv::cuda::createLookUpTable(InputArray lut)
|
} }
|
||||||
{
|
|
||||||
return makePtr<LookUpTableImpl>(lut);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
23
modules/cudaarithm/src/lut.cpp
Normal file
23
modules/cudaarithm/src/lut.cpp
Normal file
@ -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<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
|
30
modules/cudaarithm/src/lut.hpp
Normal file
30
modules/cudaarithm/src/lut.hpp
Normal file
@ -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 <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__
|
Loading…
Reference in New Issue
Block a user