using namespace std;\r
using namespace cv;\r
\r
-\r
-void Test::gen(Mat& mat, int rows, int cols, int type, Scalar low, Scalar high)\r
-{ \r
- mat.create(rows, cols, type);\r
-\r
- RNG rng(0);\r
- rng.fill(mat, RNG::UNIFORM, low, high);\r
-}\r
-\r
-\r
void Test::gen(Mat& mat, int rows, int cols, int type)\r
{ \r
mat.create(rows, cols, type);\r
-\r
Mat mat8u(rows, cols * mat.elemSize(), CV_8U, mat.data, mat.step);\r
\r
RNG rng(0);\r
vector<Test*>::iterator it = tests_.begin();\r
for (; it != tests_.end(); ++it)\r
{\r
- can_flush_ = false;\r
Test* test = *it;\r
\r
cout << endl << test->name() << ":\n";\r
description_.str("");\r
\r
cout << resetiosflags(ios_base::fixed | ios_base::left) << endl;\r
+ \r
can_flush_ = false;\r
}\r
\r
+#ifndef OPENCV_GPU_SAMPLE_PERFORMANCE_H_\r
+#define OPENCV_GPU_SAMPLE_PERFORMANCE_H_\r
+\r
#include <iostream>\r
#include <cstdio>\r
#include <vector>\r
class Test\r
{\r
public:\r
- Test(const std::string& name): name_(name) {}\r
+ explicit Test(const std::string& name): name_(name) {}\r
\r
const std::string& name() const { return name_; }\r
\r
- void gen(cv::Mat& mat, int rows, int cols, int type,\r
- cv::Scalar low, cv::Scalar high);\r
-\r
void gen(cv::Mat& mat, int rows, int cols, int type);\r
\r
virtual void run() = 0;\r
#define CPU_OFF TestSystem::instance()->cpuOff()\r
#define GPU_OFF TestSystem::instance()->gpuOff()\r
#define SUBTEST TestSystem::instance()->subtest()\r
-#define DESCRIPTION TestSystem::instance()->subtest()
\ No newline at end of file
+#define DESCRIPTION TestSystem::instance()->subtest()\r
+\r
+#endif // OPENCV_GPU_SAMPLE_PERFORMANCE_H_
\ No newline at end of file