This source file includes following definitions.
- parallel_for
- parallel_reduce
- _grainsize
- _grainsize
- begin
- end
- grainsize
- parallel_for
- parallel_reduce
- cvAlignPtr
- cvAlign
- cvGetMatSize
- ippiSize
- ippiSize
- ippiGetBorderType
- ippiGetDataType
#ifndef __OPENCV_CORE_PRIVATE_HPP__
#define __OPENCV_CORE_PRIVATE_HPP__
#ifndef __OPENCV_BUILD
# error this is a private header which should not be used from outside of the OpenCV library
#endif
#include "opencv2/core.hpp"
#include "cvconfig.h"
#ifdef HAVE_EIGEN
# if defined __GNUC__ && defined __APPLE__
# pragma GCC diagnostic ignored "-Wshadow"
# endif
# include <Eigen/Core>
# include "opencv2/core/eigen.hpp"
#endif
#ifdef HAVE_TBB
# include "tbb/tbb_stddef.h"
# if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
# include "tbb/tbb.h"
# include "tbb/task.h"
# undef min
# undef max
# else
# undef HAVE_TBB
# endif
#endif
namespace cv
{
#ifdef HAVE_TBB
typedef tbb::blocked_range<int> BlockedRange;
template<typename Body> static inline
void parallel_for( const BlockedRange& range, const Body& body )
{
tbb::parallel_for(range, body);
}
typedef tbb::split Split;
template<typename Body> static inline
void parallel_reduce( const BlockedRange& range, Body& body )
{
tbb::parallel_reduce(range, body);
}
typedef tbb::concurrent_vector<Rect> ConcurrentRectVector;
#else
class BlockedRange
{
public:
BlockedRange() : _begin(0), _end(0), _grainsize(0) {}
BlockedRange(int b, int e, int g=1) : _begin(b), _end(e), _grainsize(g) {}
int begin() const { return _begin; }
int end() const { return _end; }
int grainsize() const { return _grainsize; }
protected:
int _begin, _end, _grainsize;
};
template<typename Body> static inline
void parallel_for( const BlockedRange& range, const Body& body )
{
body(range);
}
typedef std::vector<Rect> ConcurrentRectVector;
class Split {};
template<typename Body> static inline
void parallel_reduce( const BlockedRange& range, Body& body )
{
body(range);
}
#endif
CV_EXPORTS const char* currentParallelFramework();
}
#define CV_MALLOC_ALIGN 16
#define CV_TOGGLE_FLT(x) ((x)^((int)(x) < 0 ? 0x7fffffff : 0))
#define CV_TOGGLE_DBL(x) ((x)^((int64)(x) < 0 ? CV_BIG_INT(0x7fffffffffffffff) : 0))
static inline void* cvAlignPtr( const void* ptr, int align = 32 )
{
CV_DbgAssert ( (align & (align-1)) == 0 );
return (void*)( ((size_t)ptr + align - 1) & ~(size_t)(align-1) );
}
static inline int cvAlign( int size, int align )
{
CV_DbgAssert( (align & (align-1)) == 0 && size < INT_MAX );
return (size + align - 1) & -align;
}
#ifdef IPL_DEPTH_8U
static inline cv::Size cvGetMatSize( const CvMat* mat )
{
return cv::Size(mat->cols, mat->rows);
}
#endif
namespace cv
{
CV_EXPORTS void scalarToRawData(const cv::Scalar& s, void* buf, int type, int unroll_to = 0);
}
#define CV_IMPL_PROPERTY_RO(type, name, member) \
inline type get##name() const { return member; }
#define CV_HELP_IMPL_PROPERTY(r_type, w_type, name, member) \
CV_IMPL_PROPERTY_RO(r_type, name, member) \
inline void set##name(w_type val) { member = val; }
#define CV_HELP_WRAP_PROPERTY(r_type, w_type, name, internal_name, internal_obj) \
r_type get##name() const { return internal_obj.get##internal_name(); } \
void set##name(w_type val) { internal_obj.set##internal_name(val); }
#define CV_IMPL_PROPERTY(type, name, member) CV_HELP_IMPL_PROPERTY(type, type, name, member)
#define CV_IMPL_PROPERTY_S(type, name, member) CV_HELP_IMPL_PROPERTY(type, const type &, name, member)
#define CV_WRAP_PROPERTY(type, name, internal_name, internal_obj) CV_HELP_WRAP_PROPERTY(type, type, name, internal_name, internal_obj)
#define CV_WRAP_PROPERTY_S(type, name, internal_name, internal_obj) CV_HELP_WRAP_PROPERTY(type, const type &, name, internal_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)
#ifdef HAVE_IPP
# include "ipp.h"
# define IPP_VERSION_X100 (IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR)
#define IPP_ALIGN 32
#define setIppErrorStatus() cv::ipp::setIppStatus(-1, CV_Func, __FILE__, __LINE__)
static inline IppiSize ippiSize(int width, int height)
{
IppiSize size = { width, height };
return size;
}
static inline IppiSize ippiSize(const cv::Size & _size)
{
IppiSize size = { _size.width, _size.height };
return size;
}
static inline IppiBorderType ippiGetBorderType(int borderTypeNI)
{
return borderTypeNI == cv::BORDER_CONSTANT ? ippBorderConst :
borderTypeNI == cv::BORDER_WRAP ? ippBorderWrap :
borderTypeNI == cv::BORDER_REPLICATE ? ippBorderRepl :
borderTypeNI == cv::BORDER_REFLECT_101 ? ippBorderMirror :
borderTypeNI == cv::BORDER_REFLECT ? ippBorderMirrorR : (IppiBorderType)-1;
}
static inline IppDataType ippiGetDataType(int depth)
{
return depth == CV_8U ? ipp8u :
depth == CV_8S ? ipp8s :
depth == CV_16U ? ipp16u :
depth == CV_16S ? ipp16s :
depth == CV_32S ? ipp32s :
depth == CV_32F ? ipp32f :
depth == CV_64F ? ipp64f : (IppDataType)-1;
}
#else
# define IPP_VERSION_X100 0
#endif
#define CV_IPP_CHECK_COND (cv::ipp::useIPP())
#define CV_IPP_CHECK() if(CV_IPP_CHECK_COND)
#ifndef IPPI_CALL
# define IPPI_CALL(func) CV_Assert((func) >= 0)
#endif
typedef enum CvStatus
{
CV_BADMEMBLOCK_ERR = -113,
CV_INPLACE_NOT_SUPPORTED_ERR= -112,
CV_UNMATCHED_ROI_ERR = -111,
CV_NOTFOUND_ERR = -110,
CV_BADCONVERGENCE_ERR = -109,
CV_BADDEPTH_ERR = -107,
CV_BADROI_ERR = -106,
CV_BADHEADER_ERR = -105,
CV_UNMATCHED_FORMATS_ERR = -104,
CV_UNSUPPORTED_COI_ERR = -103,
CV_UNSUPPORTED_CHANNELS_ERR = -102,
CV_UNSUPPORTED_DEPTH_ERR = -101,
CV_UNSUPPORTED_FORMAT_ERR = -100,
CV_BADARG_ERR = -49,
CV_NOTDEFINED_ERR = -48,
CV_BADCHANNELS_ERR = -47,
CV_BADRANGE_ERR = -44,
CV_BADSTEP_ERR = -29,
CV_BADFLAG_ERR = -12,
CV_DIV_BY_ZERO_ERR = -11,
CV_BADCOEF_ERR = -10,
CV_BADFACTOR_ERR = -7,
CV_BADPOINT_ERR = -6,
CV_BADSCALE_ERR = -4,
CV_OUTOFMEM_ERR = -3,
CV_NULLPTR_ERR = -2,
CV_BADSIZE_ERR = -1,
CV_NO_ERR = 0,
CV_OK = CV_NO_ERR
}
CvStatus;
#ifdef HAVE_TEGRA_OPTIMIZATION
namespace tegra {
CV_EXPORTS bool useTegra();
CV_EXPORTS void setUseTegra(bool flag);
}
#endif
#endif