19 #include <nori/bitmap.h>
20 #include <filesystem/path.h>
22 int main(
int argc,
char **argv) {
29 std::string filename = argv[1];
30 filesystem::path path(filename);
32 if (path.extension() ==
"exr") {
35 size_t lastdot = filename.find_last_of(
".");
36 std::string pngFilename = filename.substr(0, lastdot) +
".png";
37 bitmap.saveToLDR(pngFilename);
39 cerr <<
"Error: unknown file \"" << filename
40 <<
"\", expected an extension of type .exr" << endl;
45 }
catch (
const std::exception &e) {
46 cerr <<
"Fatal error: " << e.what() << endl;
Stores a RGB high dynamic-range bitmap.