| 47 | } |
| 48 | |
| 49 | ImageLoader::ImageLoader(ref<Device> pDevice, const Properties& props) : RenderPass(pDevice) |
| 50 | { |
| 51 | for (const auto& [key, value] : props) |
| 52 | { |
| 53 | if (key == kOutputSize) |
| 54 | mOutputSizeSelection = value; |
| 55 | else if (key == kOutputFormat) |
| 56 | mOutputFormat = value; |
| 57 | else if (key == kImage) |
| 58 | mImagePath = value.operator std::filesystem::path(); |
| 59 | else if (key == kSrgb) |
| 60 | mLoadSRGB = value; |
| 61 | else if (key == kMips) |
| 62 | mGenerateMips = value; |
| 63 | else if (key == kArraySlice) |
| 64 | mArraySlice = value; |
| 65 | else if (key == kMipLevel) |
| 66 | mMipLevel = value; |
| 67 | else |
| 68 | logWarning("Unknown property '{}' in a ImageLoader properties.", key); |
| 69 | } |
| 70 | |
| 71 | if (!mImagePath.empty()) |
| 72 | { |
| 73 | if (!loadImage(mImagePath)) |
| 74 | { |
| 75 | FALCOR_THROW("ImageLoader: Failed to load image from '{}'", mImagePath); |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | RenderPassReflection ImageLoader::reflect(const CompileData& compileData) |
| 81 | { |
nothing calls this directly
no test coverage detected