| 48 | } |
| 49 | |
| 50 | static std::string create_mask_png(const std::vector<int>& gray_values) { |
| 51 | const std::string path = temp_png_path("mask"); |
| 52 | QImage mask(static_cast<int>(gray_values.size()), 1, QImage::Format_RGBA8888_Premultiplied); |
| 53 | for (size_t i = 0; i < gray_values.size(); ++i) { |
| 54 | const int gray = gray_values[i]; |
| 55 | mask.setPixelColor(static_cast<int>(i), 0, QColor(gray, gray, gray, 255)); |
| 56 | } |
| 57 | REQUIRE(mask.save(QString::fromStdString(path))); |
| 58 | return path; |
| 59 | } |
| 60 | |
| 61 | static std::string create_uniform_mask_png(int width, int height, int gray_value) { |
| 62 | const std::string path = temp_png_path("mask_uniform"); |
no test coverage detected