MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / body

Method body

plugins/wasmedge_opencvmini/opencvmini_func.cpp:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace Host {
17
18Expect<uint32_t>
19WasmEdgeOpenCVMiniImdecode::body(const Runtime::CallingFrame &Frame,
20 uint32_t BufPtr, uint32_t BufLen) {
21 // Check memory instance from module.
22 auto *MemInst = Frame.getMemoryByIndex(0);
23 if (MemInst == nullptr) {
24 return Unexpect(ErrCode::Value::HostFuncError);
25 }
26
27 char *Buf = MemInst->getPointer<char *>(BufPtr);
28
29 std::vector<char> Content(Buf, Buf + BufLen);
30 cv::Mat Img = cv::imdecode(cv::InputArray(Content), cv::IMREAD_COLOR);
31
32 return Env.insertMat(Img);
33}
34
35Expect<void> WasmEdgeOpenCVMiniImshow::body(const Runtime::CallingFrame &Frame,
36 uint32_t WindowNamePtr,

Callers

nothing calls this directly

Calls 9

UnexpectFunction · 0.85
unlikelyFunction · 0.85
getMemoryByIndexMethod · 0.80
insertMatMethod · 0.80
getMatMethod · 0.80
c_strMethod · 0.80
errorFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected