Hugintrunk
0.1
|
#include "PanoOptionsFromIni.h"
#include "IniParser.h"
#include <cmath>
#include <algorithms/nona/CenterHorizontally.h>
#include <algorithms/basic/StraightenPanorama.h>
#include <algorithms/nona/FitPanorama.h>
#include <algorithms/basic/CalculateOptimalScale.h>
#include <algorithms/basic/CalculateOptimalROI.h>
#include <algorithms/basic/LayerStacks.h>
#include <algorithms/basic/CalculateMeanExposure.h>
Go to the source code of this file.
Classes | |
struct | PanoProperties |
Functions | |
void | ReadProjectionNames () |
bool | CheckString (const std::string &variable, const std::string &operatorString, const std::string &value) |
check if given string matches the value with the corresponding operator More... | |
template<class Number > | |
bool | CheckNumber (const Number variable, const std::string &operatorString, const Number value) |
general number comparison function More... | |
bool | CheckInt (const int variable, const std::string &operatorString, const std::string &stringValue) |
check if given integer matches the condition (operator and value) More... | |
bool | CheckDouble (const double variable, const std::string &operatorString, const std::string &stringValue) |
check if given double matches the condition (operator and value) More... | |
bool | CheckCondition (const std::string &condition, const HuginBase::Panorama &pano, const PanoProperties &panoProps) |
check if given condition is fulfilled by given panorama and PanoProperties More... | |
void | SetProjection (const std::string &projectionString, HuginBase::PanoramaOptions &options) |
void | SetFOV (const std::string &fov, HuginBase::Panorama &pano, HuginBase::PanoramaOptions &options) |
void | SetCanvas (const std::string &canvas, HuginBase::Panorama &pano, HuginBase::PanoramaOptions &options) |
void | SetCrop (const std::string &cropString, HuginBase::Panorama &pano, HuginBase::PanoramaOptions &options) |
void | SetExposure (const std::string &exposure, HuginBase::Panorama &pano, HuginBase::PanoramaOptions &options) |
void | SetOutputType (const std::string &outputType, HuginBase::PanoramaOptions &options) |
void | SetLDRCompression (const std::string ldrCompression, HuginBase::PanoramaOptions &options) |
void | SetHDRCompression (const std::string hdrCompression, HuginBase::PanoramaOptions &options) |
void | ProcessSection (const IniParser &iniParser, const std::string §ion, HuginBase::Panorama &pano, HuginBase::PanoramaOptions &options, const PanoProperties &panoProps) |
process the given section, check if all conditions are fulfilled and if so apply all wished settings More... | |
HuginBase::PanoramaOptions | ReadPanoramaOptionsFromIni (const std::string &iniFile, HuginBase::Panorama &pano) |
read settings from given ini file and apply wished settings if they are applicable More... | |
Variables | |
static std::vector< std::string > | projectionNames |
static std::map < HuginBase::BaseSrcPanoImage::Projection, std::string > | lensTypeNames |
bool CheckCondition | ( | const std::string & | condition, |
const HuginBase::Panorama & | pano, | ||
const PanoProperties & | panoProps | ||
) |
check if given condition is fulfilled by given panorama and PanoProperties
Definition at line 157 of file PanoOptionsFromIni.cpp.
References CheckDouble(), CheckInt(), CheckString(), PanoProperties::filename, HuginBase::Panorama::getImage(), HuginBase::Panorama::getNrOfImages(), PanoProperties::HFOV, PanoProperties::path, ReadProjectionNames(), hugin_utils::tolower(), and PanoProperties::VFOV.
Referenced by ProcessSection().
bool CheckDouble | ( | const double | variable, |
const std::string & | operatorString, | ||
const std::string & | stringValue | ||
) |
check if given double matches the condition (operator and value)
Definition at line 145 of file PanoOptionsFromIni.cpp.
References hugin_utils::stringToDouble().
Referenced by CheckCondition().
bool CheckInt | ( | const int | variable, |
const std::string & | operatorString, | ||
const std::string & | stringValue | ||
) |
check if given integer matches the condition (operator and value)
Definition at line 133 of file PanoOptionsFromIni.cpp.
References hugin_utils::stringToInt().
Referenced by CheckCondition().
bool CheckNumber | ( | const Number | variable, |
const std::string & | operatorString, | ||
const Number | value | ||
) |
general number comparison function
Definition at line 102 of file PanoOptionsFromIni.cpp.
bool CheckString | ( | const std::string & | variable, |
const std::string & | operatorString, | ||
const std::string & | value | ||
) |
check if given string matches the value with the corresponding operator
Definition at line 76 of file PanoOptionsFromIni.cpp.
Referenced by CheckCondition().
void ProcessSection | ( | const IniParser & | iniParser, |
const std::string & | section, | ||
HuginBase::Panorama & | pano, | ||
HuginBase::PanoramaOptions & | options, | ||
const PanoProperties & | panoProps | ||
) |
process the given section, check if all conditions are fulfilled and if so apply all wished settings
Definition at line 619 of file PanoOptionsFromIni.cpp.
References HuginBase::PanoramaOptions::blendMode, CheckCondition(), HuginBase::PanoramaOptions::ENBLEND_BLEND, HuginBase::PanoramaOptions::enblendOptions, IniParser::GetKey(), IniParser::GetKeys(), IniParser::HasKey(), HuginBase::PanoramaOptions::INTERNAL_BLEND, HuginBase::PanoramaOptions::outputImageType, HuginBase::PanoramaOptions::outputImageTypeHDR, SetCanvas(), SetCrop(), SetExposure(), SetFOV(), SetHDRCompression(), SetLDRCompression(), SetOutputType(), SetProjection(), hugin_utils::StrTrim(), hugin_utils::tolower(), hugin_utils::toupper(), and HuginBase::PanoramaOptions::verdandiOptions.
Referenced by ReadPanoramaOptionsFromIni().
HuginBase::PanoramaOptions ReadPanoramaOptionsFromIni | ( | const std::string & | iniFile, |
HuginBase::Panorama & | pano | ||
) |
read settings from given ini file and apply wished settings if they are applicable
Definition at line 780 of file PanoOptionsFromIni.cpp.
References PanoProperties::filename, hugin_utils::GetAbsoluteFilename(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::Panorama::getImage(), HuginBase::Panorama::getNrOfImages(), HuginBase::Panorama::getOptions(), hugin_utils::getPathPrefix(), HuginBase::CalculateFitPanorama::getResultHeight(), HuginBase::CalculateFitPanorama::getResultHorizontalFOV(), IniParser::GetSections(), HuginBase::PanoramaOptions::getVFOV(), PanoProperties::HFOV, PanoProperties::path, ProcessSection(), IniParser::Read(), HuginBase::SrcPanoImage::readEXIF(), hugin_utils::roundi(), HuginBase::PanoramaAlgorithm::run(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::Panorama::setSrcImage(), hugin_utils::stripPath(), and PanoProperties::VFOV.
Referenced by main().
void ReadProjectionNames | ( | ) |
Definition at line 50 of file PanoOptionsFromIni.cpp.
References HuginBase::BaseSrcPanoImage::CIRCULAR_FISHEYE, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::BaseSrcPanoImage::FISHEYE_EQUISOLID, HuginBase::BaseSrcPanoImage::FISHEYE_ORTHOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_STEREOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_THOBY, HuginBase::BaseSrcPanoImage::FULL_FRAME_FISHEYE, HuginBase::BaseSrcPanoImage::PANORAMIC, HuginBase::BaseSrcPanoImage::RECTILINEAR, and hugin_utils::tolower().
Referenced by CheckCondition(), and SetProjection().
void SetCanvas | ( | const std::string & | canvas, |
HuginBase::Panorama & | pano, | ||
HuginBase::PanoramaOptions & | options | ||
) |
Definition at line 285 of file PanoOptionsFromIni.cpp.
References HuginBase::CalculateOptimalScale::calcOptimalScale(), HuginBase::Panorama::duplicate(), HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getWidth(), hugin_utils::roundi(), HuginBase::PanoramaOptions::setHeight(), HuginBase::Panorama::setOptions(), HuginBase::PanoramaOptions::setWidth(), and hugin_utils::stringToInt().
Referenced by ProcessSection().
void SetCrop | ( | const std::string & | cropString, |
HuginBase::Panorama & | pano, | ||
HuginBase::PanoramaOptions & | options | ||
) |
Definition at line 326 of file PanoOptionsFromIni.cpp.
References HuginBase::Panorama::duplicate(), HuginBase::Panorama::getActiveImages(), HuginBase::getHDRStacks(), HuginBase::PanoramaOptions::getHeight(), HuginBase::CalculateOptimalROI::getResultOptimalROI(), HuginBase::CalculateOptimalROIOutside::getResultOptimalROI(), HuginBase::PanoramaOptions::getROI(), HuginBase::PanoramaOptions::getWidth(), HuginBase::PanoramaAlgorithm::run(), HuginBase::Panorama::setOptions(), HuginBase::PanoramaOptions::setROI(), and HuginBase::CalculateOptimalROI::setStacks().
Referenced by main(), and ProcessSection().
void SetExposure | ( | const std::string & | exposure, |
HuginBase::Panorama & | pano, | ||
HuginBase::PanoramaOptions & | options | ||
) |
Definition at line 407 of file PanoOptionsFromIni.cpp.
References HuginBase::CalculateMeanExposure::calcMeanExposure(), HuginBase::PanoramaOptions::outputExposureValue, and hugin_utils::stringToDouble().
Referenced by ProcessSection().
void SetFOV | ( | const std::string & | fov, |
HuginBase::Panorama & | pano, | ||
HuginBase::PanoramaOptions & | options | ||
) |
Definition at line 255 of file PanoOptionsFromIni.cpp.
References HuginBase::Panorama::duplicate(), HuginBase::PanoramaOptions::fovCalcSupported(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::PanoramaOptions::getProjection(), HuginBase::CalculateFitPanorama::getResultHeight(), HuginBase::CalculateFitPanorama::getResultHorizontalFOV(), HuginBase::PanoramaOptions::getVFOV(), hugin_utils::roundi(), HuginBase::PanoramaAlgorithm::run(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::Panorama::setOptions(), and HuginBase::PanoramaOptions::setVFOV().
Referenced by ProcessSection().
void SetHDRCompression | ( | const std::string | hdrCompression, |
HuginBase::PanoramaOptions & | options | ||
) |
Definition at line 590 of file PanoOptionsFromIni.cpp.
References HuginBase::PanoramaOptions::outputImageTypeHDR, and HuginBase::PanoramaOptions::outputImageTypeHDRCompression.
Referenced by ProcessSection().
void SetLDRCompression | ( | const std::string | ldrCompression, |
HuginBase::PanoramaOptions & | options | ||
) |
Definition at line 537 of file PanoOptionsFromIni.cpp.
References HuginBase::PanoramaOptions::outputImageType, HuginBase::PanoramaOptions::outputImageTypeCompression, HuginBase::PanoramaOptions::quality, and HuginBase::PanoramaOptions::tiffCompression.
Referenced by ProcessSection().
void SetOutputType | ( | const std::string & | outputType, |
HuginBase::PanoramaOptions & | options | ||
) |
Definition at line 445 of file PanoOptionsFromIni.cpp.
References HuginBase::PanoramaOptions::outputHDRBlended, HuginBase::PanoramaOptions::outputHDRLayers, HuginBase::PanoramaOptions::outputHDRStacks, HuginBase::PanoramaOptions::outputLDRBlended, HuginBase::PanoramaOptions::outputLDRExposureBlended, HuginBase::PanoramaOptions::outputLDRExposureLayers, HuginBase::PanoramaOptions::outputLDRExposureLayersFused, HuginBase::PanoramaOptions::outputLDRExposureRemapped, HuginBase::PanoramaOptions::outputLDRLayers, HuginBase::PanoramaOptions::outputLDRStacks, hugin_utils::SplitString(), and hugin_utils::StrTrim().
Referenced by ProcessSection().
void SetProjection | ( | const std::string & | projectionString, |
HuginBase::PanoramaOptions & | options | ||
) |
Definition at line 237 of file PanoOptionsFromIni.cpp.
References ReadProjectionNames(), and HuginBase::PanoramaOptions::setProjection().
Referenced by ProcessSection().
|
static |
Definition at line 49 of file PanoOptionsFromIni.cpp.
|
static |
Definition at line 48 of file PanoOptionsFromIni.cpp.