helper function to write the rendered image
| 57 | |
| 58 | // helper function to write the rendered image |
| 59 | OsprayStatus OSPImageTools::writeImg(std::string fileName, const void *pixel) |
| 60 | { |
| 61 | OsprayStatus writeErr = OsprayStatus::Error; |
| 62 | fileName += GetFileFormat(); |
| 63 | if (GetFileFormat() == ".ppm") { |
| 64 | rkcommon::utility::writePPM( |
| 65 | fileName, size.x, size.y, (const uint32_t *)pixel); |
| 66 | writeErr = OsprayStatus::Ok; |
| 67 | } else if (GetFileFormat() == ".png") { |
| 68 | writeErr = writePNG(fileName, (const uint32_t *)pixel); |
| 69 | } else if (GetFileFormat() == ".hdr") { |
| 70 | writeErr = writeHDR(fileName, (const float *)pixel); |
| 71 | } else if (GetFileFormat() == ".pfm") { |
| 72 | try { |
| 73 | rkcommon::utility::writePFM(fileName, size.x, size.y, (const vec4f *)pixel); |
| 74 | writeErr = OsprayStatus::Ok; |
| 75 | } catch (...) { |
| 76 | writeErr = OsprayStatus::Fail; |
| 77 | } |
| 78 | } else { |
| 79 | std::cerr << "Unsupported file format" << std::endl; |
| 80 | writeErr = OsprayStatus::Error; |
| 81 | } |
| 82 | |
| 83 | return writeErr; |
| 84 | } |
| 85 | |
| 86 | OsprayStatus OSPImageTools::verifyBaselineImage(const int sizeX, |
| 87 | const int sizeY, |
nothing calls this directly
no test coverage detected