MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / get_rect_from_node

Method get_rect_from_node

source/MaaFramework/Task/Component/ActionHelper.cpp:238–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238cv::Rect ActionHelper::get_rect_from_node(const std::string& node_name) const
239{
240 auto* t = tasker();
241 if (!t) {
242 return { };
243 }
244
245 auto& cache = t->runtime_cache();
246 auto node_id = cache.get_latest_node(node_name);
247 if (!node_id) {
248 LogWarn << "node not found or not executed" << VAR(node_name);
249 return { };
250 }
251 NodeDetail node_detail = cache.get_node_detail(*node_id).value_or(NodeDetail { });
252 RecoResult reco_result = cache.get_reco_result(node_detail.reco_id).value_or(RecoResult { });
253 return reco_result.box.value_or(cv::Rect { });
254}
255
256Tasker* ActionHelper::tasker() const
257{

Callers

nothing calls this directly

Calls 3

get_latest_nodeMethod · 0.45
get_node_detailMethod · 0.45
get_reco_resultMethod · 0.45

Tested by

no test coverage detected