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

Function readPPMFile

samples/common/common.h:677–685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

675
676template <int C, int H, int W>
677void readPPMFile(const std::string& filename, samplesCommon::PPM<C, H, W>& ppm)
678{
679 ppm.fileName = filename;
680 std::ifstream infile(filename, std::ifstream::binary);
681 assert(infile.is_open() && "Attempting to read from a file that is not open.");
682 infile >> ppm.magic >> ppm.w >> ppm.h >> ppm.max;
683 infile.seekg(1, infile.cur);
684 infile.read(reinterpret_cast<char*>(ppm.buffer), ppm.w * ppm.h * 3);
685}
686
687inline void readPPMFile(const std::string& filename, vPPM& ppm, std::vector<std::string>& input_dir)
688{

Callers 1

updateMethod · 0.85

Calls 2

locateFileFunction · 0.85
readMethod · 0.80

Tested by

no test coverage detected