MCPcopy Create free account
hub / github.com/RenderKit/embree / storeImage

Function storeImage

tutorials/common/image/image.cpp:70–84  ·  view source on GitHub ↗

! stores an image to file with auto-detection of format */

Source from the content-addressed store, hash-verified

68
69 /*! stores an image to file with auto-detection of format */
70 void storeImage(const Ref<Image>& img, const FileName& fileName)
71 {
72 std::string ext = toLowerCase(fileName.ext());
73
74 if (ext == "bmp" ) { storeSTB(img, fileName); return; }
75 if (ext == "png" ) { storeSTB(img, fileName); return; }
76 if (ext == "jpg" ) { storeSTB(img, fileName); return; }
77
78 if (ext == "exr" ) { storeEXR(img, fileName); return; }
79
80 if (ext == "pfm" ) { storePFM(img, fileName); return; }
81 if (ext == "ppm" ) { storePPM(img, fileName); return; }
82 if (ext == "tga" ) { storeTga(img, fileName); return; }
83 THROW_RUNTIME_ERROR("image format " + ext + " not supported");
84 }
85
86 /*! template instantiations */
87 template class ImageT<Col3uc>;

Callers 2

renderToFileMethod · 0.85
keyboardFuncMethod · 0.85

Calls 7

toLowerCaseFunction · 0.85
storeSTBFunction · 0.85
storeEXRFunction · 0.85
storePFMFunction · 0.85
storePPMFunction · 0.85
storeTgaFunction · 0.85
extMethod · 0.80

Tested by

no test coverage detected