core: apply CV_OVERRIDE/CV_FINAL

pull/11093/head
Alexander Alekhin 7 years ago
parent 0587f92d96
commit 9111538bfb
  1. 2
      modules/core/include/opencv2/core.hpp
  2. 4
      modules/core/include/opencv2/core/private.hpp
  3. 4
      modules/core/include/opencv2/core/ptr.inl.hpp
  4. 9
      modules/core/include/opencv2/core/utility.hpp
  5. 2
      modules/core/src/batch_distance.cpp
  6. 8
      modules/core/src/bufferpool.impl.hpp
  7. 12
      modules/core/src/conjugate_gradient.cpp
  8. 16
      modules/core/src/downhill_simplex.cpp
  9. 24
      modules/core/src/dxt.cpp
  10. 4
      modules/core/src/kmeans.cpp
  11. 2
      modules/core/src/lut.cpp
  12. 8
      modules/core/src/matrix.cpp
  13. 86
      modules/core/src/matrix_expressions.cpp
  14. 36
      modules/core/src/ocl.cpp
  15. 36
      modules/core/src/out.cpp
  16. 2
      modules/core/src/parallel.cpp
  17. 8
      modules/core/src/trace.cpp

@ -124,7 +124,7 @@ public:
/*! /*!
\return the error description and the context as a text string. \return the error description and the context as a text string.
*/ */
virtual const char *what() const throw(); virtual const char *what() const throw() CV_OVERRIDE;
void formatMessage(); void formatMessage();
String msg; ///< the formatted error message String msg; ///< the formatted error message

