mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -116,6 +116,65 @@ String dumpRange(const Range& argument)
|
||||
}
|
||||
}
|
||||
|
||||
CV_WRAP static inline
|
||||
int testOverwriteNativeMethod(int argument)
|
||||
{
|
||||
return argument;
|
||||
}
|
||||
|
||||
CV_WRAP static inline
|
||||
String testReservedKeywordConversion(int positional_argument, int lambda = 2, int from = 3)
|
||||
{
|
||||
return format("arg=%d, lambda=%d, from=%d", positional_argument, lambda, from);
|
||||
}
|
||||
|
||||
CV_EXPORTS_W String dumpVectorOfInt(const std::vector<int>& vec);
|
||||
|
||||
CV_EXPORTS_W String dumpVectorOfDouble(const std::vector<double>& vec);
|
||||
|
||||
CV_EXPORTS_W String dumpVectorOfRect(const std::vector<Rect>& vec);
|
||||
|
||||
CV_WRAP static inline
|
||||
void generateVectorOfRect(size_t len, CV_OUT std::vector<Rect>& vec)
|
||||
{
|
||||
vec.resize(len);
|
||||
if (len > 0)
|
||||
{
|
||||
RNG rng(12345);
|
||||
Mat tmp(static_cast<int>(len), 1, CV_32SC4);
|
||||
rng.fill(tmp, RNG::UNIFORM, 10, 20);
|
||||
tmp.copyTo(vec);
|
||||
}
|
||||
}
|
||||
|
||||
CV_WRAP static inline
|
||||
void generateVectorOfInt(size_t len, CV_OUT std::vector<int>& vec)
|
||||
{
|
||||
vec.resize(len);
|
||||
if (len > 0)
|
||||
{
|
||||
RNG rng(554433);
|
||||
Mat tmp(static_cast<int>(len), 1, CV_32SC1);
|
||||
rng.fill(tmp, RNG::UNIFORM, -10, 10);
|
||||
tmp.copyTo(vec);
|
||||
}
|
||||
}
|
||||
|
||||
CV_WRAP static inline
|
||||
void generateVectorOfMat(size_t len, int rows, int cols, int dtype, CV_OUT std::vector<Mat>& vec)
|
||||
{
|
||||
vec.resize(len);
|
||||
if (len > 0)
|
||||
{
|
||||
RNG rng(65431);
|
||||
for (size_t i = 0; i < len; ++i)
|
||||
{
|
||||
vec[i].create(rows, cols, dtype);
|
||||
rng.fill(vec[i], RNG::UNIFORM, 0, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CV_WRAP static inline
|
||||
void testRaiseGeneralException()
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
# ifdef _MSC_VER
|
||||
# include <nmmintrin.h>
|
||||
# if defined(_M_X64)
|
||||
# define CV_POPCNT_U64 _mm_popcnt_u64
|
||||
# define CV_POPCNT_U64 (int)_mm_popcnt_u64
|
||||
# endif
|
||||
# define CV_POPCNT_U32 _mm_popcnt_u32
|
||||
# else
|
||||
|
||||
@@ -707,14 +707,47 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************************\
|
||||
* CV_NODISCARD_STD attribute (C++17) *
|
||||
* encourages the compiler to issue a warning if the return value is discarded *
|
||||
\****************************************************************************************/
|
||||
#ifndef CV_NODISCARD_STD
|
||||
# ifndef __has_cpp_attribute
|
||||
// workaround preprocessor non-compliance https://reviews.llvm.org/D57851
|
||||
# define __has_cpp_attribute(__x) 0
|
||||
# endif
|
||||
# if __has_cpp_attribute(nodiscard)
|
||||
# define CV_NODISCARD_STD [[nodiscard]]
|
||||
# elif __cplusplus >= 201703L
|
||||
// available when compiler is C++17 compliant
|
||||
# define CV_NODISCARD_STD [[nodiscard]]
|
||||
# elif defined(_MSC_VER) && _MSC_VER >= 1911 && _MSVC_LANG >= 201703L
|
||||
// available with VS2017 v15.3+ with /std:c++17 or higher; works on functions and classes
|
||||
# define CV_NODISCARD_STD [[nodiscard]]
|
||||
# elif defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 700) && (__cplusplus >= 201103L)
|
||||
// available with GCC 7.0+; works on functions, works or silently fails on classes
|
||||
# define CV_NODISCARD_STD [[nodiscard]]
|
||||
# elif defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 408) && (__cplusplus >= 201103L)
|
||||
// available with GCC 4.8+ but it usually does nothing and can fail noisily -- therefore not used
|
||||
// define CV_NODISCARD_STD [[gnu::warn_unused_result]]
|
||||
# endif
|
||||
#endif
|
||||
#ifndef CV_NODISCARD_STD
|
||||
# define CV_NODISCARD_STD /* nothing by default */
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************\
|
||||
* CV_NODISCARD attribute *
|
||||
* encourages the compiler to issue a warning if the return value is discarded (C++17) *
|
||||
* CV_NODISCARD attribute (deprecated, GCC only) *
|
||||
* DONT USE: use instead the standard CV_NODISCARD_STD macro above *
|
||||
* this legacy method silently fails to issue warning until some version *
|
||||
* after gcc 6.3.0. Yet with gcc 7+ you can use the above standard method *
|
||||
* which makes this method useless. Don't use it. *
|
||||
* @deprecated use instead CV_NODISCARD_STD *
|
||||
\****************************************************************************************/
|
||||
#ifndef CV_NODISCARD
|
||||
# if defined(__GNUC__)
|
||||
# define CV_NODISCARD __attribute__((__warn_unused_result__)) // at least available with GCC 3.4
|
||||
# define CV_NODISCARD __attribute__((__warn_unused_result__))
|
||||
# elif defined(__clang__) && defined(__has_attribute)
|
||||
# if __has_attribute(__warn_unused_result__)
|
||||
# define CV_NODISCARD __attribute__((__warn_unused_result__))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1183,14 +1183,14 @@ public:
|
||||
The method creates a square diagonal matrix from specified main diagonal.
|
||||
@param d One-dimensional matrix that represents the main diagonal.
|
||||
*/
|
||||
static Mat diag(const Mat& d);
|
||||
CV_NODISCARD_STD static Mat diag(const Mat& d);
|
||||
|
||||
/** @brief Creates a full copy of the array and the underlying data.
|
||||
|
||||
The method creates a full copy of the array. The original step[] is not taken into account. So, the
|
||||
array copy is a continuous array occupying total()*elemSize() bytes.
|
||||
*/
|
||||
Mat clone() const CV_NODISCARD;
|
||||
CV_NODISCARD_STD Mat clone() const;
|
||||
|
||||
/** @brief Copies the matrix to another one.
|
||||
|
||||
@@ -1358,20 +1358,20 @@ public:
|
||||
@param cols Number of columns.
|
||||
@param type Created matrix type.
|
||||
*/
|
||||
static MatExpr zeros(int rows, int cols, int type);
|
||||
CV_NODISCARD_STD static MatExpr zeros(int rows, int cols, int type);
|
||||
|
||||
/** @overload
|
||||
@param size Alternative to the matrix size specification Size(cols, rows) .
|
||||
@param type Created matrix type.
|
||||
*/
|
||||
static MatExpr zeros(Size size, int type);
|
||||
CV_NODISCARD_STD static MatExpr zeros(Size size, int type);
|
||||
|
||||
/** @overload
|
||||
@param ndims Array dimensionality.
|
||||
@param sz Array of integers specifying the array shape.
|
||||
@param type Created matrix type.
|
||||
*/
|
||||
static MatExpr zeros(int ndims, const int* sz, int type);
|
||||
CV_NODISCARD_STD static MatExpr zeros(int ndims, const int* sz, int type);
|
||||
|
||||
/** @brief Returns an array of all 1's of the specified size and type.
|
||||
|
||||
@@ -1389,20 +1389,20 @@ public:
|
||||
@param cols Number of columns.
|
||||
@param type Created matrix type.
|
||||
*/
|
||||
static MatExpr ones(int rows, int cols, int type);
|
||||
CV_NODISCARD_STD static MatExpr ones(int rows, int cols, int type);
|
||||
|
||||
/** @overload
|
||||
@param size Alternative to the matrix size specification Size(cols, rows) .
|
||||
@param type Created matrix type.
|
||||
*/
|
||||
static MatExpr ones(Size size, int type);
|
||||
CV_NODISCARD_STD static MatExpr ones(Size size, int type);
|
||||
|
||||
/** @overload
|
||||
@param ndims Array dimensionality.
|
||||
@param sz Array of integers specifying the array shape.
|
||||
@param type Created matrix type.
|
||||
*/
|
||||
static MatExpr ones(int ndims, const int* sz, int type);
|
||||
CV_NODISCARD_STD static MatExpr ones(int ndims, const int* sz, int type);
|
||||
|
||||
/** @brief Returns an identity matrix of the specified size and type.
|
||||
|
||||
@@ -1418,13 +1418,13 @@ public:
|
||||
@param cols Number of columns.
|
||||
@param type Created matrix type.
|
||||
*/
|
||||
static MatExpr eye(int rows, int cols, int type);
|
||||
CV_NODISCARD_STD static MatExpr eye(int rows, int cols, int type);
|
||||
|
||||
/** @overload
|
||||
@param size Alternative matrix size specification as Size(cols, rows) .
|
||||
@param type Created matrix type.
|
||||
*/
|
||||
static MatExpr eye(Size size, int type);
|
||||
CV_NODISCARD_STD static MatExpr eye(Size size, int type);
|
||||
|
||||
/** @brief Allocates new array data if needed.
|
||||
|
||||
@@ -2287,7 +2287,7 @@ public:
|
||||
Mat_ row(int y) const;
|
||||
Mat_ col(int x) const;
|
||||
Mat_ diag(int d=0) const;
|
||||
Mat_ clone() const CV_NODISCARD;
|
||||
CV_NODISCARD_STD Mat_ clone() const;
|
||||
|
||||
//! overridden forms of Mat::elemSize() etc.
|
||||
size_t elemSize() const;
|
||||
@@ -2300,14 +2300,14 @@ public:
|
||||
size_t stepT(int i=0) const;
|
||||
|
||||
//! overridden forms of Mat::zeros() etc. Data type is omitted, of course
|
||||
static MatExpr zeros(int rows, int cols);
|
||||
static MatExpr zeros(Size size);
|
||||
static MatExpr zeros(int _ndims, const int* _sizes);
|
||||
static MatExpr ones(int rows, int cols);
|
||||
static MatExpr ones(Size size);
|
||||
static MatExpr ones(int _ndims, const int* _sizes);
|
||||
static MatExpr eye(int rows, int cols);
|
||||
static MatExpr eye(Size size);
|
||||
CV_NODISCARD_STD static MatExpr zeros(int rows, int cols);
|
||||
CV_NODISCARD_STD static MatExpr zeros(Size size);
|
||||
CV_NODISCARD_STD static MatExpr zeros(int _ndims, const int* _sizes);
|
||||
CV_NODISCARD_STD static MatExpr ones(int rows, int cols);
|
||||
CV_NODISCARD_STD static MatExpr ones(Size size);
|
||||
CV_NODISCARD_STD static MatExpr ones(int _ndims, const int* _sizes);
|
||||
CV_NODISCARD_STD static MatExpr eye(int rows, int cols);
|
||||
CV_NODISCARD_STD static MatExpr eye(Size size);
|
||||
|
||||
//! some more overridden methods
|
||||
Mat_& adjustROI( int dtop, int dbottom, int dleft, int dright );
|
||||
@@ -2450,10 +2450,11 @@ public:
|
||||
//! <0 - a diagonal from the lower half)
|
||||
UMat diag(int d=0) const;
|
||||
//! constructs a square diagonal matrix which main diagonal is vector "d"
|
||||
static UMat diag(const UMat& d);
|
||||
CV_NODISCARD_STD static UMat diag(const UMat& d, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat diag(const UMat& d) { return diag(d, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
|
||||
//! returns deep copy of the matrix, i.e. the data is copied
|
||||
UMat clone() const CV_NODISCARD;
|
||||
CV_NODISCARD_STD UMat clone() const;
|
||||
//! copies the matrix content to "m".
|
||||
// It calls m.create(this->size(), this->type()).
|
||||
void copyTo( OutputArray m ) const;
|
||||
@@ -2484,14 +2485,22 @@ public:
|
||||
double dot(InputArray m) const;
|
||||
|
||||
//! Matlab-style matrix initialization
|
||||
static UMat zeros(int rows, int cols, int type);
|
||||
static UMat zeros(Size size, int type);
|
||||
static UMat zeros(int ndims, const int* sz, int type);
|
||||
static UMat ones(int rows, int cols, int type);
|
||||
static UMat ones(Size size, int type);
|
||||
static UMat ones(int ndims, const int* sz, int type);
|
||||
static UMat eye(int rows, int cols, int type);
|
||||
static UMat eye(Size size, int type);
|
||||
CV_NODISCARD_STD static UMat zeros(int rows, int cols, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat zeros(Size size, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat zeros(int ndims, const int* sz, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat zeros(int rows, int cols, int type) { return zeros(rows, cols, type, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
CV_NODISCARD_STD static UMat zeros(Size size, int type) { return zeros(size, type, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
CV_NODISCARD_STD static UMat zeros(int ndims, const int* sz, int type) { return zeros(ndims, sz, type, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
CV_NODISCARD_STD static UMat ones(int rows, int cols, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat ones(Size size, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat ones(int ndims, const int* sz, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat ones(int rows, int cols, int type) { return ones(rows, cols, type, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
CV_NODISCARD_STD static UMat ones(Size size, int type) { return ones(size, type, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
CV_NODISCARD_STD static UMat ones(int ndims, const int* sz, int type) { return ones(ndims, sz, type, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
CV_NODISCARD_STD static UMat eye(int rows, int cols, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat eye(Size size, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);
|
||||
CV_NODISCARD_STD static UMat eye(int rows, int cols, int type) { return eye(rows, cols, type, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
CV_NODISCARD_STD static UMat eye(Size size, int type) { return eye(size, type, USAGE_DEFAULT); } // OpenCV 5.0: remove abi compatibility overload
|
||||
|
||||
//! allocates new matrix data unless the matrix already has specified size and type.
|
||||
// previous data is unreferenced if needed.
|
||||
@@ -2757,7 +2766,7 @@ public:
|
||||
SparseMat& operator = (const Mat& m);
|
||||
|
||||
//! creates full copy of the matrix
|
||||
SparseMat clone() const CV_NODISCARD;
|
||||
CV_NODISCARD_STD SparseMat clone() const;
|
||||
|
||||
//! copies all the data to the destination matrix. All the previous content of m is erased
|
||||
void copyTo( SparseMat& m ) const;
|
||||
@@ -2994,7 +3003,7 @@ public:
|
||||
SparseMat_& operator = (const Mat& m);
|
||||
|
||||
//! makes full copy of the matrix. All the elements are duplicated
|
||||
SparseMat_ clone() const CV_NODISCARD;
|
||||
CV_NODISCARD_STD SparseMat_ clone() const;
|
||||
//! equivalent to cv::SparseMat::create(dims, _sizes, DataType<_Tp>::type)
|
||||
void create(int dims, const int* _sizes);
|
||||
//! converts sparse matrix to the old-style CvSparseMat. All the elements are copied
|
||||
|
||||
@@ -148,22 +148,22 @@ public:
|
||||
|
||||
Matx(std::initializer_list<_Tp>); //!< initialize from an initializer list
|
||||
|
||||
static Matx all(_Tp alpha);
|
||||
static Matx zeros();
|
||||
static Matx ones();
|
||||
static Matx eye();
|
||||
static Matx diag(const diag_type& d);
|
||||
CV_NODISCARD_STD static Matx all(_Tp alpha);
|
||||
CV_NODISCARD_STD static Matx zeros();
|
||||
CV_NODISCARD_STD static Matx ones();
|
||||
CV_NODISCARD_STD static Matx eye();
|
||||
CV_NODISCARD_STD static Matx diag(const diag_type& d);
|
||||
/** @brief Generates uniformly distributed random numbers
|
||||
@param a Range boundary.
|
||||
@param b The other range boundary (boundaries don't have to be ordered, the lower boundary is inclusive,
|
||||
the upper one is exclusive).
|
||||
*/
|
||||
static Matx randu(_Tp a, _Tp b);
|
||||
CV_NODISCARD_STD static Matx randu(_Tp a, _Tp b);
|
||||
/** @brief Generates normally distributed random numbers
|
||||
@param a Mean value.
|
||||
@param b Standard deviation.
|
||||
*/
|
||||
static Matx randn(_Tp a, _Tp b);
|
||||
CV_NODISCARD_STD static Matx randn(_Tp a, _Tp b);
|
||||
|
||||
//! dot product computed with the default precision
|
||||
_Tp dot(const Matx<_Tp, m, n>& v) const;
|
||||
|
||||
@@ -235,7 +235,11 @@ public:
|
||||
|
||||
/**
|
||||
* @param d OpenCL handle (cl_device_id). clRetainDevice() is called on success.
|
||||
*/
|
||||
*
|
||||
* @note Ownership of the passed device is passed to OpenCV on success.
|
||||
* The caller should additionally call `clRetainDevice` on it if it intends
|
||||
* to continue using the device.
|
||||
*/
|
||||
static Device fromHandle(void* d);
|
||||
|
||||
struct Impl;
|
||||
@@ -495,8 +499,8 @@ public:
|
||||
template<typename... _Tps> inline
|
||||
Kernel& args(const _Tps&... kernel_args) { set_args_(0, kernel_args...); return *this; }
|
||||
|
||||
/** @brief Run the OpenCL kernel (globalsize value may be adjusted)
|
||||
|
||||
/** @brief Run the OpenCL kernel.
|
||||
@param dims the work problem dimensions. It is the length of globalsize and localsize. It can be either 1, 2 or 3.
|
||||
@param globalsize work items for each dimension. It is not the final globalsize passed to
|
||||
OpenCL. Each dimension will be adjusted to the nearest integer divisible by the corresponding
|
||||
@@ -505,12 +509,26 @@ public:
|
||||
@param localsize work-group size for each dimension.
|
||||
@param sync specify whether to wait for OpenCL computation to finish before return.
|
||||
@param q command queue
|
||||
|
||||
@note Use run_() if your kernel code doesn't support adjusted globalsize.
|
||||
*/
|
||||
bool run(int dims, size_t globalsize[],
|
||||
size_t localsize[], bool sync, const Queue& q=Queue());
|
||||
|
||||
/** @brief Run the OpenCL kernel
|
||||
*
|
||||
* @param dims the work problem dimensions. It is the length of globalsize and localsize. It can be either 1, 2 or 3.
|
||||
* @param globalsize work items for each dimension. This value is passed to OpenCL without changes.
|
||||
* @param localsize work-group size for each dimension.
|
||||
* @param sync specify whether to wait for OpenCL computation to finish before return.
|
||||
* @param q command queue
|
||||
*/
|
||||
bool run_(int dims, size_t globalsize[], size_t localsize[], bool sync, const Queue& q=Queue());
|
||||
|
||||
bool runTask(bool sync, const Queue& q=Queue());
|
||||
|
||||
/** @brief Similar to synchronized run() call with returning of kernel execution time
|
||||
/** @brief Similar to synchronized run_() call with returning of kernel execution time
|
||||
*
|
||||
* Separate OpenCL command queue may be used (with CL_QUEUE_PROFILING_ENABLE)
|
||||
* @return Execution time in nanoseconds or negative number on error
|
||||
*/
|
||||
@@ -826,11 +844,13 @@ public:
|
||||
OpenCLExecutionContext cloneWithNewQueue() const;
|
||||
|
||||
/** @brief Creates OpenCL execution context
|
||||
* OpenCV will check if available OpenCL platform has platformName name, then assign context to
|
||||
* OpenCV and call `clRetainContext` function. The deviceID device will be used as target device and
|
||||
* new command queue will be created.
|
||||
* OpenCV will check if available OpenCL platform has platformName name,
|
||||
* then assign context to OpenCV.
|
||||
* The deviceID device will be used as target device and a new command queue will be created.
|
||||
*
|
||||
* @note Lifetime of passed handles is transferred to OpenCV wrappers on success
|
||||
* @note On success, ownership of one reference of the context and device is taken.
|
||||
* The caller should additionally call `clRetainContext` and/or `clRetainDevice`
|
||||
* to increase the reference count if it wishes to continue using them.
|
||||
*
|
||||
* @param platformName name of OpenCL platform to attach, this string is used to check if platform is available to OpenCV at runtime
|
||||
* @param platformID ID of platform attached context was created for (cl_platform_id)
|
||||
|
||||
@@ -144,6 +144,10 @@ static void dumpOpenCLInformation()
|
||||
DUMP_MESSAGE_STDOUT(" Double support = " << doubleSupportStr);
|
||||
DUMP_CONFIG_PROPERTY("cv_ocl_current_haveDoubleSupport", device.doubleFPConfig() > 0);
|
||||
|
||||
const char* halfSupportStr = device.halfFPConfig() > 0 ? "Yes" : "No";
|
||||
DUMP_MESSAGE_STDOUT(" Half support = " << halfSupportStr);
|
||||
DUMP_CONFIG_PROPERTY("cv_ocl_current_haveHalfSupport", device.halfFPConfig() > 0);
|
||||
|
||||
const char* isUnifiedMemoryStr = device.hostUnifiedMemory() ? "Yes" : "No";
|
||||
DUMP_MESSAGE_STDOUT(" Host unified memory = " << isUnifiedMemoryStr);
|
||||
DUMP_CONFIG_PROPERTY("cv_ocl_current_hostUnifiedMemory", device.hostUnifiedMemory());
|
||||
@@ -191,6 +195,9 @@ static void dumpOpenCLInformation()
|
||||
|
||||
DUMP_MESSAGE_STDOUT(" Preferred vector width double = " << device.preferredVectorWidthDouble());
|
||||
DUMP_CONFIG_PROPERTY("cv_ocl_current_preferredVectorWidthDouble", device.preferredVectorWidthDouble());
|
||||
|
||||
DUMP_MESSAGE_STDOUT(" Preferred vector width half = " << device.preferredVectorWidthHalf());
|
||||
DUMP_CONFIG_PROPERTY("cv_ocl_current_preferredVectorWidthHalf", device.preferredVectorWidthHalf());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ static tbb::task_scheduler_init& getScheduler()
|
||||
}
|
||||
#endif
|
||||
|
||||
/** OpenMP parallel_for API implementation
|
||||
/** TBB parallel_for API implementation
|
||||
*
|
||||
* @sa setParallelForBackend
|
||||
* @ingroup core_parallel_backend
|
||||
|
||||
@@ -162,13 +162,23 @@ public:
|
||||
//! default constructor
|
||||
Point_();
|
||||
Point_(_Tp _x, _Tp _y);
|
||||
#if (defined(__GNUC__) && __GNUC__ < 5) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
||||
Point_(const Point_& pt);
|
||||
Point_(Point_&& pt) CV_NOEXCEPT;
|
||||
Point_(Point_&& pt) CV_NOEXCEPT = default;
|
||||
#elif OPENCV_ABI_COMPATIBILITY < 500
|
||||
Point_(const Point_& pt) = default;
|
||||
Point_(Point_&& pt) CV_NOEXCEPT = default;
|
||||
#endif
|
||||
Point_(const Size_<_Tp>& sz);
|
||||
Point_(const Vec<_Tp, 2>& v);
|
||||
|
||||
#if (defined(__GNUC__) && __GNUC__ < 5) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
||||
Point_& operator = (const Point_& pt);
|
||||
Point_& operator = (Point_&& pt) CV_NOEXCEPT;
|
||||
Point_& operator = (Point_&& pt) CV_NOEXCEPT = default;
|
||||
#elif OPENCV_ABI_COMPATIBILITY < 500
|
||||
Point_& operator = (const Point_& pt) = default;
|
||||
Point_& operator = (Point_&& pt) CV_NOEXCEPT = default;
|
||||
#endif
|
||||
//! conversion to another data type
|
||||
template<typename _Tp2> operator Point_<_Tp2>() const;
|
||||
|
||||
@@ -244,13 +254,17 @@ public:
|
||||
//! default constructor
|
||||
Point3_();
|
||||
Point3_(_Tp _x, _Tp _y, _Tp _z);
|
||||
Point3_(const Point3_& pt);
|
||||
Point3_(Point3_&& pt) CV_NOEXCEPT;
|
||||
#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Point3_(const Point3_& pt) = default;
|
||||
Point3_(Point3_&& pt) CV_NOEXCEPT = default;
|
||||
#endif
|
||||
explicit Point3_(const Point_<_Tp>& pt);
|
||||
Point3_(const Vec<_Tp, 3>& v);
|
||||
|
||||
Point3_& operator = (const Point3_& pt);
|
||||
Point3_& operator = (Point3_&& pt) CV_NOEXCEPT;
|
||||
#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Point3_& operator = (const Point3_& pt) = default;
|
||||
Point3_& operator = (Point3_&& pt) CV_NOEXCEPT = default;
|
||||
#endif
|
||||
//! conversion to another data type
|
||||
template<typename _Tp2> operator Point3_<_Tp2>() const;
|
||||
//! conversion to cv::Vec<>
|
||||
@@ -320,12 +334,16 @@ public:
|
||||
//! default constructor
|
||||
Size_();
|
||||
Size_(_Tp _width, _Tp _height);
|
||||
Size_(const Size_& sz);
|
||||
Size_(Size_&& sz) CV_NOEXCEPT;
|
||||
#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Size_(const Size_& sz) = default;
|
||||
Size_(Size_&& sz) CV_NOEXCEPT = default;
|
||||
#endif
|
||||
Size_(const Point_<_Tp>& pt);
|
||||
|
||||
Size_& operator = (const Size_& sz);
|
||||
Size_& operator = (Size_&& sz) CV_NOEXCEPT;
|
||||
#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Size_& operator = (const Size_& sz) = default;
|
||||
Size_& operator = (Size_&& sz) CV_NOEXCEPT = default;
|
||||
#endif
|
||||
//! the area (width*height)
|
||||
_Tp area() const;
|
||||
//! aspect ratio (width/height)
|
||||
@@ -425,13 +443,17 @@ public:
|
||||
//! default constructor
|
||||
Rect_();
|
||||
Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height);
|
||||
Rect_(const Rect_& r);
|
||||
Rect_(Rect_&& r) CV_NOEXCEPT;
|
||||
#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Rect_(const Rect_& r) = default;
|
||||
Rect_(Rect_&& r) CV_NOEXCEPT = default;
|
||||
#endif
|
||||
Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz);
|
||||
Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2);
|
||||
|
||||
Rect_& operator = ( const Rect_& r );
|
||||
Rect_& operator = ( Rect_&& r ) CV_NOEXCEPT;
|
||||
#if OPENCV_ABI_COMPATIBILITY < 500
|
||||
Rect_& operator = (const Rect_& r) = default;
|
||||
Rect_& operator = (Rect_&& r) CV_NOEXCEPT = default;
|
||||
#endif
|
||||
//! the top-left corner
|
||||
Point_<_Tp> tl() const;
|
||||
//! the bottom-right corner
|
||||
@@ -1165,13 +1187,11 @@ template<typename _Tp> inline
|
||||
Point_<_Tp>::Point_(_Tp _x, _Tp _y)
|
||||
: x(_x), y(_y) {}
|
||||
|
||||
#if (defined(__GNUC__) && __GNUC__ < 5) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
||||
template<typename _Tp> inline
|
||||
Point_<_Tp>::Point_(const Point_& pt)
|
||||
: x(pt.x), y(pt.y) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point_<_Tp>::Point_(Point_&& pt) CV_NOEXCEPT
|
||||
: x(std::move(pt.x)), y(std::move(pt.y)) {}
|
||||
#endif
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point_<_Tp>::Point_(const Size_<_Tp>& sz)
|
||||
@@ -1181,19 +1201,14 @@ template<typename _Tp> inline
|
||||
Point_<_Tp>::Point_(const Vec<_Tp,2>& v)
|
||||
: x(v[0]), y(v[1]) {}
|
||||
|
||||
#if (defined(__GNUC__) && __GNUC__ < 5) // GCC 4.x bug. Details: https://github.com/opencv/opencv/pull/20837
|
||||
template<typename _Tp> inline
|
||||
Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)
|
||||
{
|
||||
x = pt.x; y = pt.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point_<_Tp>& Point_<_Tp>::operator = (Point_&& pt) CV_NOEXCEPT
|
||||
{
|
||||
x = std::move(pt.x); y = std::move(pt.y);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename _Tp> template<typename _Tp2> inline
|
||||
Point_<_Tp>::operator Point_<_Tp2>() const
|
||||
@@ -1432,14 +1447,6 @@ template<typename _Tp> inline
|
||||
Point3_<_Tp>::Point3_(_Tp _x, _Tp _y, _Tp _z)
|
||||
: x(_x), y(_y), z(_z) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point3_<_Tp>::Point3_(const Point3_& pt)
|
||||
: x(pt.x), y(pt.y), z(pt.z) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point3_<_Tp>::Point3_(Point3_&& pt) CV_NOEXCEPT
|
||||
: x(std::move(pt.x)), y(std::move(pt.y)), z(std::move(pt.z)) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point3_<_Tp>::Point3_(const Point_<_Tp>& pt)
|
||||
: x(pt.x), y(pt.y), z(_Tp()) {}
|
||||
@@ -1460,20 +1467,6 @@ Point3_<_Tp>::operator Vec<_Tp, 3>() const
|
||||
return Vec<_Tp, 3>(x, y, z);
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point3_<_Tp>& Point3_<_Tp>::operator = (const Point3_& pt)
|
||||
{
|
||||
x = pt.x; y = pt.y; z = pt.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point3_<_Tp>& Point3_<_Tp>::operator = (Point3_&& pt) CV_NOEXCEPT
|
||||
{
|
||||
x = std::move(pt.x); y = std::move(pt.y); z = std::move(pt.z);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
_Tp Point3_<_Tp>::dot(const Point3_& pt) const
|
||||
{
|
||||
@@ -1686,14 +1679,6 @@ template<typename _Tp> inline
|
||||
Size_<_Tp>::Size_(_Tp _width, _Tp _height)
|
||||
: width(_width), height(_height) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Size_<_Tp>::Size_(const Size_& sz)
|
||||
: width(sz.width), height(sz.height) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Size_<_Tp>::Size_(Size_&& sz) CV_NOEXCEPT
|
||||
: width(std::move(sz.width)), height(std::move(sz.height)) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Size_<_Tp>::Size_(const Point_<_Tp>& pt)
|
||||
: width(pt.x), height(pt.y) {}
|
||||
@@ -1704,20 +1689,6 @@ Size_<_Tp>::operator Size_<_Tp2>() const
|
||||
return Size_<_Tp2>(saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height));
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Size_<_Tp>& Size_<_Tp>::operator = (const Size_<_Tp>& sz)
|
||||
{
|
||||
width = sz.width; height = sz.height;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Size_<_Tp>& Size_<_Tp>::operator = (Size_<_Tp>&& sz) CV_NOEXCEPT
|
||||
{
|
||||
width = std::move(sz.width); height = std::move(sz.height);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
_Tp Size_<_Tp>::area() const
|
||||
{
|
||||
@@ -1828,14 +1799,6 @@ template<typename _Tp> inline
|
||||
Rect_<_Tp>::Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height)
|
||||
: x(_x), y(_y), width(_width), height(_height) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Rect_<_Tp>::Rect_(const Rect_<_Tp>& r)
|
||||
: x(r.x), y(r.y), width(r.width), height(r.height) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Rect_<_Tp>::Rect_(Rect_<_Tp>&& r) CV_NOEXCEPT
|
||||
: x(std::move(r.x)), y(std::move(r.y)), width(std::move(r.width)), height(std::move(r.height)) {}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Rect_<_Tp>::Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz)
|
||||
: x(org.x), y(org.y), width(sz.width), height(sz.height) {}
|
||||
@@ -1849,26 +1812,6 @@ Rect_<_Tp>::Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2)
|
||||
height = std::max(pt1.y, pt2.y) - y;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Rect_<_Tp>& Rect_<_Tp>::operator = ( const Rect_<_Tp>& r )
|
||||
{
|
||||
x = r.x;
|
||||
y = r.y;
|
||||
width = r.width;
|
||||
height = r.height;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Rect_<_Tp>& Rect_<_Tp>::operator = ( Rect_<_Tp>&& r ) CV_NOEXCEPT
|
||||
{
|
||||
x = std::move(r.x);
|
||||
y = std::move(r.y);
|
||||
width = std::move(r.width);
|
||||
height = std::move(r.height);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
Point_<_Tp> Rect_<_Tp>::tl() const
|
||||
{
|
||||
|
||||
@@ -714,9 +714,27 @@ void Mat::forEach_impl(const Functor& operation) {
|
||||
/////////////////////////// Synchronization Primitives ///////////////////////////////
|
||||
|
||||
#if !defined(_M_CEE)
|
||||
#ifndef OPENCV_DISABLE_THREAD_SUPPORT
|
||||
typedef std::recursive_mutex Mutex;
|
||||
typedef std::lock_guard<cv::Mutex> AutoLock;
|
||||
#endif
|
||||
#else // OPENCV_DISABLE_THREAD_SUPPORT
|
||||
// Custom (failing) implementation of `std::recursive_mutex`.
|
||||
struct Mutex {
|
||||
void lock(){
|
||||
CV_Error(cv::Error::StsNotImplemented,
|
||||
"cv::Mutex is disabled by OPENCV_DISABLE_THREAD_SUPPORT=ON");
|
||||
}
|
||||
void unlock(){
|
||||
CV_Error(cv::Error::StsNotImplemented,
|
||||
"cv::Mutex is disabled by OPENCV_DISABLE_THREAD_SUPPORT=ON");
|
||||
}
|
||||
};
|
||||
// Stub for cv::AutoLock when threads are disabled.
|
||||
struct AutoLock {
|
||||
AutoLock(Mutex &) { }
|
||||
};
|
||||
#endif // OPENCV_DISABLE_THREAD_SUPPORT
|
||||
#endif // !defined(_M_CEE)
|
||||
|
||||
|
||||
/** @brief Designed for command line parsing
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
# define OPENCV_HAVE_FILESYSTEM_SUPPORT 1
|
||||
# elif defined(__APPLE__)
|
||||
# include <TargetConditionals.h>
|
||||
# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX) || (!defined(TARGET_OS_OSX) && !TARGET_OS_IPHONE)
|
||||
# define OPENCV_HAVE_FILESYSTEM_SUPPORT 1 // OSX only
|
||||
# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS)
|
||||
# define OPENCV_HAVE_FILESYSTEM_SUPPORT 1 // OSX, iOS only
|
||||
# endif
|
||||
# else
|
||||
/* unknown */
|
||||
|
||||
Reference in New Issue
Block a user