1 #ifndef __OPENCV_PERF_GPU_UTILITY_HPP__
\r
2 #define __OPENCV_PERF_GPU_UTILITY_HPP__
\r
4 void fill(cv::Mat& m, double a, double b);
\r
7 using perf::MatDepth;
\r
9 CV_ENUM(BorderMode, cv::BORDER_REFLECT101, cv::BORDER_REPLICATE, cv::BORDER_CONSTANT, cv::BORDER_REFLECT, cv::BORDER_WRAP)
\r
10 CV_ENUM(Interpolation, cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_CUBIC)
\r
11 CV_ENUM(NormType, cv::NORM_INF, cv::NORM_L1, cv::NORM_L2, cv::NORM_HAMMING)
\r
19 explicit CvtColorInfo(int scn_=0, int dcn_=0, int code_=0) : scn(scn_), dcn(dcn_), code(code_) {}
\r
22 void PrintTo(const CvtColorInfo& info, std::ostream* os);
\r
24 #define IMPLEMENT_PARAM_CLASS(name, type) \
\r
28 name ( type arg = type ()) : val_(arg) {} \
\r
29 operator type () const {return val_;} \
\r
33 inline void PrintTo( name param, std::ostream* os) \
\r
35 *os << #name << " = " << testing::PrintToString(static_cast< type >(param)); \
\r
38 IMPLEMENT_PARAM_CLASS(Channels, int)
\r
40 namespace cv { namespace gpu
\r
42 void PrintTo(const cv::gpu::DeviceInfo& info, std::ostream* os);
\r
45 #define GPU_PERF_TEST(name, ...) \
\r
46 struct name : perf::TestBaseWithParam< std::tr1::tuple< __VA_ARGS__ > > \
\r
51 void PerfTestBody(); \
\r
53 TEST_P(name, perf){ RunPerfTestBody(); } \
\r
54 void name :: PerfTestBody()
\r
56 #define GPU_PERF_TEST_1(name, param_type) \
\r
57 struct name : perf::TestBaseWithParam< param_type > \
\r
62 void PerfTestBody(); \
\r
64 TEST_P(name, perf){ RunPerfTestBody(); } \
\r
65 void name :: PerfTestBody()
\r
67 #define GPU_TYPICAL_MAT_SIZES testing::Values(perf::szSXGA, perf::sz1080p, cv::Size(1800, 1500))
\r
69 cv::Mat readImage(const std::string& fileName, int flags = cv::IMREAD_COLOR);
\r
71 const std::vector<cv::gpu::DeviceInfo>& devices();
\r
73 #define ALL_DEVICES testing::ValuesIn(devices())
\r
75 #define GET_PARAM(k) std::tr1::get< k >(GetParam())
\r
77 #endif // __OPENCV_PERF_GPU_UTILITY_HPP__
\r