code review
git-svn-id: http://192.168.1.226/svn/proxy@731 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | in->config = *config;
|
| | | }
|
| | |
|
| | | if(in->config.plplCtx->cvxText != nullptr)
|
| | | {
|
| | | delete (CvxText*)in->config.plplCtx->cvxText;
|
| | | }
|
| | | |
| | | if(in->config.fontPath.empty())
|
| | | {
|
| | | LOG_ERROR << "fontPath is null!" << LOG_ENDL;
|
| | | return false;
|
| | | }
|
| | |
|
| | | if(in->config.plplCtx->cvxText != nullptr)
|
| | | else if (in->config.fontPath == " ")
|
| | | {
|
| | | delete (CvxText*)in->config.plplCtx->cvxText;
|
| | | CvxText* cvxText = new CvxText(in->config.fontPath.c_str());
|
| | | in->config.plplCtx->cvxText = cvxText;
|
| | | cvxText->setBackColor(cvScalar(128, 33, 14));
|
| | | CvScalar font = cvScalar(40, 1, 0.2, 1);
|
| | | cvxText->setFont(0, &font);
|
| | | }
|
| | |
|
| | | return true;
|
| | |
| | | cv::rectangle(yMat, cv::Point(LTX, LTY), cv::Point(RBX, RBY), CV_RGB(yuvColor.Y, yuvColor.Y, yuvColor.Y), 4);
|
| | | cv::rectangle(uMat, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), cv::Point(MH_SUBSAMPLE1(RBX, 2), MH_SUBSAMPLE1(RBY, 2)), CV_RGB(yuvColor.U, yuvColor.U, yuvColor.U), 2);
|
| | | cv::rectangle(vMat, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), cv::Point(MH_SUBSAMPLE1(RBX, 2), MH_SUBSAMPLE1(RBY, 2)), CV_RGB(yuvColor.V, yuvColor.V, yuvColor.V), 2);
|
| | | |
| | | return true;
|
| | | }
|
| | |
|
| | | bool plplDraw_Rect_NV12(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
|
| | |
| | |
|
| | | cv::rectangle(yMat, cv::Point(LTX, LTY), cv::Point(RBX, RBY), CV_RGB(Y, Y, Y), 4);
|
| | | cv::rectangle(uvMat, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), cv::Point(MH_SUBSAMPLE1(RBX, 2), MH_SUBSAMPLE1(RBY, 2)), CV_RGB(UV, UV, UV), 2);
|
| | | |
| | | return true;
|
| | | }
|
| | |
|
| | | bool plplDraw_Text_YUV420(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | bool plplDraw_Text_NV12(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
|
| | |
| | |
|
| | | cv::putText(yMat, TXT, cv::Point(LTX, LTY), CV_FONT_HERSHEY_COMPLEX, 1, CV_RGB(Y, Y, Y));
|
| | | cv::putText(uvMat, TXT, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), CV_FONT_HERSHEY_COMPLEX, 0.5, CV_RGB(UV, UV, UV));
|
| | | |
| | | return true;
|
| | | }
|
| | |
|
| | | bool plplDraw_WText_NV12(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
|
| | |
| | |
|
| | | // void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
| | |
|
| | | if (in->config.plplCtx->cvxText == nullptr)
|
| | | {
|
| | | CvxText* cvxText = new CvxText(in->config.fontPath.c_str());
|
| | | in->config.plplCtx->cvxText = cvxText;
|
| | | cvxText->setBackColor(cvScalar(128, 33, 14));
|
| | | CvScalar font = cvScalar(40, 1, 0.2, 1);
|
| | | cvxText->setFont(0, &font);
|
| | | }
|
| | | |
| | | const uint16_t Y = plplCtx->color_front.toY();
|
| | | const uint16_t UV = plplCtx->color_front.toUV();
|
| | |
|
| | | CvxText* cvText = (CvxText*)plplCtx->cvxText;
|
| | | cvText->putText(yMat, (const wchar_t*)WTXT, cv::Point(LTX, LTY), CV_RGB(Y, Y, Y)); // L"中文ABCDabcd"
|
| | | cvText->putText(uvMat, (const wchar_t*)WTXT, cv::Point(MH_SUBSAMPLE1(LTX, 2), MH_SUBSAMPLE1(LTY, 2)), CV_RGB(UV, UV, UV)); // L"中文ABCDabcd"
|
| | | |
| | | return true;
|
| | | }
|
| | |
|
| | | bool plplExecutor_YUV(PL_Paint_Internal *in)
|