MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / load_pgm

Function load_pgm

tests/AssetsLibrary.cpp:234–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234RawTensor 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
257AssetsLibrary::AssetsLibrary(std::string path, std::random_device::result_type seed) //NOLINT

Callers

nothing calls this directly

Calls 6

FileNotFoundClass · 0.85
parse_pgm_headerFunction · 0.85
check_image_sizeFunction · 0.85
read_image_bufferFunction · 0.85
TensorShapeClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected