mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
Define operator<< for cv::gapi::wip::draw::Prim
This commit is contained in:
parent
3133bb49aa
commit
40215f99d7
@ -16,6 +16,7 @@
|
|||||||
#include <opencv2/gapi/util/util.hpp>
|
#include <opencv2/gapi/util/util.hpp>
|
||||||
|
|
||||||
#include "gapi_tests_helpers.hpp"
|
#include "gapi_tests_helpers.hpp"
|
||||||
|
#include <opencv2/gapi/render.hpp>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@ -23,6 +24,38 @@ namespace
|
|||||||
{
|
{
|
||||||
return o << (arg.tag.empty() ? "empty" : arg.tag);
|
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
|
namespace opencv_test
|
||||||
|
Loading…
Reference in New Issue
Block a user