MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / readPGMFile

Function readPGMFile

samples/common/common.h:270–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270inline 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
280namespace samplesCommon
281{

Callers 4

processInputMethod · 0.85
processInputMethod · 0.85
processInputMethod · 0.85
readDigitsMethod · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected