Define operator<< for cv::gapi::wip::draw::Prim

This commit is contained in:
Talamanov, Anatoliy 2019-10-09 13:41:36 +03:00
parent 3133bb49aa
commit 40215f99d7

View File

@ -16,6 +16,7 @@
#include <opencv2/gapi/util/util.hpp>
#include "gapi_tests_helpers.hpp"
#include <opencv2/gapi/render.hpp>
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<Rect>():
o << "cv::gapi::draw::Rect";
break;
case Prim::index_of<Text>():
o << "cv::gapi::draw::Text";
break;
case Prim::index_of<Circle>():
o << "cv::gapi::draw::Circle";
break;
case Prim::index_of<Line>():
o << "cv::gapi::draw::Line";
break;
case Prim::index_of<Mosaic>():
o << "cv::gapi::draw::Mosaic";
break;
case Prim::index_of<Image>():
o << "cv::gapi::draw::Image";
break;
case Prim::index_of<Poly>():
o << "cv::gapi::draw::Poly";
break;
default: o << "Unrecognized primitive";
}
return o;
}
}
namespace opencv_test