@ -165,6 +165,8 @@ template <typename T>
T* allocSingleton(size_t count) { return static_cast<T*>(fastMalloc(sizeof(T) * count)); } T* allocSingleton(size_t count) { return static_cast<T*>(fastMalloc(sizeof(T) * count)); }
} }
#if 1 // TODO: Remove in OpenCV 4.x
// property implementation macros // property implementation macros
#define CV_IMPL_PROPERTY_RO(type, name, member) \ #define CV_IMPL_PROPERTY_RO(type, name, member) \
@ -187,6 +189,8 @@ T* allocSingleton(size_t count) { return static_cast<T*>(fastMalloc(sizeof(T) *
#define CV_WRAP_SAME_PROPERTY(type, name, internal_obj) CV_WRAP_PROPERTY(type, name, name, internal_obj) #define CV_WRAP_SAME_PROPERTY(type, name, internal_obj) CV_WRAP_PROPERTY(type, name, name, internal_obj)
#define CV_WRAP_SAME_PROPERTY_S(type, name, internal_obj) CV_WRAP_PROPERTY_S(type, name, name, internal_obj) #define CV_WRAP_SAME_PROPERTY_S(type, name, internal_obj) CV_WRAP_PROPERTY_S(type, name, name, internal_obj)
#endif
/****************************************************************************************\ /****************************************************************************************\
* Structures and macros for integration with IPP * * Structures and macros for integration with IPP *
\****************************************************************************************/ \****************************************************************************************/

@ -89,12 +89,12 @@ private:
}; };
template<typename Y, typename D> template<typename Y, typename D>
struct PtrOwnerImpl : PtrOwner struct PtrOwnerImpl CV_FINAL : PtrOwner
{ {
PtrOwnerImpl(Y* p, D d) : owned(p), deleter(d) PtrOwnerImpl(Y* p, D d) : owned(p), deleter(d)
{} {}
void deleteSelf() void deleteSelf() CV_OVERRIDE
{ {
deleter(owned); deleter(owned);
delete this; delete this;

@ -524,7 +524,7 @@ public:
m_functor(functor) m_functor(functor)
{ } { }
virtual void operator() (const cv::Range& range) const virtual void operator() (const cv::Range& range) const CV_OVERRIDE
{ {
m_functor(range); m_functor(range);
} }
@ -558,7 +558,8 @@ void Mat::forEach_impl(const Functor& operation) {
virtual ~PixelOperationWrapper(){} virtual ~PixelOperationWrapper(){}
// ! Overloaded virtual operator // ! Overloaded virtual operator
// convert range call to row call. // convert range call to row call.
virtual void operator()(const Range &range) const { virtual void operator()(const Range &range) const CV_OVERRIDE
{
const int DIMS = mat->dims; const int DIMS = mat->dims;
const int COLS = mat->size[DIMS - 1]; const int COLS = mat->size[DIMS - 1];
if (DIMS <= 2) { if (DIMS <= 2) {
@ -711,8 +712,8 @@ public:
inline void cleanup() { TLSDataContainer::cleanup(); } inline void cleanup() { TLSDataContainer::cleanup(); }
private: private:
virtual void* createDataInstance() const {return new T;} // Wrapper to allocate data by template virtual void* createDataInstance() const CV_OVERRIDE {return new T;} // Wrapper to allocate data by template
virtual void deleteDataInstance(void* pData) const {delete (T*)pData;} // Wrapper to release data by template virtual void deleteDataInstance(void* pData) const CV_OVERRIDE {delete (T*)pData;} // Wrapper to release data by template
// Disable TLS copy operations // Disable TLS copy operations
TLSData(TLSData &) {} TLSData(TLSData &) {}

@ -176,7 +176,7 @@ struct BatchDistInvoker : public ParallelLoopBody
func = _func; func = _func;
} }
void operator()(const Range& range) const void operator()(const Range& range) const CV_OVERRIDE
{ {
AutoBuffer<int> buf(src2->rows); AutoBuffer<int> buf(src2->rows);
int* bufptr = buf; int* bufptr = buf;

@ -17,10 +17,10 @@ public:
DummyBufferPoolController() { } DummyBufferPoolController() { }
virtual ~DummyBufferPoolController() { } virtual ~DummyBufferPoolController() { }
virtual size_t getReservedSize() const { return (size_t)-1; } virtual size_t getReservedSize() const CV_OVERRIDE { return (size_t)-1; }
virtual size_t getMaxReservedSize() const { return (size_t)-1; } virtual size_t getMaxReservedSize() const CV_OVERRIDE { return (size_t)-1; }
virtual void setMaxReservedSize(size_t size) { (void)size; } virtual void setMaxReservedSize(size_t size) CV_OVERRIDE { (void)size; }
virtual void freeAllReservedBuffers() { } virtual void freeAllReservedBuffers() CV_OVERRIDE { }
}; };
} // namespace } // namespace

@ -68,15 +68,15 @@ namespace cv
#define SEC_METHOD_ITERATIONS 4 #define SEC_METHOD_ITERATIONS 4
#define INITIAL_SEC_METHOD_SIGMA 0.1 #define INITIAL_SEC_METHOD_SIGMA 0.1
class ConjGradSolverImpl : public ConjGradSolver class ConjGradSolverImpl CV_FINAL : public ConjGradSolver
{ {
public: public:
Ptr<Function> getFunction() const; Ptr<Function> getFunction() const CV_OVERRIDE;
void setFunction(const Ptr<Function>& f); void setFunction(const Ptr<Function>& f) CV_OVERRIDE;
TermCriteria getTermCriteria() const; TermCriteria getTermCriteria() const CV_OVERRIDE;
ConjGradSolverImpl(); ConjGradSolverImpl();
void setTermCriteria(const TermCriteria& termcrit); void setTermCriteria(const TermCriteria& termcrit) CV_OVERRIDE;
double minimize(InputOutputArray x); double minimize(InputOutputArray x) CV_OVERRIDE;
protected: protected:
Ptr<MinProblemSolver::Function> _Function; Ptr<MinProblemSolver::Function> _Function;
TermCriteria _termcrit; TermCriteria _termcrit;

@ -140,7 +140,7 @@ multiple lines in three dimensions as not all lines intersect in three dimension
namespace cv namespace cv
{ {
class DownhillSolverImpl : public DownhillSolver class DownhillSolverImpl CV_FINAL : public DownhillSolver
{ {
public: public:
DownhillSolverImpl() DownhillSolverImpl()
@ -149,8 +149,8 @@ public:
_step=Mat_<double>(); _step=Mat_<double>();
} }
void getInitStep(OutputArray step) const { _step.copyTo(step); } void getInitStep(OutputArray step) const CV_OVERRIDE { _step.copyTo(step); }
void setInitStep(InputArray step) void setInitStep(InputArray step) CV_OVERRIDE
{ {
// set dimensionality and make a deep copy of step // set dimensionality and make a deep copy of step
Mat m = step.getMat(); Mat m = step.getMat();
@ -161,13 +161,13 @@ public:
transpose(m, _step); transpose(m, _step);
} }
Ptr<MinProblemSolver::Function> getFunction() const { return _Function; } Ptr<MinProblemSolver::Function> getFunction() const CV_OVERRIDE { return _Function; }
void setFunction(const Ptr<Function>& f) { _Function=f; } void setFunction(const Ptr<Function>& f) CV_OVERRIDE { _Function=f; }
TermCriteria getTermCriteria() const { return _termcrit; } TermCriteria getTermCriteria() const CV_OVERRIDE { return _termcrit; }
void setTermCriteria( const TermCriteria& termcrit ) void setTermCriteria( const TermCriteria& termcrit ) CV_OVERRIDE
{ {
CV_Assert( termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && CV_Assert( termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) &&
termcrit.epsilon > 0 && termcrit.epsilon > 0 &&
@ -175,7 +175,7 @@ public:
_termcrit=termcrit; _termcrit=termcrit;
} }
double minimize( InputOutputArray x_ ) double minimize( InputOutputArray x_ ) CV_OVERRIDE
{ {
dprintf(("hi from minimize\n")); dprintf(("hi from minimize\n"));
CV_Assert( !_Function.empty() ); CV_Assert( !_Function.empty() );

@ -1562,7 +1562,7 @@ public:
*ok = true; *ok = true;
} }
virtual void operator()(const Range& range) const virtual void operator()(const Range& range) const CV_OVERRIDE
{ {
IppStatus status; IppStatus status;
Ipp8u* pBuffer = 0; Ipp8u* pBuffer = 0;
@ -1643,7 +1643,7 @@ public:
*ok = true; *ok = true;
} }
virtual void operator()(const Range& range) const virtual void operator()(const Range& range) const CV_OVERRIDE
{ {
IppStatus status; IppStatus status;
Ipp8u* pBuffer = 0; Ipp8u* pBuffer = 0;
@ -2607,7 +2607,7 @@ inline DftDims determineDims(int rows, int cols, bool isRowWise, bool isContinuo
return InvalidDim; return InvalidDim;
} }
class OcvDftImpl : public hal::DFT2D class OcvDftImpl CV_FINAL : public hal::DFT2D
{ {
protected: protected:
Ptr<hal::DFT1D> contextA; Ptr<hal::DFT1D> contextA;
@ -2779,7 +2779,7 @@ public:
} }
} }
void apply(const uchar * src, size_t src_step, uchar * dst, size_t dst_step) void apply(const uchar * src, size_t src_step, uchar * dst, size_t dst_step) CV_OVERRIDE
{ {
#if defined USE_IPP_DFT #if defined USE_IPP_DFT
if (useIpp) if (useIpp)
@ -3039,7 +3039,7 @@ protected:
} }
}; };
class OcvDftBasicImpl : public hal::DFT1D class OcvDftBasicImpl CV_FINAL : public hal::DFT1D
{ {
public: public:
OcvDftOptions opt; OcvDftOptions opt;
@ -3194,7 +3194,7 @@ public:
} }
} }
void apply(const uchar *src, uchar *dst) void apply(const uchar *src, uchar *dst) CV_OVERRIDE
{ {
opt.dft_func(opt, src, dst); opt.dft_func(opt, src, dst);
} }
@ -3214,7 +3214,7 @@ struct ReplacementDFT1D : public hal::DFT1D
isInitialized = (res == CV_HAL_ERROR_OK); isInitialized = (res == CV_HAL_ERROR_OK);
return isInitialized; return isInitialized;
} }
void apply(const uchar *src, uchar *dst) void apply(const uchar *src, uchar *dst) CV_OVERRIDE
{ {
if (isInitialized) if (isInitialized)
{ {
@ -3244,7 +3244,7 @@ struct ReplacementDFT2D : public hal::DFT2D
isInitialized = (res == CV_HAL_ERROR_OK); isInitialized = (res == CV_HAL_ERROR_OK);
return isInitialized; return isInitialized;
} }
void apply(const uchar *src, size_t src_step, uchar *dst, size_t dst_step) void apply(const uchar *src, size_t src_step, uchar *dst, size_t dst_step) CV_OVERRIDE
{ {
if (isInitialized) if (isInitialized)
{ {
@ -3809,7 +3809,7 @@ public:
*ok = true; *ok = true;
} }
virtual void operator()(const Range& range) const virtual void operator()(const Range& range) const CV_OVERRIDE
{ {
if(*ok == false) if(*ok == false)
return; return;
@ -4048,7 +4048,7 @@ static bool ippi_DCT_32f(const uchar * src, size_t src_step, uchar * dst, size_t
namespace cv { namespace cv {
class OcvDctImpl : public hal::DCT2D class OcvDctImpl CV_FINAL : public hal::DCT2D
{ {
public: public:
OcvDftOptions opt; OcvDftOptions opt;
@ -4100,7 +4100,7 @@ public:
end_stage = 1; end_stage = 1;
} }
} }
void apply(const uchar *src, size_t src_step, uchar *dst, size_t dst_step) void apply(const uchar *src, size_t src_step, uchar *dst, size_t dst_step) CV_OVERRIDE
{ {
CV_IPP_RUN(IPP_VERSION_X100 >= 700 && depth == CV_32F, ippi_DCT_32f(src, src_step, dst, dst_step, width, height, isInverse, isRowTransform)) CV_IPP_RUN(IPP_VERSION_X100 >= 700 && depth == CV_32F, ippi_DCT_32f(src, src_step, dst, dst_step, width, height, isInverse, isRowTransform))
@ -4196,7 +4196,7 @@ struct ReplacementDCT2D : public hal::DCT2D
isInitialized = (res == CV_HAL_ERROR_OK); isInitialized = (res == CV_HAL_ERROR_OK);
return isInitialized; return isInitialized;
} }
void apply(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step) void apply(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step) CV_OVERRIDE
{ {
if (isInitialized) if (isInitialized)
{ {

@ -65,7 +65,7 @@ public:
tdist2(tdist2_), data(data_), dist(dist_), ci(ci_) tdist2(tdist2_), data(data_), dist(dist_), ci(ci_)
{ } { }
void operator()( const cv::Range& range ) const void operator()( const cv::Range& range ) const CV_OVERRIDE
{ {
CV_TRACE_FUNCTION(); CV_TRACE_FUNCTION();
const int begin = range.start; const int begin = range.start;
@ -171,7 +171,7 @@ public:
{ {
} }
void operator()( const Range& range ) const void operator()(const Range& range) const CV_OVERRIDE
{ {
CV_TRACE_FUNCTION(); CV_TRACE_FUNCTION();
const int begin = range.start; const int begin = range.start;

@ -328,7 +328,7 @@ public:
*ok = (func != NULL); *ok = (func != NULL);
} }
void operator()( const cv::Range& range ) const void operator()( const cv::Range& range ) const CV_OVERRIDE
{ {
CV_DbgAssert(*ok); CV_DbgAssert(*ok);

@ -123,11 +123,11 @@ BufferPoolController* MatAllocator::getBufferPoolController(const char* id) cons
return &dummy; return &dummy;
} }
class StdMatAllocator : public MatAllocator class StdMatAllocator CV_FINAL : public MatAllocator
{ {
public: public:
UMatData* allocate(int dims, const int* sizes, int type, UMatData* allocate(int dims, const int* sizes, int type,
void* data0, size_t* step, int /*flags*/, UMatUsageFlags /*usageFlags*/) const void* data0, size_t* step, int /*flags*/, UMatUsageFlags /*usageFlags*/) const CV_OVERRIDE
{ {
size_t total = CV_ELEM_SIZE(type); size_t total = CV_ELEM_SIZE(type);
for( int i = dims-1; i >= 0; i-- ) for( int i = dims-1; i >= 0; i-- )
@ -154,13 +154,13 @@ public:
return u; return u;
} }
bool allocate(UMatData* u, int /*accessFlags*/, UMatUsageFlags /*usageFlags*/) const bool allocate(UMatData* u, int /*accessFlags*/, UMatUsageFlags /*usageFlags*/) const CV_OVERRIDE
{ {
if(!u) return false; if(!u) return false;
return true; return true;
} }
void deallocate(UMatData* u) const void deallocate(UMatData* u) const CV_OVERRIDE
{ {
if(!u) if(!u)
return; return;

@ -14,53 +14,53 @@
namespace cv namespace cv
{ {
class MatOp_Identity : public MatOp class MatOp_Identity CV_FINAL : public MatOp
{ {
public: public:
MatOp_Identity() {} MatOp_Identity() {}
virtual ~MatOp_Identity() {} virtual ~MatOp_Identity() {}
bool elementWise(const MatExpr& /*expr*/) const { return true; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return true; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, const Mat& m); static void makeExpr(MatExpr& res, const Mat& m);
}; };
static MatOp_Identity g_MatOp_Identity; static MatOp_Identity g_MatOp_Identity;
class MatOp_AddEx : public MatOp class MatOp_AddEx CV_FINAL : public MatOp
{ {
public: public:
MatOp_AddEx() {} MatOp_AddEx() {}
virtual ~MatOp_AddEx() {} virtual ~MatOp_AddEx() {}
bool elementWise(const MatExpr& /*expr*/) const { return true; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return true; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
void add(const MatExpr& e1, const Scalar& s, MatExpr& res) const; void add(const MatExpr& e1, const Scalar& s, MatExpr& res) const CV_OVERRIDE;
void subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const; void subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const CV_OVERRIDE;
void multiply(const MatExpr& e1, double s, MatExpr& res) const; void multiply(const MatExpr& e1, double s, MatExpr& res) const CV_OVERRIDE;
void divide(double s, const MatExpr& e, MatExpr& res) const; void divide(double s, const MatExpr& e, MatExpr& res) const CV_OVERRIDE;
void transpose(const MatExpr& e1, MatExpr& res) const; void transpose(const MatExpr& e1, MatExpr& res) const CV_OVERRIDE;
void abs(const MatExpr& expr, MatExpr& res) const; void abs(const MatExpr& expr, MatExpr& res) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, const Mat& a, const Mat& b, double alpha, double beta, const Scalar& s=Scalar()); static void makeExpr(MatExpr& res, const Mat& a, const Mat& b, double alpha, double beta, const Scalar& s=Scalar());
}; };
static MatOp_AddEx g_MatOp_AddEx; static MatOp_AddEx g_MatOp_AddEx;
class MatOp_Bin : public MatOp class MatOp_Bin CV_FINAL : public MatOp
{ {
public: public:
MatOp_Bin() {} MatOp_Bin() {}
virtual ~MatOp_Bin() {} virtual ~MatOp_Bin() {}
bool elementWise(const MatExpr& /*expr*/) const { return true; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return true; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
void multiply(const MatExpr& e1, double s, MatExpr& res) const; void multiply(const MatExpr& e1, double s, MatExpr& res) const CV_OVERRIDE;
void divide(double s, const MatExpr& e, MatExpr& res) const; void divide(double s, const MatExpr& e, MatExpr& res) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, char op, const Mat& a, const Mat& b, double scale=1); static void makeExpr(MatExpr& res, char op, const Mat& a, const Mat& b, double scale=1);
static void makeExpr(MatExpr& res, char op, const Mat& a, const Scalar& s); static void makeExpr(MatExpr& res, char op, const Mat& a, const Scalar& s);
@ -68,14 +68,14 @@ public:
static MatOp_Bin g_MatOp_Bin; static MatOp_Bin g_MatOp_Bin;
class MatOp_Cmp : public MatOp class MatOp_Cmp CV_FINAL : public MatOp
{ {
public: public:
MatOp_Cmp() {} MatOp_Cmp() {}
virtual ~MatOp_Cmp() {} virtual ~MatOp_Cmp() {}
bool elementWise(const MatExpr& /*expr*/) const { return true; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return true; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, int cmpop, const Mat& a, const Mat& b); static void makeExpr(MatExpr& res, int cmpop, const Mat& a, const Mat& b);
static void makeExpr(MatExpr& res, int cmpop, const Mat& a, double alpha); static void makeExpr(MatExpr& res, int cmpop, const Mat& a, double alpha);
@ -83,20 +83,20 @@ public:
static MatOp_Cmp g_MatOp_Cmp; static MatOp_Cmp g_MatOp_Cmp;
class MatOp_GEMM : public MatOp class MatOp_GEMM CV_FINAL : public MatOp
{ {
public: public:
MatOp_GEMM() {} MatOp_GEMM() {}
virtual ~MatOp_GEMM() {} virtual ~MatOp_GEMM() {}
bool elementWise(const MatExpr& /*expr*/) const { return false; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
void add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const; void add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const CV_OVERRIDE;
void subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const; void subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const CV_OVERRIDE;
void multiply(const MatExpr& e, double s, MatExpr& res) const; void multiply(const MatExpr& e, double s, MatExpr& res) const CV_OVERRIDE;
void transpose(const MatExpr& expr, MatExpr& res) const; void transpose(const MatExpr& expr, MatExpr& res) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, int flags, const Mat& a, const Mat& b, static void makeExpr(MatExpr& res, int flags, const Mat& a, const Mat& b,
double alpha=1, const Mat& c=Mat(), double beta=1); double alpha=1, const Mat& c=Mat(), double beta=1);
@ -104,63 +104,63 @@ public:
static MatOp_GEMM g_MatOp_GEMM; static MatOp_GEMM g_MatOp_GEMM;
class MatOp_Invert : public MatOp class MatOp_Invert CV_FINAL : public MatOp
{ {
public: public:
MatOp_Invert() {} MatOp_Invert() {}
virtual ~MatOp_Invert() {} virtual ~MatOp_Invert() {}
bool elementWise(const MatExpr& /*expr*/) const { return false; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
void matmul(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const; void matmul(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, int method, const Mat& m); static void makeExpr(MatExpr& res, int method, const Mat& m);
}; };
static MatOp_Invert g_MatOp_Invert; static MatOp_Invert g_MatOp_Invert;
class MatOp_T : public MatOp class MatOp_T CV_FINAL : public MatOp
{ {
public: public:
MatOp_T() {} MatOp_T() {}
virtual ~MatOp_T() {} virtual ~MatOp_T() {}
bool elementWise(const MatExpr& /*expr*/) const { return false; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
void multiply(const MatExpr& e1, double s, MatExpr& res) const; void multiply(const MatExpr& e1, double s, MatExpr& res) const CV_OVERRIDE;
void transpose(const MatExpr& expr, MatExpr& res) const; void transpose(const MatExpr& expr, MatExpr& res) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, const Mat& a, double alpha=1); static void makeExpr(MatExpr& res, const Mat& a, double alpha=1);
}; };
static MatOp_T g_MatOp_T; static MatOp_T g_MatOp_T;
class MatOp_Solve : public MatOp class MatOp_Solve CV_FINAL : public MatOp
{ {
public: public:
MatOp_Solve() {} MatOp_Solve() {}
virtual ~MatOp_Solve() {} virtual ~MatOp_Solve() {}
bool elementWise(const MatExpr& /*expr*/) const { return false; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, int method, const Mat& a, const Mat& b); static void makeExpr(MatExpr& res, int method, const Mat& a, const Mat& b);
}; };
static MatOp_Solve g_MatOp_Solve; static MatOp_Solve g_MatOp_Solve;
class MatOp_Initializer : public MatOp class MatOp_Initializer CV_FINAL : public MatOp
{ {
public: public:
MatOp_Initializer() {} MatOp_Initializer() {}
virtual ~MatOp_Initializer() {} virtual ~MatOp_Initializer() {}
bool elementWise(const MatExpr& /*expr*/) const { return false; } bool elementWise(const MatExpr& /*expr*/) const CV_OVERRIDE { return false; }
void assign(const MatExpr& expr, Mat& m, int type=-1) const; void assign(const MatExpr& expr, Mat& m, int type=-1) const CV_OVERRIDE;
void multiply(const MatExpr& e, double s, MatExpr& res) const; void multiply(const MatExpr& e, double s, MatExpr& res) const CV_OVERRIDE;
static void makeExpr(MatExpr& res, int method, Size sz, int type, double alpha=1); static void makeExpr(MatExpr& res, int method, Size sz, int type, double alpha=1);
static void makeExpr(MatExpr& res, int method, int ndims, const int* sizes, int type, double alpha=1); static void makeExpr(MatExpr& res, int method, int ndims, const int* sizes, int type, double alpha=1);

@ -4178,7 +4178,7 @@ public:
CV_Assert(reservedEntries_.empty()); CV_Assert(reservedEntries_.empty());
} }
public: public:
virtual T allocate(size_t size) virtual T allocate(size_t size) CV_OVERRIDE
{ {
AutoLock locker(mutex_); AutoLock locker(mutex_);
BufferEntry entry; BufferEntry entry;
@ -4193,7 +4193,7 @@ public:
} }
return entry.clBuffer_; return entry.clBuffer_;
} }
virtual void release(T buffer) virtual void release(T buffer) CV_OVERRIDE
{ {
AutoLock locker(mutex_); AutoLock locker(mutex_);
BufferEntry entry; BufferEntry entry;
@ -4210,9 +4210,9 @@ public:
} }
} }
virtual size_t getReservedSize() const { return currentReservedSize; } virtual size_t getReservedSize() const CV_OVERRIDE { return currentReservedSize; }
virtual size_t getMaxReservedSize() const { return maxReservedSize; } virtual size_t getMaxReservedSize() const CV_OVERRIDE { return maxReservedSize; }
virtual void setMaxReservedSize(size_t size) virtual void setMaxReservedSize(size_t size) CV_OVERRIDE
{ {
AutoLock locker(mutex_); AutoLock locker(mutex_);
size_t oldMaxReservedSize = maxReservedSize; size_t oldMaxReservedSize = maxReservedSize;
@ -4236,7 +4236,7 @@ public:
_checkSizeOfReservedEntries(); _checkSizeOfReservedEntries();
} }
} }
virtual void freeAllReservedBuffers() virtual void freeAllReservedBuffers() CV_OVERRIDE
{ {
AutoLock locker(mutex_); AutoLock locker(mutex_);
typename std::list<BufferEntry>::const_iterator i = reservedEntries_.begin(); typename std::list<BufferEntry>::const_iterator i = reservedEntries_.begin();
@ -4257,7 +4257,7 @@ struct CLBufferEntry
CLBufferEntry() : clBuffer_((cl_mem)NULL), capacity_(0) { } CLBufferEntry() : clBuffer_((cl_mem)NULL), capacity_(0) { }
}; };
class OpenCLBufferPoolImpl : public OpenCLBufferPoolBaseImpl<OpenCLBufferPoolImpl, CLBufferEntry, cl_mem> class OpenCLBufferPoolImpl CV_FINAL : public OpenCLBufferPoolBaseImpl<OpenCLBufferPoolImpl, CLBufferEntry, cl_mem>
{ {
public: public:
typedef struct CLBufferEntry BufferEntry; typedef struct CLBufferEntry BufferEntry;
@ -4303,7 +4303,7 @@ struct CLSVMBufferEntry
size_t capacity_; size_t capacity_;
CLSVMBufferEntry() : clBuffer_(NULL), capacity_(0) { } CLSVMBufferEntry() : clBuffer_(NULL), capacity_(0) { }
}; };
class OpenCLSVMBufferPoolImpl : public OpenCLBufferPoolBaseImpl<OpenCLSVMBufferPoolImpl, CLSVMBufferEntry, void*> class OpenCLSVMBufferPoolImpl CV_FINAL : public OpenCLBufferPoolBaseImpl<OpenCLSVMBufferPoolImpl, CLSVMBufferEntry, void*>
{ {
public: public:
typedef struct CLSVMBufferEntry BufferEntry; typedef struct CLSVMBufferEntry BufferEntry;
@ -4465,7 +4465,7 @@ private:
#define CV_OPENCL_DATA_PTR_ALIGNMENT 16 #define CV_OPENCL_DATA_PTR_ALIGNMENT 16
#endif #endif
class OpenCLAllocator : public MatAllocator class OpenCLAllocator CV_FINAL : public MatAllocator
{ {
mutable OpenCLBufferPoolImpl bufferPool; mutable OpenCLBufferPoolImpl bufferPool;
mutable OpenCLBufferPoolImpl bufferPoolHostPtr; mutable OpenCLBufferPoolImpl bufferPoolHostPtr;
@ -4525,7 +4525,7 @@ public:
} }
UMatData* allocate(int dims, const int* sizes, int type, UMatData* allocate(int dims, const int* sizes, int type,
void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const CV_OVERRIDE
{ {
if(!useOpenCL()) if(!useOpenCL())
return defaultAllocate(dims, sizes, type, data, step, flags, usageFlags); return defaultAllocate(dims, sizes, type, data, step, flags, usageFlags);
@ -4589,7 +4589,7 @@ public:
return u; return u;
} }
bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const CV_OVERRIDE
{ {
if(!u) if(!u)
return false; return false;
@ -4721,7 +4721,7 @@ public:
} }
}*/ }*/
void deallocate(UMatData* u) const void deallocate(UMatData* u) const CV_OVERRIDE
{ {
if(!u) if(!u)
return; return;
@ -4905,7 +4905,7 @@ public:
} }
// synchronized call (external UMatDataAutoLock, see UMat::getMat) // synchronized call (external UMatDataAutoLock, see UMat::getMat)
void map(UMatData* u, int accessFlags) const void map(UMatData* u, int accessFlags) const CV_OVERRIDE
{ {
CV_Assert(u && u->handle); CV_Assert(u && u->handle);
@ -4988,7 +4988,7 @@ public:
} }
} }
void unmap(UMatData* u) const void unmap(UMatData* u) const CV_OVERRIDE
{ {
if(!u) if(!u)
return; return;
@ -5133,7 +5133,7 @@ public:
void download(UMatData* u, void* dstptr, int dims, const size_t sz[], void download(UMatData* u, void* dstptr, int dims, const size_t sz[],
const size_t srcofs[], const size_t srcstep[], const size_t srcofs[], const size_t srcstep[],
const size_t dststep[]) const const size_t dststep[]) const CV_OVERRIDE
{ {
if(!u) if(!u)
return; return;
@ -5256,7 +5256,7 @@ public:
void upload(UMatData* u, const void* srcptr, int dims, const size_t sz[], void upload(UMatData* u, const void* srcptr, int dims, const size_t sz[],
const size_t dstofs[], const size_t dststep[], const size_t dstofs[], const size_t dststep[],
const size_t srcstep[]) const const size_t srcstep[]) const CV_OVERRIDE
{ {
if(!u) if(!u)
return; return;
@ -5408,7 +5408,7 @@ public:
void copy(UMatData* src, UMatData* dst, int dims, const size_t sz[], void copy(UMatData* src, UMatData* dst, int dims, const size_t sz[],
const size_t srcofs[], const size_t srcstep[], const size_t srcofs[], const size_t srcstep[],
const size_t dstofs[], const size_t dststep[], bool _sync) const const size_t dstofs[], const size_t dststep[], bool _sync) const CV_OVERRIDE
{ {
if(!src || !dst) if(!src || !dst)
return; return;
@ -5596,7 +5596,7 @@ public:
} }
} }
BufferPoolController* getBufferPoolController(const char* id) const { BufferPoolController* getBufferPoolController(const char* id) const CV_OVERRIDE {
#ifdef HAVE_OPENCL_SVM #ifdef HAVE_OPENCL_SVM
if ((svm::checkForceSVMUmatUsage() && (id == NULL || strcmp(id, "OCL") == 0)) || (id != NULL && strcmp(id, "SVM") == 0)) if ((svm::checkForceSVMUmatUsage() && (id == NULL || strcmp(id, "OCL") == 0)) || (id != NULL && strcmp(id, "SVM") == 0))
{ {

@ -45,7 +45,7 @@
namespace cv namespace cv
{ {
class FormattedImpl : public Formatted class FormattedImpl CV_FINAL : public Formatted
{ {
enum { STATE_PROLOGUE, STATE_EPILOGUE, STATE_INTERLUDE, enum { STATE_PROLOGUE, STATE_EPILOGUE, STATE_INTERLUDE,
STATE_ROW_OPEN, STATE_ROW_CLOSE, STATE_CN_OPEN, STATE_CN_CLOSE, STATE_VALUE, STATE_FINISHED, STATE_ROW_OPEN, STATE_ROW_CLOSE, STATE_CN_OPEN, STATE_CN_CLOSE, STATE_VALUE, STATE_FINISHED,
@ -119,12 +119,12 @@ namespace cv
} }
} }
void reset() void reset() CV_OVERRIDE
{ {
state = STATE_PROLOGUE; state = STATE_PROLOGUE;
} }
const char* next() const char* next() CV_OVERRIDE
{ {
switch(state) switch(state)
{ {
@ -258,17 +258,17 @@ namespace cv
public: public:
FormatterBase() : prec32f(8), prec64f(16), multiline(true) {} FormatterBase() : prec32f(8), prec64f(16), multiline(true) {}
void set32fPrecision(int p) void set32fPrecision(int p) CV_OVERRIDE
{ {
prec32f = p; prec32f = p;
} }
void set64fPrecision(int p) void set64fPrecision(int p) CV_OVERRIDE
{ {
prec64f = p; prec64f = p;
} }
void setMultiline(bool ml) void setMultiline(bool ml) CV_OVERRIDE
{ {
multiline = ml; multiline = ml;
} }
@ -279,11 +279,11 @@ namespace cv
int multiline; int multiline;
}; };
class DefaultFormatter : public FormatterBase class DefaultFormatter CV_FINAL : public FormatterBase
{ {
public: public:
Ptr<Formatted> format(const Mat& mtx) const Ptr<Formatted> format(const Mat& mtx) const CV_OVERRIDE
{ {
char braces[5] = {'\0', '\0', ';', '\0', '\0'}; char braces[5] = {'\0', '\0', ';', '\0', '\0'};
return makePtr<FormattedImpl>("[", "]", mtx, &*braces, return makePtr<FormattedImpl>("[", "]", mtx, &*braces,
@ -291,11 +291,11 @@ namespace cv
} }
}; };
class MatlabFormatter : public FormatterBase class MatlabFormatter CV_FINAL : public FormatterBase
{ {
public: public:
Ptr<Formatted> format(const Mat& mtx) const Ptr<Formatted> format(const Mat& mtx) const CV_OVERRIDE
{ {
char braces[5] = {'\0', '\0', ';', '\0', '\0'}; char braces[5] = {'\0', '\0', ';', '\0', '\0'};
return makePtr<FormattedImpl>("", "", mtx, &*braces, return makePtr<FormattedImpl>("", "", mtx, &*braces,
@ -303,11 +303,11 @@ namespace cv
} }
}; };
class PythonFormatter : public FormatterBase class PythonFormatter CV_FINAL : public FormatterBase
{ {
public: public:
Ptr<Formatted> format(const Mat& mtx) const Ptr<Formatted> format(const Mat& mtx) const CV_OVERRIDE
{ {
char braces[5] = {'[', ']', ',', '[', ']'}; char braces[5] = {'[', ']', ',', '[', ']'};
if (mtx.cols == 1) if (mtx.cols == 1)
@ -317,11 +317,11 @@ namespace cv
} }
}; };
class NumpyFormatter : public FormatterBase class NumpyFormatter CV_FINAL : public FormatterBase
{ {
public: public:
Ptr<Formatted> format(const Mat& mtx) const Ptr<Formatted> format(const Mat& mtx) const CV_OVERRIDE
{ {
static const char* numpyTypes[] = static const char* numpyTypes[] =
{ {
@ -336,11 +336,11 @@ namespace cv
} }
}; };
class CSVFormatter : public FormatterBase class CSVFormatter CV_FINAL : public FormatterBase
{ {
public: public:
Ptr<Formatted> format(const Mat& mtx) const Ptr<Formatted> format(const Mat& mtx) const CV_OVERRIDE
{ {
char braces[5] = {'\0', '\0', '\0', '\0', '\0'}; char braces[5] = {'\0', '\0', '\0', '\0', '\0'};
return makePtr<FormattedImpl>(String(), return makePtr<FormattedImpl>(String(),
@ -349,11 +349,11 @@ namespace cv
} }
}; };
class CFormatter : public FormatterBase class CFormatter CV_FINAL : public FormatterBase
{ {
public: public:
Ptr<Formatted> format(const Mat& mtx) const Ptr<Formatted> format(const Mat& mtx) const CV_OVERRIDE
{ {
char braces[5] = {'\0', '\0', ',', '\0', '\0'}; char braces[5] = {'\0', '\0', ',', '\0', '\0'};
return makePtr<FormattedImpl>("{", "}", mtx, &*braces, return makePtr<FormattedImpl>("{", "}", mtx, &*braces,

@ -238,7 +238,7 @@ namespace
~ParallelLoopBodyWrapper() ~ParallelLoopBodyWrapper()
{ {
} }
void operator()(const cv::Range& sr) const void operator()(const cv::Range& sr) const CV_OVERRIDE
{ {
#ifdef OPENCV_TRACE #ifdef OPENCV_TRACE
// TODO CV_TRACE_NS::details::setCurrentRegion(rootRegion); // TODO CV_TRACE_NS::details::setCurrentRegion(rootRegion);

@ -726,7 +726,7 @@ void TraceManagerThreadLocal::dumpStack(std::ostream& out, bool onlyFunctions) c
out << ss.str(); out << ss.str();
} }
class AsyncTraceStorage : public TraceStorage class AsyncTraceStorage CV_FINAL : public TraceStorage
{ {
mutable std::ofstream out; mutable std::ofstream out;
public: public:
@ -744,7 +744,7 @@ public:
out.close(); out.close();
} }
bool put(const TraceMessage& msg) const bool put(const TraceMessage& msg) const CV_OVERRIDE
{ {
if (msg.hasError) if (msg.hasError)
return false; return false;
@ -754,7 +754,7 @@ public:
} }
}; };
class SyncTraceStorage : public TraceStorage class SyncTraceStorage CV_FINAL : public TraceStorage
{ {
mutable std::ofstream out; mutable std::ofstream out;
mutable cv::Mutex mutex; mutable cv::Mutex mutex;
@ -774,7 +774,7 @@ public:
out.close(); out.close();
} }
bool put(const TraceMessage& msg) const bool put(const TraceMessage& msg) const CV_OVERRIDE
{ {
if (msg.hasError) if (msg.hasError)
return false; return false;

Loading…
Cancel
Save