MCPcopy Create free account
hub / github.com/WallBreaker2/op / WriteBytesToFile

Function WriteBytesToFile

tests/opencv_test.cpp:25–32  ·  view source on GitHub ↗

把测试字节写到本地文件,供图像加载接口读取。

Source from the content-addressed store, hash-verified

23
24// 把测试字节写到本地文件,供图像加载接口读取。
25bool WriteBytesToFile(const std::wstring &path, const std::vector<uchar> &bytes) {
26 std::ofstream output(path, std::ios::binary);
27 if (!output.is_open()) {
28 return false;
29 }
30 output.write(reinterpret_cast<const char *>(bytes.data()), static_cast<std::streamsize>(bytes.size()));
31 return output.good();
32}
33
34// 使用 OpenCV 写出带 alpha 的 PNG,供自动 alpha mask 测试使用。
35bool WritePngFile(const std::wstring &path, const cv::Mat &image) {

Callers 4

BuildTemplateTestDataFunction · 0.85
BuildFeaturePatternDataFunction · 0.85
TESTFunction · 0.85

Calls 4

is_openMethod · 0.80
writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected