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

Function load_ppm

tests/AssetsLibrary.cpp:212–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212RawTensor 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
234RawTensor load_pgm(const std::string &path)
235{

Callers

nothing calls this directly

Calls 6

FileNotFoundClass · 0.85
check_image_sizeFunction · 0.85
read_image_bufferFunction · 0.85
parse_ppm_headerFunction · 0.70
TensorShapeClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected