From 40215f99d75f9807f879720ac9ecd2420c5402ad Mon Sep 17 00:00:00 2001 From: "Talamanov, Anatoliy" Date: Wed, 9 Oct 2019 13:41:36 +0300 Subject: [PATCH] Define operator<< for cv::gapi::wip::draw::Prim --- modules/gapi/test/common/gapi_tests_common.hpp | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/modules/gapi/test/common/gapi_tests_common.hpp b/modules/gapi/test/common/gapi_tests_common.hpp index 3d3141f..7dc61ef 100644 --- a/modules/gapi/test/common/gapi_tests_common.hpp +++ b/modules/gapi/test/common/gapi_tests_common.hpp @@ -16,6 +16,7 @@ #include #include "gapi_tests_helpers.hpp" +#include namespace { @@ -23,6 +24,38 @@ namespace { return o << (arg.tag.empty() ? "empty" : arg.tag); } + + inline std::ostream& operator<<(std::ostream& o, const cv::gapi::wip::draw::Prim& p) + { + using namespace cv::gapi::wip::draw; + switch (p.index()) + { + case Prim::index_of(): + o << "cv::gapi::draw::Rect"; + break; + case Prim::index_of(): + o << "cv::gapi::draw::Text"; + break; + case Prim::index_of(): + o << "cv::gapi::draw::Circle"; + break; + case Prim::index_of(): + o << "cv::gapi::draw::Line"; + break; + case Prim::index_of(): + o << "cv::gapi::draw::Mosaic"; + break; + case Prim::index_of(): + o << "cv::gapi::draw::Image"; + break; + case Prim::index_of(): + o << "cv::gapi::draw::Poly"; + break; + default: o << "Unrecognized primitive"; + } + + return o; + } } namespace opencv_test -- 2.7.4