! stores an image to file with auto-detection of format */
| 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>; |