| 210 | } |
| 211 | |
| 212 | RawTensor load_ppm(const std::string &path) |
| 213 | { |
| 214 | std::ifstream file(path, std::ios::in | std::ios::binary); |
| 215 | |
| 216 | if (!file.good()) |
| 217 | { |
| 218 | throw framework::FileNotFound("Could not load PPM image: " + path); |
| 219 | } |
| 220 | |
| 221 | unsigned int width = 0; |
| 222 | unsigned int height = 0; |
| 223 | |
| 224 | std::tie(width, height, std::ignore) = parse_ppm_header(file); |
| 225 | |
| 226 | RawTensor raw(TensorShape(width, height), Format::RGB888); |
| 227 | |
| 228 | check_image_size(file, raw.size()); |
| 229 | read_image_buffer(file, raw); |
| 230 | |
| 231 | return raw; |
| 232 | } |
| 233 | |
| 234 | RawTensor load_pgm(const std::string &path) |
| 235 | { |
nothing calls this directly
no test coverage detected