1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
5 // Copyright (C) 2018 Intel Corporation
8 #ifndef OPENCV_GAPI_RENDER_TESTS_INL_HPP
9 #define OPENCV_GAPI_RENDER_TESTS_INL_HPP
11 #include "gapi_render_tests.hpp"
13 #include <opencv2/gapi/render.hpp>
18 TEST_P(RenderTextTest, AccuracyTest)
20 std::vector<cv::Point> points;
26 std::tie(sz, text, points, ff, fs, color, thick, lt, blo, isNV12Format) = GetParam();
29 for (const auto& p : points) {
30 cv::putText(out_mat_ocv, text, p, ff, fs, color, thick, lt, blo);
31 prims.emplace_back(cv::gapi::wip::draw::Text{text, p, ff, fs, color, thick, lt, blo});
36 EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
39 TEST_P(RenderRectTest, AccuracyTest)
41 std::vector<cv::Rect> rects;
44 std::tie(sz, rects, color, thick, lt, shift, isNV12Format) = GetParam();
47 for (const auto& r : rects) {
48 cv::rectangle(out_mat_ocv, r, color, thick, lt, shift);
49 prims.emplace_back(cv::gapi::wip::draw::Rect{r, color, thick, lt, shift});
54 EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
57 TEST_P(RenderCircleTest, AccuracyTest)
59 std::vector<cv::Point> points;
63 std::tie(sz, points, radius, color, thick, lt, shift, isNV12Format) = GetParam();
66 for (const auto& p : points) {
67 cv::circle(out_mat_ocv, p, radius, color, thick, lt, shift);
68 prims.emplace_back(cv::gapi::wip::draw::Circle{p, radius, color, thick, lt, shift});
73 EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
76 TEST_P(RenderLineTest, AccuracyTest)
78 std::vector<std::pair<cv::Point, cv::Point>> points;
81 std::tie(sz, points, color, thick, lt, shift, isNV12Format) = GetParam();
84 for (const auto& p : points) {
85 cv::line(out_mat_ocv, p.first, p.second, color, thick, lt, shift);
86 prims.emplace_back(cv::gapi::wip::draw::Line{p.first, p.second, color, thick, lt, shift});
91 EXPECT_EQ(0, cv::countNonZero(out_mat_gapi != out_mat_ocv));
96 #endif //OPENCV_GAPI_RENDER_TESTS_INL_HPP