mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
rft: 统一存截图 (#14825)
* rft: 统一存截图 * rft: 漏网之鱼 * chore: Auto update by pre-commit hooks [skip changelog] * fix: 静态锁 * chore: map 改为全局 * fix: 避免溢出 * chore: 怎么整得这么麻烦 * perf: 避免额外std::format * fix: ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: status102 <102887808+status102@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "InstHelper.h"
|
||||
#include "MaaUtils/ImageIo.h"
|
||||
#include "MaaUtils/Time.hpp"
|
||||
#include "Utils/DebugImageHelper.hpp"
|
||||
#include "Utils/Logger.hpp"
|
||||
#include "Utils/StringMisc.hpp"
|
||||
|
||||
@@ -131,13 +132,10 @@ cv::Mat asst::VisionHelper::create_mask(const cv::Mat& image, const cv::Rect& ro
|
||||
|
||||
bool VisionHelper::save_img(const std::filesystem::path& relative_dir)
|
||||
{
|
||||
std::string stem = MAA_NS::format_now_for_filename();
|
||||
auto relative_path = relative_dir / (stem + "_raw.png");
|
||||
Log.trace("Save image", relative_path);
|
||||
bool ret = MAA_NS::imwrite(relative_path, m_image);
|
||||
bool ret = utils::save_debug_image(m_image, relative_dir, true);
|
||||
|
||||
#ifdef ASST_DEBUG
|
||||
MAA_NS::imwrite(relative_dir / (stem + "_draw.png"), m_image_draw);
|
||||
utils::save_debug_image(m_image_draw, relative_dir, true, "", "draw");
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user