| | |
| | | #include <string.h> // for memcpy
|
| | | #include <opencv2/core/mat.hpp>
|
| | | #include <opencv2/imgproc.hpp>
|
| | |
|
| | | #ifdef ENABLE_WTEXT
|
| | | #include "CvUtil/CvxText.h"
|
| | | #endif
|
| | |
| | | delete (CvxText*)cvxText;
|
| | | cvxText = nullptr;
|
| | | #endif
|
| | | }
|
| | |
|
| | | void PLPLContext::clear()
|
| | | {
|
| | | cmds.clear();
|
| | | params.clear();
|
| | | }
|
| | |
|
| | | struct PL_Paint_Internal
|
| | |
| | |
|
| | | bool plplDraw_Rect_RGB565(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
|
| | | {
|
| | | int LTX = plplCtx->params[paramOffset + 0].val_i;
|
| | | int LTX = plplCtx->params[paramOffset + 0].val_i;
|
| | | int LTY = plplCtx->params[paramOffset + 1].val_i;
|
| | | int RBX = plplCtx->params[paramOffset + 2].val_i;
|
| | | int RBY = plplCtx->params[paramOffset + 3].val_i;
|
| | |
| | |
|
| | | bool plplDraw_Text_RGB565(PLPLContext* plplCtx, MB_Frame* paintMb, int& paramOffset)
|
| | | {
|
| | | int LTX = plplCtx->params[paramOffset + 0].val_i;
|
| | | int LTX = plplCtx->params[paramOffset + 0].val_i;
|
| | | int LTY = plplCtx->params[paramOffset + 1].val_i;
|
| | | const char* TXT = plplCtx->params[paramOffset + 2].val_s;
|
| | | paramOffset += 3;
|
| | |
| | | #endif
|
| | | }
|
| | |
|
| | | bool plplExecutor_YUV(PL_Paint_Internal *in)
|
| | | bool plpl_executor(PL_Paint_Internal *in)
|
| | | {
|
| | | MB_Frame* paintMb = &(in->lastMbfBuffOrigin);
|
| | | int ret = true;
|
| | |
| | | in->lastMbfBuffOrigin.height = frame->height;
|
| | | in->lastMbfBuffOrigin.pts = frame->pts;
|
| | |
|
| | | in->payError = !plplExecutor_YUV(in);
|
| | | in->payError = !plpl_executor(in);
|
| | |
|
| | | return false;
|
| | | }
|
| | |
| | | {
|
| | | PL_Paint_Internal* in = (PL_Paint_Internal*)internal;
|
| | | in->payError = true;
|
| | |
|
| | | if (pm.type != PipeMaterial::PMT_FRAME)
|
| | | {
|
| | | LOG_ERROR << "Only support PMT_FRAME" << LOG_ENDL;
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (pm.buffer == nullptr)
|
| | | return false;
|
| | |
|
| | | MB_Frame* frame = (MB_Frame*)pm.buffer;
|
| | | switch(frame->type)
|
| | | {
|
| | | case MB_Frame::MBFT_YUV420:
|
| | | case MB_Frame::MBFT_NV12:
|
| | | case MB_Frame::MBFT_RGB565:
|
| | | pm.breake(PipeMaterial::PMT_FRAME, MB_Frame::MBFT_RGB565, PL_Paint::pay_breaker_MBFT, in);
|
| | | return !(in->payError);
|
| | | default:
|
| | | LOG_ERROR << "Only support MBFT_YUV420 / MBFT_NV12 / MBFT_RGB565" << LOG_ENDL;
|
| | | in->payError = true;
|
| | | break;
|
| | | }
|
| | | if (in->payError)
|
| | | pm.breake(PipeMaterial::PMT_FRAME, MB_Frame::MBFT_YUV420, PL_Paint::pay_breaker_MBFT, in);
|
| | | if (in->payError)
|
| | | pm.breake(PipeMaterial::PMT_FRAME, MB_Frame::MBFT_NV12, PL_Paint::pay_breaker_MBFT, in);
|
| | | if (in->payError)
|
| | | pm.breake(PipeMaterial::PMT_FRAME, MB_Frame::MBFT_RGB565, PL_Paint::pay_breaker_MBFT, in);
|
| | |
|
| | | return !(in->payError);
|
| | | }
|