| 268 | } |
| 269 | |
| 270 | inline void readPGMFile(const std::string& fileName, uint8_t* buffer, int inH, int inW) |
| 271 | { |
| 272 | std::ifstream infile(fileName, std::ifstream::binary); |
| 273 | assert(infile.is_open() && "Attempting to read from a file that is not open."); |
| 274 | std::string magic, w, h, max; |
| 275 | infile >> magic >> w >> h >> max; |
| 276 | infile.seekg(1, infile.cur); |
| 277 | infile.read(reinterpret_cast<char*>(buffer), inH * inW); |
| 278 | } |
| 279 | |
| 280 | namespace samplesCommon |
| 281 | { |
no test coverage detected