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

Method screencap

source/MaaAdbControlUnit/EmulatorExtras/AndrowsExtras.cpp:83–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83std::optional<cv::Mat> AndrowsExtras::screencap()
84{
85 if (display_id_.empty() && !query_display_id()) {
86 LogError << "Androws: display ID not available";
87 return std::nullopt;
88 }
89
90 auto argv_opt = screencap_encode_argv_.gen(argv_replace_);
91 if (!argv_opt) {
92 LogError << "Androws: failed to generate screencap encode argv";
93 return std::nullopt;
94 }
95
96 auto output_opt = startup_and_read_pipe(*argv_opt);
97 if (!output_opt) {
98 LogWarn << "Androws: screencap encode failed";
99 return std::nullopt;
100 }
101
102 return screencap_helper_.process_data(*output_opt, ScreencapHelper::decode_png);
103}
104
105bool AndrowsExtras::request_display_info()
106{

Callers

nothing calls this directly

Calls 3

genMethod · 0.80
process_dataMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected