| 200 | } |
| 201 | |
| 202 | void read_image_buffer(std::ifstream &fs, RawTensor &raw) |
| 203 | { |
| 204 | fs.read(reinterpret_cast<std::fstream::char_type *>(raw.data()), raw.size()); |
| 205 | |
| 206 | if (!fs.good()) |
| 207 | { |
| 208 | throw std::runtime_error("Failure while reading image buffer"); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | RawTensor load_ppm(const std::string &path) |
| 213 | { |