MCPcopy Create free account
hub / github.com/RenderKit/oidn / loadImage

Function loadImage

apps/utils/image_io.cpp:372–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370 } // namespace
371
372 std::shared_ptr<ImageBuffer> loadImage(const DeviceRef& device,
373 const std::string& filename,
374 DataType dataType,
375 Storage storage)
376 {
377 const std::string ext = getExtension(filename);
378 std::shared_ptr<ImageBuffer> image;
379
380 if (ext == "pfm")
381 image = loadImagePFM(device, filename, dataType, storage);
382 else if (ext == "phm")
383 image = loadImagePHM(device, filename, dataType, storage);
384 else
385#if OIDN_USE_OPENIMAGEIO
386 image = loadImageOIIO(device, filename, dataType, storage);
387#else
388 throw std::runtime_error("cannot load unsupported image file format: '" + filename + "'");
389#endif
390
391 return image;
392 }
393
394 void saveImage(const std::string& filename, const ImageBuffer& image)
395 {

Callers 1

mainFunction · 0.85

Calls 6

getExtensionFunction · 0.85
loadImagePFMFunction · 0.85
loadImagePHMFunction · 0.85
loadImageOIIOFunction · 0.85
isSrgbImageFunction · 0.85
srgbInverseFunction · 0.85

Tested by

no test coverage detected