From 21738f7b59dce5962e61701c2db21d0c5d9b9058 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 14 Jan 2014 00:11:12 +0100 Subject: [PATCH] Batch tonemapper: allow specifying the desired resampling filter --- src/utils/tonemap.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils/tonemap.cpp b/src/utils/tonemap.cpp index 3e54a0ee..ce8d5a78 100644 --- a/src/utils/tonemap.cpp +++ b/src/utils/tonemap.cpp @@ -46,6 +46,7 @@ public: cout << " -b r,g,b Color balance: apply the specified per-channel multipliers" << endl << endl; cout << " -c x,y,w,h Crop: tonemap a given rectangle instead of the entire image" << endl << endl; cout << " -s w,h Resize the output image to the specified resolution" << endl << endl; + cout << " -F name Name of the resampling filter used by -s (Default = lanczos)" << endl << endl; cout << " -r x,y,w,h,i Add a rectangle at the specified position and intensity, e.g." << endl; cout << " to make paper figures. The intensity should be in [0, 255]." << endl << endl; cout << " -f fmt Request a certain output format (png/jpg, default:png)" << endl << endl; @@ -128,9 +129,10 @@ public: bool runParallel = false; ReconstructionFilter *rfilter = NULL; Float bloomFov = 0; + std::string rfilterName = "lanczos"; /* Parse command-line arguments */ - while ((optchar = getopt(argc, argv, "htxag:m:f:r:b:c:o:p:s:B:")) != -1) { + while ((optchar = getopt(argc, argv, "htxag:m:f:r:b:c:o:p:s:B:F:")) != -1) { switch (optchar) { case 'h': { help(); @@ -159,6 +161,10 @@ public: } break; + case 'F': + rfilterName = std::string(optarg); + break; + case 'B': bloomFov = (Float) strtod(optarg, &end_ptr); #if !defined(MTS_HAS_FFTW) @@ -277,7 +283,7 @@ public: if (resize[0] != -1) { /* A resampling operation was requested; use a Lanczos Sinc reconstruction filter by default */ rfilter = static_cast (PluginManager::getInstance()-> - createObject(MTS_CLASS(ReconstructionFilter), Properties("lanczos"))); + createObject(MTS_CLASS(ReconstructionFilter), Properties(rfilterName))); rfilter->configure(); }