| 148 | } |
| 149 | |
| 150 | std::optional<cv::Mat> ScreencapHelper::decode(const std::string& buffer) |
| 151 | { |
| 152 | cv::Mat img = cv::imdecode({ buffer.data(), static_cast<int>(buffer.size()) }, cv::IMREAD_COLOR); |
| 153 | return img.empty() ? std::nullopt : std::make_optional(img); |
| 154 | } |
| 155 | |
| 156 | bool ScreencapHelper::clean_cr(std::string& buffer) |
| 157 | { |
no test coverage detected