| 232 | } |
| 233 | |
| 234 | RawTensor load_pgm(const std::string &path) |
| 235 | { |
| 236 | std::ifstream file(path, std::ios::in | std::ios::binary); |
| 237 | |
| 238 | if (!file.good()) |
| 239 | { |
| 240 | throw framework::FileNotFound("Could not load PGM image: " + path); |
| 241 | } |
| 242 | |
| 243 | unsigned int width = 0; |
| 244 | unsigned int height = 0; |
| 245 | |
| 246 | std::tie(width, height, std::ignore) = parse_pgm_header(file); |
| 247 | |
| 248 | RawTensor raw(TensorShape(width, height), Format::U8); |
| 249 | |
| 250 | check_image_size(file, raw.size()); |
| 251 | read_image_buffer(file, raw); |
| 252 | |
| 253 | return raw; |
| 254 | } |
| 255 | } // namespace |
| 256 | |
| 257 | AssetsLibrary::AssetsLibrary(std::string path, std::random_device::result_type seed) //NOLINT |
nothing calls this directly
no test coverage detected