1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Added planar flag to GMatDesc, intergated into framework, added tests

This commit is contained in:
Ruslan Garnov
2019-04-22 17:36:10 +03:00
parent 1f517b8a02
commit f81886d17c
14 changed files with 519 additions and 27 deletions
+19
View File
@@ -349,5 +349,24 @@ void writeBack(const Mag& mag, const RcDesc &rc, GRunArgP &g_arg, bool is_umat)
}
} // namespace magazine
void createMat(const cv::GMatDesc desc, cv::gapi::own::Mat& mat)
{
const auto type = desc.planar ? desc.depth : CV_MAKETYPE(desc.depth, desc.chan);
const auto size = desc.planar ? cv::gapi::own::Size{desc.size.width, desc.size.height*desc.chan}
: desc.size;
mat.create(size, type);
}
#if !defined(GAPI_STANDALONE)
void createMat(const cv::GMatDesc desc, cv::Mat& mat)
{
const auto type = desc.planar ? desc.depth : CV_MAKETYPE(desc.depth, desc.chan);
const auto size = desc.planar ? cv::Size{desc.size.width, desc.size.height*desc.chan}
: cv::gapi::own::to_ocv(desc.size);
mat.create(size, type);
}
#endif
} // namespace gimpl
} // namespace cv