added GPU bilateral filter + tests
[profile/ivi/opencv.git] / modules / gpu / perf / utility.hpp
1 #ifndef __OPENCV_PERF_GPU_UTILITY_HPP__\r
2 #define __OPENCV_PERF_GPU_UTILITY_HPP__\r
3 \r
4 #include "opencv2/core/core.hpp"\r
5 #include "opencv2/core/gpumat.hpp"\r
6 #include "opencv2/imgproc/imgproc.hpp"\r
7 #include "opencv2/ts/ts_perf.hpp"\r
8 \r
9 extern bool runOnGpu;\r
10 \r
11 void fillRandom(cv::Mat& m, double a = 0.0, double b = 255.0);\r
12 cv::Mat readImage(const std::string& fileName, int flags = cv::IMREAD_COLOR);\r
13 \r
14 using perf::MatType;\r
15 using perf::MatDepth;\r
16 \r
17 CV_ENUM(BorderMode, cv::BORDER_REFLECT101, cv::BORDER_REPLICATE, cv::BORDER_CONSTANT, cv::BORDER_REFLECT, cv::BORDER_WRAP)\r
18 #define ALL_BORDER_MODES testing::ValuesIn(BorderMode::all())\r
19 CV_ENUM(Interpolation, cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_CUBIC, cv::INTER_AREA)\r
20 #define ALL_INTERPOLATIONS testing::ValuesIn(Interpolation::all())\r
21 CV_ENUM(NormType, cv::NORM_INF, cv::NORM_L1, cv::NORM_L2, cv::NORM_HAMMING)\r
22 \r
23 struct CvtColorInfo\r
24 {\r
25     int scn;\r
26     int dcn;\r
27     int code;\r
28 \r
29     explicit CvtColorInfo(int scn_=0, int dcn_=0, int code_=0) : scn(scn_), dcn(dcn_), code(code_) {}\r
30 };\r
31 void PrintTo(const CvtColorInfo& info, std::ostream* os);\r
32 \r
33 #define GET_PARAM(k) std::tr1::get< k >(GetParam())\r
34 \r
35 #define DEF_PARAM_TEST(name, ...) typedef ::perf::TestBaseWithParam< std::tr1::tuple< __VA_ARGS__ > > name\r
36 #define DEF_PARAM_TEST_1(name, param_type) typedef ::perf::TestBaseWithParam< param_type > name\r
37 \r
38 DEF_PARAM_TEST_1(Sz, cv::Size);\r
39 typedef perf::Size_MatType Sz_Type;\r
40 DEF_PARAM_TEST(Sz_Depth, cv::Size, MatDepth);\r
41 DEF_PARAM_TEST(Sz_Depth_Cn, cv::Size, MatDepth, int);\r
42 \r
43 #define GPU_TYPICAL_MAT_SIZES testing::Values(perf::sz720p, perf::szSXGA, perf::sz1080p)\r
44 #define GPU_CHANNELS_1_3_4 testing::Values(1, 3, 4)\r
45 \r
46 #endif // __OPENCV_PERF_GPU_UTILITY_HPP__\r