| 74 | } |
| 75 | |
| 76 | void SaveAsPBM(const BitMatrix& matrix, const std::string filename, int quietZone) |
| 77 | { |
| 78 | auto out = ToMatrix<uint8_t>(Inflate(matrix.copy(), 0, 0, quietZone)); |
| 79 | std::ofstream file(filename); |
| 80 | file << "P5\n" << out.width() << ' ' << out.height() << "\n255\n"; |
| 81 | file.write(reinterpret_cast<const char*>(out.data()), out.size()); |
| 82 | } |
| 83 | |
| 84 | } // ZXing |