From: <st...@us...> - 2009-02-25 08:23:01
|
Revision: 3668 http://hugin.svn.sourceforge.net/hugin/?rev=3668&view=rev Author: stativ Date: 2009-02-25 08:22:56 +0000 (Wed, 25 Feb 2009) Log Message: ----------- Beautified PanoramaMakefileExport.cpp Modified Paths: -------------- hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp Modified: hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp =================================================================== --- hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp 2009-02-24 23:16:52 UTC (rev 3667) +++ hugin/trunk/src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp 2009-02-25 08:22:56 UTC (rev 3668) @@ -78,10 +78,10 @@ result.push_back(stack); stack.clear(); } while (allImgs.size() > 0); - + return result; } - + // should be moved somewhere else (will be after GSOC anyway) vector<UIntSet> getExposureLayers(const PanoramaData & pano, UIntSet allImgs) { @@ -126,13 +126,13 @@ { UIntSet images; PanoramaOptions opts = pano.getOptions(); - for (UIntSet::const_iterator it = activeImages.begin(); it != activeImages.end(); ++it) - { - Rect2D roi = estimateOutputROI(pano, opts, *it); - if (! (roi.isEmpty())) { - images.insert(*it); - } - } + for (UIntSet::const_iterator it = activeImages.begin(); it != activeImages.end(); ++it) + { + Rect2D roi = estimateOutputROI(pano, opts, *it); + if (! (roi.isEmpty())) { + images.insert(*it); + } + } return images; } @@ -156,8 +156,8 @@ setlocale(LC_NUMERIC,"C"); #endif - // output only images in current ROI - UIntSet images = getImagesinROI(pano,rimages); + // output only images in current ROI + UIntSet images = getImagesinROI(pano,rimages); // execute exiftool with perl if necessary #ifdef COULD_EXECUTE_EXIFTOOL_WITH_PERL @@ -172,13 +172,13 @@ } #endif #endif - + o << "# makefile for panorama stitching, created by hugin " << endl << endl; // pass settings for different temporary directory if (tmpDir != "") { - o << "# set temporary directory" << endl; + o << "# set temporary directory" << endl; #ifdef __unix__ o << "export TMPDIR=" << quoteStringShell(tmpDir) << endl; #else // WINDOWS @@ -207,15 +207,6 @@ << "EXIFTOOL=" << quoteStringShell(progs.exiftool) << endl #endif << endl -// This is completely unnecessary because it should be handled by default values in struct progs -// << "ifndef ENBLEND" << endl -// << " ENBLEND=false" << endl -// << "endif" << endl -// << endl -// << "ifndef ENFUSE" << endl -// << " ENFUSE=false" << endl -// << "endif" << endl -// << endl << "# Project parameters" << endl << "HUGIN_PROJECTION=" << opts.getProjection() << endl @@ -226,44 +217,87 @@ << "# options for the programs" << endl << endl; - o << "NONA_LDR_REMAPPED_COMP="; - if (opts.outputImageType == "tif" && opts.outputLayersCompression.size() != 0) { - o << "-z " << opts.outputLayersCompression; - } else if (opts.outputImageType == "jpg") { - o << "-z PACKBITS "; + // set remapper specific settings + switch(opts.remapper) { + case PanoramaOptions::NONA: + { + o << "NONA_LDR_REMAPPED_COMP="; + if (opts.outputImageType == "tif" && opts.outputLayersCompression.size() != 0) { + o << "-z " << opts.outputLayersCompression; + } else if (opts.outputImageType == "jpg") { + o << "-z PACKBITS "; + } + o << endl; + } + break; + case PanoramaOptions::PTMENDER: + break; } - o << endl; - o << "ENBLEND_OPTS=" << opts.enblendOptions; - if (opts.getHFOV() == 360.0) { - // blend over the border - o << " -w"; - } + // set blender specific settings + switch(opts.blendMode) { + case PanoramaOptions::ENBLEND_BLEND: + { + o << "ENBLEND_OPTS=" << opts.enblendOptions; + if (opts.getHFOV() == 360.0) { + // blend over the border + o << " -w"; + } + vigra::Rect2D roi = opts.getROI(); + if (roi.top() != 0 || roi.left() != 0 ) { + o << " -f" << roi.width() << "x" << roi.height() << "+" << roi.left() << "+" << roi.top(); + } else { + o << " -f" << roi.width() << "x" << roi.height(); + } + o << endl; - vigra::Rect2D roi = opts.getROI(); - if (roi.top() != 0 || roi.left() != 0 ) { - o << " -f" << roi.width() << "x" << roi.height() << "+" << roi.left() << "+" << roi.top(); - } else { - o << " -f" << roi.width() << "x" << roi.height(); + o << "ENBLEND_LDR_COMP="; + if (opts.outputImageType == "tif" && opts.outputImageTypeCompression.size() != 0) { + o << "--compression " << opts.outputImageTypeCompression; + } else if (opts.outputImageType == "jpg") { + o << "--compression " << opts.quality; + } + o << endl; + + o << "ENBLEND_HDR_COMP="; + if (opts.outputImageType == "tif" && opts.outputImageTypeHDRCompression.size() != 0) { + o << "--compression " << opts.outputImageTypeHDRCompression; + } + o << endl; + } + break; + case PanoramaOptions::PTBLENDER_BLEND: + { + o << "PTBLENDER_OPTS="; + switch (opts.colorCorrection) { + case PanoramaOptions::NONE: + break; + case PanoramaOptions::BRIGHTNESS_COLOR: + o << " -k " << opts.colorReferenceImage; + break; + case PanoramaOptions::BRIGHTNESS: + o << " -k " << opts.colorReferenceImage; + break; + case PanoramaOptions::COLOR: + o << " -k " << opts.colorReferenceImage; + break; + } + o << endl; + } + break; + case PanoramaOptions::SMARTBLEND_BLEND: + { + o << "SMARTBLEND_OPTS=" << progs.smartblend_opts; + if (opts.getHFOV() == 360.0) { + // blend over the border + o << " -w"; + } + o << endl; + // TODO: build smartblend command line from given images. (requires additional program) + } + break; } - o << endl; - - o << "ENBLEND_LDR_COMP="; - if (opts.outputImageType == "tif" && opts.outputImageTypeCompression.size() != 0) { - o << "--compression " << opts.outputImageTypeCompression; - } else if (opts.outputImageType == "jpg") { - o << "--compression " << opts.quality; - } - o << endl; - - o << "ENBLEND_HDR_COMP="; - if (opts.outputImageType == "tif" && opts.outputImageTypeHDRCompression.size() != 0) { - o << "--compression " << opts.outputImageTypeHDRCompression; - } - o << endl; - - o << "ENFUSE_OPTS=" << opts.enfuseOptions; // TODO: blend only over border if this is indeed a // image with 360 deg overlap @@ -547,7 +581,7 @@ } o << endl << endl; - + vector<string> ldrStackedImages; o << endl << "# stacked images for enfuse or other automatic exposure blending tools" << endl @@ -592,7 +626,7 @@ o << "$(LDR_STACK_" << i << "_SHELL) "; o << endl; - + // TODO: include custom makefile here if (includePath.size() > 0) { o << "include " << escapeStringMake(includePath) << endl << endl; @@ -726,12 +760,12 @@ { string destImg = escapeStringMake(similarExposureRemappedImages[j]); string srcImg = escapeStringMake(pano.getImage(*it).getFilename()); - /* + /* o << destImg << ": " << srcImg << " $(PROJECT_FILE)" << endl << "\t$(NONA) -r ldr -e $(LDR_EXPOSURE_LAYER_" << i << "_EXPOSURE) -m " << ldrRemappedMode << " -o $(LDR_EXPOSURE_REMAPPED_PREFIX) -i " << *it << " $(PROJECT_FILE)" << endl << endl; - */ + */ o << destImg << ": " << srcImg << " $(PROJECT_FILE)" << endl << "\t$(NONA) $(NONA_LDR_REMAPPED_COMP) -r ldr -e " << pano.getSrcImage(*it).getExposureValue() << " -m " << ldrRemappedMode << " -o $(LDR_EXPOSURE_REMAPPED_PREFIX_SHELL) -i " << *it @@ -817,30 +851,9 @@ break; case PanoramaOptions::PTBLENDER_BLEND: - o << "PTBLENDER_OPTS="; - switch (opts.colorCorrection) { - case PanoramaOptions::NONE: - break; - case PanoramaOptions::BRIGHTNESS_COLOR: - o << " -k " << opts.colorReferenceImage; - break; - case PanoramaOptions::BRIGHTNESS: - o << " -k " << opts.colorReferenceImage; - break; - case PanoramaOptions::COLOR: - o << " -k " << opts.colorReferenceImage; - break; - } - o << endl; // TODO: output PTBlender + PTmasker + PTroller rules break; case PanoramaOptions::SMARTBLEND_BLEND: - o << "SMARTBLEND_OPTS=" << progs.smartblend_opts; - if (opts.getHFOV() == 360.0) { - // blend over the border - o << " -w"; - } - o << endl; // TODO: build smartblend command line from given images. (requires additional program) break; default: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |