Hugintrunk
0.1
|
namespace for various utils More...
Classes | |
struct | TDiff2D |
struct | ContextSettings |
Typedefs | |
typedef TDiff2D< double > | FDiff2D |
Functions | |
wxString | doubleTowxString (double d, int digits) |
bool | str2double (const wxString &s, double &d) |
template<class str > | |
str | wxQuoteStringInternal (const str &arg, const str "echar, const str &replacements) |
template<class str > | |
str | wxQuoteString (const str &arg) |
Try to escape special chars on windows and linux. More... | |
template<class str > | |
str | wxQuoteFilename (const str &arg) |
Quote a filename, so that it is surrounded by "". More... | |
void | sortd (int length, double *a, int *ind) |
void | eig_jacobi (int n, double a[3][3], double v[3][3], double *d, int *ind, int *maxsweep, int *maxannil, double *epsilon) |
Implements jacobi eigenvalue/vector algorithm on a symmetric matrix stored as a 2 dimensional matrix a[n][n] and computes the eigenvectors in another globally allocated matrix v[n][n]. More... | |
int | _gcd (int a, int b) |
int | gcd (int a, int b) |
function to calculate greated common divisor using Euclidean algorithm both arguments should be >=0 More... | |
double | round (double x) |
float | roundf (float x) |
int | ceili (double x) |
int | floori (double x) |
template<class T > | |
int | roundi (T x) |
template<class T > | |
T | simpleClipPoint (const T &point, const T &min, const T &max) |
clip a point to fit int [min, max] does not do a mathematical clipping, just sets p.x and p.y to the borders if they are outside. More... | |
template<class T > | |
T | sqr (T t) |
template<class T > | |
double | norm (T t) |
template<class InputIterator1 , class InputIterator2 > | |
double | euclid_dist (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) |
calculate squared Euclidean distance between two vectors. More... | |
template<class InputIterator1 , class InputIterator2 , class T > | |
T | sqr_dist (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T res) |
calculate squared Euclidean distance between two vectors. More... | |
template<class POINT > | |
vigra::Rect2D | calcCircleROIFromPoints (const POINT &p1, const POINT &p2) |
calculate the bounding box of a circle that goes through both points. More... | |
template<class str > | |
str | quoteStringInternal (const str &arg, const str "echar, const str &replacements) |
utility function; escapes characters in replacements with quotechar. More... | |
template<class str > | |
str | quoteString (const str &arg) |
Try to escape special chars on windows and linux. More... | |
template<class str > | |
str | quoteStringShell (const str &arg) |
Try to escape special chars in a string used by a unix type shell. More... | |
template<class str > | |
str | escapeStringMake (const str &arg) |
Escape dangerous chars in makefile strings/filenames (space),#,=. More... | |
template<class str > | |
str | quoteFilename (const str &arg) |
Quote a filename, so that it is surrounded by "". More... | |
std::string | tolower (const std::string &s) |
convert a string to lowercase More... | |
std::string | toupper (const std::string &s) |
std::string | GetCurrentTimeString () |
current time as a string More... | |
std::string | getExtension (const std::string &basename) |
Get extension of a filename. More... | |
std::string | stripExtension (const std::string &basename) |
remove extension of a filename More... | |
std::string | stripPath (const std::string &filename) |
remove the path of a filename (mainly useful for gui display of filenames) More... | |
std::string | getPathPrefix (const std::string &filename) |
Get the path to a filename. More... | |
std::string | StrTrim (const std::string &str) |
remove trailing and leading white spaces and tabs More... | |
std::string | doubleToString (double d, int fractionaldigits=-1) |
convert a double to a string, suitable for display within a GUI. More... | |
bool | stringToInt (const std::string &s, int &val) |
convert string to integer value, returns true, if sucessful More... | |
bool | stringToUInt (const std::string &s, unsigned int &val) |
convert string to unsigned integer value, returns true, if sucessful More... | |
std::vector< std::string > | SplitString (const std::string &s, const std::string &sep) |
split string s at given sep, returns vector of strings More... | |
void | ReplaceAll (std::string &s, const std::string &oldChar, char newChar) |
replace all characters oldChar in s with newChar More... | |
bool | StringContainsCaseInsensitive (const std::string &s1, const std::string &s2) |
check if s1 contains s2 using case insensitive comparison More... | |
void | ControlPointErrorColour (const double cperr, double &r, double &g, double &b) |
bool | FileExists (const std::string &filename) |
checks if file exists More... | |
std::string | GetAbsoluteFilename (const std::string &filename) |
returns the full absolute filename More... | |
bool | IsFileTypeSupported (const std::string &filename) |
return true, if file type by extension is supported by vigra More... | |
void | EnforceExtension (std::string &filename, const std::string &defaultExtension) |
check if filename contains extension, if not add default extension More... | |
std::string | GetOutputFilename (const std::string &out, const std::string &in, const std::string &suffix) |
construct output filename, if ouput is known return this value otherwise use the input filename and append the suffix before the extension More... | |
std::string | GetDataDir () |
returns the full path to the data directory More... | |
std::string | GetHomeDir () |
std::string | GetUserAppDataDir () |
returns the directory for user specific Hugin settings, e.g. More... | |
bool | CreateContext (int *argcp, char **argv) |
void | DestroyContext () |
bool | initGPU (int *argcp, char **argv) |
Try to initalise GLUT and GLEW, and create an OpenGL context for GPU stitching. More... | |
bool | wrapupGPU () |
cleanup GPU settings More... | |
std::string | GetHuginVersion () |
return a string with version numbers More... | |
std::string | GetICCDesc (const vigra::ImageImportInfo::ICCProfile &iccProfile) |
returns description of given icc profile More... | |
std::string | GetICCDesc (const cmsHPROFILE &profile) |
std::vector< std::string > | GetRawExtensions () |
return vector of known extensions of raw files, all lower case More... | |
bool | IsRawExtension (const std::string testExt) |
return true if extension belongs to a raw file More... | |
template<typename STR > | |
bool | stringToDouble (const STR &str_, double &dest) |
convert a string to a double, ignore localisation. More... | |
template<class str > | |
str | QuoteStringInternal (const str &arg, const str "echar, const str &replacements) |
Variables | |
static ContextSettings | context |
namespace for various utils
typedef TDiff2D<double> hugin_utils::FDiff2D |
Definition at line 150 of file hugin_math.h.
int hugin_utils::_gcd | ( | int | a, |
int | b | ||
) |
Definition at line 29 of file hugin_math.cpp.
Referenced by gcd().
vigra::Rect2D hugin_utils::calcCircleROIFromPoints | ( | const POINT & | p1, |
const POINT & | p2 | ||
) |
calculate the bounding box of a circle that goes through both points.
the center of the circle is halfway between the two points
Definition at line 217 of file hugin_math.h.
References roundi().
|
inline |
Definition at line 60 of file hugin_math.h.
Referenced by HuginBase::estimateImageAlpha().
IMPEX void hugin_utils::ControlPointErrorColour | ( | const double | cperr, |
double & | r, | ||
double & | g, | ||
double & | b | ||
) |
Definition at line 341 of file utils.cpp.
Referenced by PreviewControlPointTool::AfterDrawImagesEvent(), PreviewLayoutLinesTool::LineDetails::draw(), and CPImagesComboBox::OnDrawItem().
bool hugin_utils::CreateContext | ( | int * | argcp, |
char ** | argv | ||
) |
Definition at line 789 of file utils.cpp.
References hugin_utils::ContextSettings::colormap, hugin_utils::ContextSettings::context, context, hugin_utils::ContextSettings::display, hugin_utils::ContextSettings::visualInfo, and hugin_utils::ContextSettings::window.
Referenced by initGPU().
void hugin_utils::DestroyContext | ( | ) |
Definition at line 832 of file utils.cpp.
References hugin_utils::ContextSettings::colormap, hugin_utils::ContextSettings::context, context, hugin_utils::ContextSettings::display, hugin_utils::ContextSettings::visualInfo, and hugin_utils::ContextSettings::window.
Referenced by initGPU(), and wrapupGPU().
IMPEX std::string hugin_utils::doubleToString | ( | double | d, |
int | fractionaldigits = -1 |
||
) |
convert a double to a string, suitable for display within a GUI.
d
value to convert t a string fractionaldigits
number of fractional digits. -1: not specified, use default.
Definition at line 228 of file utils.cpp.
References celeste::min().
Referenced by doubleTowxString(), PreviewFrame::panoramaChanged(), GLPreviewFrame::panoramaChanged(), HuginBase::SrcPanoImage::readEXIF(), HuginBase::Nona::SetAdvancedOption(), and PanoPanel::UpdateDisplay().
WXIMPEX wxString hugin_utils::doubleTowxString | ( | double | d, |
int | digits | ||
) |
Definition at line 31 of file wxPlatform.cpp.
References doubleToString().
Referenced by LensCalFrame::AddImages(), HFOVDialog::HFOVDialog(), ImageVariableDialog::InitValues(), ImagesTreeCtrl::OnBeginEdit(), HFOVDialog::OnCropFactorChanged(), HFOVDialog::OnFocalLengthChanged(), HFOVDialog::OnHFOVChanged(), HFOVDialog::OnLoadLensParameters(), CPListFrame::OnSelectButton(), ImagesPanel::OnSelectionChanged(), HFOVDialog::OnTypeChanged(), LensCalFrame::Optimize(), ImagesPanel::panoramaChanged(), LensCalFrame::ParametersToDisplay(), LoadLensDBDialog::SetAperture(), SaveLensDBDialog::SetAperture(), LoadLensDBDialog::SetFocalLength(), SaveLensDBDialog::SetFocalLength(), LoadLensDBDialog::SetSubjectDistance(), SaveLensDBDialog::SetSubjectDistance(), PreferencesDialog::UpdateDisplayData(), ImagesTreeCtrl::UpdateGroupText(), ImagesTreeCtrl::UpdateImageText(), and HuginQueue::wxStringFromCDouble().
void hugin_utils::eig_jacobi | ( | int | n, |
double | a[3][3], | ||
double | v[3][3], | ||
double * | d, | ||
int * | ind, | ||
int * | maxsweep, | ||
int * | maxannil, | ||
double * | epsilon | ||
) |
Implements jacobi eigenvalue/vector algorithm on a symmetric matrix stored as a 2 dimensional matrix a[n][n] and computes the eigenvectors in another globally allocated matrix v[n][n].
intput: n - size of matrix problem outputs: v - eigenvector matrix d[MAX] - a vector of unsorted eigenvalues ind[MAX] - a vector of indicies sorting d[] into descending order maxanil - number of rotations applied inputs/outputs a - input matrix (the input is changed) maxsweep - on input max number of sweeps
Definition at line 68 of file eig_jacobi.cpp.
References sortd().
Referenced by HuginBase::StraightenPanorama::calcStraighteningRotation().
IMPEX void hugin_utils::EnforceExtension | ( | std::string & | filename, |
const std::string & | defaultExtension | ||
) |
check if filename contains extension, if not add default extension
Definition at line 411 of file utils.cpp.
References getExtension(), and stripExtension().
Referenced by main().
str hugin_utils::escapeStringMake | ( | const str & | arg | ) |
Escape dangerous chars in makefile strings/filenames (space),#,=.
Definition at line 143 of file platform.h.
References quoteStringInternal().
double hugin_utils::euclid_dist | ( | InputIterator1 | first1, |
InputIterator1 | last1, | ||
InputIterator2 | first2 | ||
) |
calculate squared Euclidean distance between two vectors.
Definition at line 183 of file hugin_math.h.
IMPEX bool hugin_utils::FileExists | ( | const std::string & | filename | ) |
checks if file exists
Definition at line 362 of file utils.cpp.
Referenced by Batch::AppendBatchFile(), HuginBase::LensDB::LensDB::Database::Database(), GenerateSequenceDialog::DoGeneratePanorama(), PanoPanel::DoSendToBatch(), GenerateThumbnail(), GetAbsoluteFilename(), RTRawImport::GetDefaultExe(), DarkTableRawImport::GetDefaultExe(), HuginQueue::GetExternalProgram(), PanoDetector::loadProject(), Batch::LoadTemp(), main(), GenerateSequenceDialog::OnGeneratePreview(), stitchApp::OnInit(), RawImportDialog::OnOk(), ChangeUserDefinedSequenceDialog::OnOk(), FailedProjectsDialog::OnSelectProject(), MainFrame::OnSendToAssistantQueue(), BatchFrame::OnUpdateListBox(), BrowsePTOFilesDialog::ParsePTOFile(), PrintImageInfo(), RTRawImport::ProcessAdditionalParameters(), PanoCommand::wxAddImagesCmd::processPanorama(), reduceFilesToHDR(), Batch::RunNextInBatch(), CPImageCtrl::setImage(), and StackImagesAndMask().
|
inline |
Definition at line 65 of file hugin_math.h.
Referenced by HuginBase::CalculateCPStatisticsRadial::calcCtrlPntsRadiStats(), HuginBase::estimateImageAlpha(), WinsorMeanStacker< ValueType >::getResult(), WinsorMeanStacker< ValueType >::getResultAndSigma(), PanoOutputDialog::PanoOutputDialog(), PanoPanel::UpdateDisplay(), PreferencesDialog::UpdateDisplayData(), and GLPreviewFrame::UpdateRoiDisplay().
int IMPEX hugin_utils::gcd | ( | int | a, |
int | b | ||
) |
function to calculate greated common divisor using Euclidean algorithm both arguments should be >=0
Definition at line 35 of file hugin_math.cpp.
References _gcd().
Referenced by PanoPanel::UpdateDisplay(), and GLPreviewFrame::UpdateRoiDisplay().
IMPEX std::string hugin_utils::GetAbsoluteFilename | ( | const std::string & | filename | ) |
returns the full absolute filename
replace realpath with function with works without this hack
Definition at line 368 of file utils.cpp.
References FileExists().
Referenced by CreateMissingImages(), main(), PTOCopyMove(), and ReadPanoramaOptionsFromIni().
IMPEX std::string hugin_utils::GetCurrentTimeString | ( | ) |
IMPEX std::string hugin_utils::GetDataDir | ( | ) |
returns the full path to the data directory
Definition at line 441 of file utils.cpp.
Referenced by RTRawImport::GetCmdQueueForReference(), HuginQueue::GetStitchingCommandQueue(), ImageVariablesExpressionDialog::ImageVariablesExpressionDialog(), PanoDetector::LoadSVMModel(), main(), and HuginExecutor::OnCmdLineParsed().
IMPEX std::string hugin_utils::getExtension | ( | const std::string & | basename2 | ) |
Get extension of a filename.
Definition at line 99 of file utils.cpp.
Referenced by EnforceExtension(), GetOutputFilename(), IsFileTypeSupported(), main(), reduceFilesToHDR(), SetCompression(), HuginBase::Nona::WeightedStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::stitch(), and HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch().
std::string hugin_utils::GetHomeDir | ( | ) |
Definition at line 477 of file utils.cpp.
Referenced by GetUserAppDataDir().
IMPEX std::string hugin_utils::GetHuginVersion | ( | ) |
return a string with version numbers
Definition at line 920 of file utils.cpp.
Referenced by AboutDialog::AboutDialog(), HuginQueue::detail::GenerateFinalArgfile(), AboutDialog::GetSystemInformation(), main(), MainFrame::MainFrame(), RunStitchFrame::OnAbout(), HuginQueue::detail::PrintDetailInfo(), printVersion(), and usage().
IMPEX std::string hugin_utils::GetICCDesc | ( | const vigra::ImageImportInfo::ICCProfile & | iccProfile | ) |
returns description of given icc profile
Definition at line 925 of file utils.cpp.
Referenced by PrintImageInfo(), PanoCommand::wxAddImagesCmd::processPanorama(), and PanoCommand::wxLoadPTProjectCmd::processPanorama().
IMPEX std::string hugin_utils::GetICCDesc | ( | const cmsHPROFILE & | profile | ) |
IMPEX std::string hugin_utils::GetOutputFilename | ( | const std::string & | out, |
const std::string & | in, | ||
const std::string & | suffix | ||
) |
construct output filename, if ouput is known return this value otherwise use the input filename and append the suffix before the extension
Definition at line 420 of file utils.cpp.
References getExtension().
Referenced by main().
IMPEX std::string hugin_utils::getPathPrefix | ( | const std::string & | filename | ) |
Get the path to a filename.
Definition at line 184 of file utils.cpp.
References celeste::max().
Referenced by CheckProjectFile(), CreateMissingImages(), GenerateSequenceDialog::DoGeneratePanorama(), GenerateThumbnail(), Papywizard::ImportPapywizardFile(), PanoDetector::loadProject(), main(), iCPApp::OnRun(), HuginExecutor::OnRun(), LensCalFrame::OnSaveProject(), MainFrame::OnSaveProject(), BrowsePTOFilesDialog::ParsePTOFile(), processPTO(), PTOCopyMove(), ReadPanoramaOptionsFromIni(), MainFrame::RunAssistant(), and PanoDetector::writeOutput().
IMPEX std::vector< std::string > hugin_utils::GetRawExtensions | ( | ) |
return vector of known extensions of raw files, all lower case
return vector of known extensions of raw files, all in lower case
Definition at line 953 of file utils.cpp.
Referenced by GetFileDialogImageAndRawFilters(), IsRawExtension(), and IsRawExtension().
IMPEX std::string hugin_utils::GetUserAppDataDir | ( | ) |
returns the directory for user specific Hugin settings, e.g.
lens database the directory is automatically created if it does not exists
Definition at line 497 of file utils.cpp.
References GetHomeDir().
Referenced by ChangeUserDefinedSequenceDialog::FillAssistantUserDefined(), ChangeUserDefinedSequenceDialog::FillStitcherUserDefined(), SelectAspectRatioDialog::GetAspectRatioFilename(), HuginQueue::GetAssistantCommandQueue(), Batch::GetBatchFilename(), EditOutputIniDialog::GetIniFileName(), ImageVariablesExpressionDialog::ImageVariablesExpressionDialog(), HuginBase::LensDB::LensDB::LensDB(), MainFrame::MainFrame(), and HuginExecutor::OnCmdLineParsed().
IMPEX bool hugin_utils::initGPU | ( | int * | argcp, |
char ** | argv | ||
) |
Try to initalise GLUT and GLEW, and create an OpenGL context for GPU stitching.
OpenGL extensions required by the GPU stitcher (-g option) are checked here.
Definition at line 858 of file utils.cpp.
References CreateContext(), DestroyContext(), and stripPath().
Referenced by main().
IMPEX bool hugin_utils::IsFileTypeSupported | ( | const std::string & | filename | ) |
return true, if file type by extension is supported by vigra
Definition at line 405 of file utils.cpp.
References getExtension().
Referenced by main().
IMPEX bool hugin_utils::IsRawExtension | ( | const std::string | testExt | ) |
return true if extension belongs to a raw file
Definition at line 959 of file utils.cpp.
References GetRawExtensions(), and tolower().
Referenced by main().
double hugin_utils::norm | ( | T | t | ) |
Definition at line 175 of file hugin_math.h.
Referenced by HuginBase::CalculateOptimalScale::calcOptimalPanoScale(), HuginBase::MaskPolygon::FindPointNearPos(), HuginLines::GetFootpoint(), HuginBase::AllPointSampler::sampleAllPanoPoints(), HuginBase::RandomPointSampler::sampleRandomPanoPoints(), and HuginBase::MaskPolygon::subSample().
str hugin_utils::quoteFilename | ( | const str & | arg | ) |
Quote a filename, so that it is surrounded by "".
I don't know the escape char for windows
Definition at line 158 of file platform.h.
References quoteStringInternal().
Referenced by AutoPanoSift::automatch(), and AutoPanoKolor::automatch().
str hugin_utils::quoteString | ( | const str & | arg | ) |
Try to escape special chars on windows and linux.
: I'm quite sure that this routine doesn't replace some important shell chars I don't know of. This could lead to nasty behaviour and maybe even security holes.
Definition at line 106 of file platform.h.
References quoteStringInternal().
str hugin_utils::quoteStringInternal | ( | const str & | arg, |
const str & | quotechar, | ||
const str & | replacements | ||
) |
utility function; escapes characters in replacements with quotechar.
Definition at line 54 of file platform.h.
Referenced by escapeStringMake(), quoteFilename(), quoteString(), and quoteStringShell().
str hugin_utils::QuoteStringInternal | ( | const str & | arg, |
const str & | quotechar, | ||
const str & | replacements | ||
) |
str hugin_utils::quoteStringShell | ( | const str & | arg | ) |
Try to escape special chars in a string used by a unix type shell.
: I'm quite sure that this routine doesn't replace some important shell chars I don't know of. This could lead to nasty behaviour and maybe even security holes.
Note that : and = are not special shell charaters but they also should be escaped because they causes problems with gnumake.
Definition at line 128 of file platform.h.
References quoteStringInternal().
IMPEX void hugin_utils::ReplaceAll | ( | std::string & | s, |
const std::string & | oldChar, | ||
char | newChar | ||
) |
|
inline |
Definition at line 50 of file hugin_math.h.
Referenced by wxGraphTools::Graph::TransformX(), wxGraphTools::Graph::TransformY(), and PreviewPanel::updatePreview().
|
inline |
Definition at line 55 of file hugin_math.h.
|
inline |
Definition at line 73 of file hugin_math.h.
Referenced by HuginLines::_getVerticalLines(), vigra_ext::ApplyGammaFunctor< vigra::UInt16, vigra::UInt8 >::ApplyGammaFunctor(), lfeat::CircularKeyPointDescriptor::assignOrientation(), AutoPanoSiftMultiRow::automatch(), lfeat::BoxFilter::BoxFilter(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::calcAlpha(), calcCircleROIFromPoints(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::calcSrcCoordImgs(), lfeat::KeyPointDetector::calcTrace(), HuginBase::Photometric::ResponseTransform< VTIn >::calcVigFactor(), HuginBase::Panorama::centerCropImage(), correctImage(), CPEvent::CPEvent(), createCtrlPoints(), lfeat::CircularKeyPointDescriptor::createDescriptor(), MaskEditorPanel::DisplayCrop(), PanoPanel::DoCalcFOV(), PanoPanel::DoCalcOptimalWidth(), DisplayedControlPoint::Draw(), DisplayedControlPoint::DrawLine(), DisplayedControlPoint::DrawLineSegment(), PreviewPanel::DrawOutline(), LensCalImageCtrl::DrawView(), HuginBase::estimateImageAlpha(), MyExecPanel::ExecNextQueue(), CPEditorPanel::FineTuneSelectedPoint(), HuginQueue::GetAssistantCommandQueue(), HuginBase::LensDB::LensDB::GetCrop(), CPImageCtrl::GetMagBitmap(), HuginBase::CalculateOptimalScale::getResultOptimalWidth(), GreatCircleArc::GreatCircleArc(), loadPoints(), loadPointsC(), main(), PanoDetector::matchMultiRow(), GLViewer::MouseEnter(), GLViewer::MouseMotion(), CPEditorPanel::OnCPEvent(), GLPreviewFrame::OnCreateCP(), CPImageCtrl::OnDraw(), MainFrame::OnFineTuneAll(), PreviewFrame::OnFitPano(), GLPreviewFrame::OnFitPano(), LensCalImageCtrl::OnMouseEvent(), PanoOutputDialog::OnOk(), RawImportProgress::OnProcessReferenceTerminate(), MyExecPanel::OnProcessTerminated(), RawImportProgress::OnProgress(), PanoOutputDialog::PanoOutputDialog(), PreviewFrame::panoramaChanged(), GLPreviewFrame::panoramaChanged(), PointFineTuneProjectionAware(), print_result(), PanoCommand::CenterPanoCmd::processPanorama(), PanoCommand::StraightenPanoCmd::processPanorama(), ReadPanoramaOptionsFromIni(), HuginQueue::detail::ReplaceWidthHeightPlaceHolder(), LensCalImageCtrl::Resize(), CPImageCtrl::roundP(), HuginBase::FitPanorama::runAlgorithm(), HuginBase::PointSampler::sampleAndExtractPoints(), SetCanvas(), SetFOV(), HuginBase::PanoramaOptions::setVFOV(), HuginBase::PanoramaOptions::setWidth(), CPImageCtrl::showPosition(), hugin_utils::TDiff2D< T >::toDiff2D(), HuginBase::Nona::traceImageOutline(), MaskImageCtrl::UpdateCrop(), and PreferencesDialog::UpdateDisplayData().
T hugin_utils::simpleClipPoint | ( | const T & | point, |
const T & | min, | ||
const T & | max | ||
) |
clip a point to fit int [min, max] does not do a mathematical clipping, just sets p.x and p.y to the borders if they are outside.
Definition at line 158 of file hugin_math.h.
Referenced by vigra_ext::PointFineTune(), and VisualizationState::SetViewingCenter().
void hugin_utils::sortd | ( | int | length, |
double * | a, | ||
int * | ind | ||
) |
Definition at line 24 of file eig_jacobi.cpp.
Referenced by eig_jacobi().
IMPEX std::vector< std::string > hugin_utils::SplitString | ( | const std::string & | s, |
const std::string & | sep | ||
) |
split string s at given sep, returns vector of strings
Definition at line 294 of file utils.cpp.
References StrTrim().
Referenced by EnableImages(), GetVigraImageFilter(), HuginBase::LensDB::LensDB::Database::ImportCropFactor(), HuginBase::LensDB::LensDB::Database::ImportDistortion(), HuginBase::LensDB::LensDB::Database::ImportEMOR(), HuginBase::LensDB::LensDB::Database::ImportFromFile(), HuginBase::LensDB::LensDB::Database::ImportHFOV(), HuginBase::LensDB::LensDB::Database::ImportLensCrop(), HuginBase::LensDB::LensDB::Database::ImportProjection(), HuginBase::LensDB::LensDB::Database::ImportTCA(), HuginBase::LensDB::LensDB::Database::ImportVignetting(), main(), ParseImageLensStackString(), Parser::ParseVariableString(), SetCrop(), SetCropToImages(), and SetOutputType().
T hugin_utils::sqr | ( | T | t | ) |
Definition at line 169 of file hugin_math.h.
Referenced by HuginLines::_getVerticalLines(), HuginBase::MaskPolygon::FindPointNearPos(), HuginLines::GetFootpoint(), MaskImageCtrl::OnLeftMouseUp(), MaskImageCtrl::OnRightMouseUp(), HuginBase::AllPointSampler::sampleAllPanoPoints(), HuginBase::RandomPointSampler::sampleRandomPanoPoints(), and MaskImageCtrl::UpdateCrop().
T hugin_utils::sqr_dist | ( | InputIterator1 | first1, |
InputIterator1 | last1, | ||
InputIterator2 | first2, | ||
T | res | ||
) |
calculate squared Euclidean distance between two vectors.
Definition at line 200 of file hugin_math.h.
WXIMPEX bool hugin_utils::str2double | ( | const wxString & | s, |
double & | d | ||
) |
Definition at line 37 of file wxPlatform.cpp.
References stringToDouble().
Referenced by ImageVariableDialog::ApplyNewVariables(), PanoPanel::HFOVChanged(), HFOVDialog::OnCropFactorChanged(), ImagesPanel::OnCropFactorChanged(), ImagesTreeCtrl::OnEndEdit(), GLPreviewFrame::OnExposureChanged(), HFOVDialog::OnFocalLengthChanged(), ImagesPanel::OnFocalLengthChanged(), HFOVDialog::OnHFOVChanged(), GLPreviewFrame::OnHFOVChanged(), ImagesPanel::OnMaxEvDiffChanged(), ImagesPanel::OnMinimumOverlapChanged(), PreviewFrame::OnNumTransform(), GLPreviewFrame::OnProjParameterChanged(), GLPreviewFrame::OnRangeCompressionChanged(), CPListFrame::OnSelectButton(), ImageVariableDialog::OnShowDistortionGraph(), ImageVariableDialog::OnShowResponseGraph(), ImageVariableDialog::OnShowVignettingGraph(), PreviewFrame::OnTextCtrlChanged(), CPEditorPanel::OnTextPointChange(), GLPreviewFrame::OnVFOVChanged(), LensCalFrame::ReadInputs(), and PanoPanel::VFOVChanged().
IMPEX bool hugin_utils::StringContainsCaseInsensitive | ( | const std::string & | s1, |
const std::string & | s2 | ||
) |
check if s1 contains s2 using case insensitive comparison
Definition at line 335 of file utils.cpp.
References tolower().
Referenced by HuginBase::SrcPanoImage::readEXIF().
bool hugin_utils::stringToDouble | ( | const STR & | str_, |
double & | dest | ||
) |
convert a string to a double, ignore localisation.
always accept both.
sets dest
to the new value, and returns true if it could be read.
it the conversion fails, returns false and does not modify dest
.
Definition at line 114 of file utils.h.
References DEBUG_DEBUG.
Referenced by HuginBase::SrcPanoImage::applyEXIFValues(), CheckDouble(), HuginBase::Nona::GetAdvancedOption(), HuginBase::PTScriptParsing::getDoubleParam(), HuginBase::PTScriptParsing::getPTDoubleParam(), HuginBase::LensDB::LensDB::Database::ImportCropFactor(), HuginBase::LensDB::LensDB::Database::ImportDistortion(), HuginBase::LensDB::LensDB::Database::ImportEMOR(), HuginBase::LensDB::LensDB::Database::ImportHFOV(), HuginBase::LensDB::LensDB::Database::ImportLensCrop(), HuginBase::LensDB::LensDB::Database::ImportTCA(), HuginBase::LensDB::LensDB::Database::ImportVignetting(), main(), GLPreviewFrame::OnNumTransform(), ParseCoordinateRelativ(), Papywizard::ParseHeader(), BrowsePTOFilesDialog::ParsePTOFile(), Papywizard::ParseShoot(), HuginBase::PTScriptParsing::readVar(), SetExposure(), str2double(), str2double(), and PreferencesDialog::UpdateConfigData().
IMPEX bool hugin_utils::stringToInt | ( | const std::string & | s, |
int & | val | ||
) |
convert string to integer value, returns true, if sucessful
Definition at line 264 of file utils.cpp.
References StrTrim().
Referenced by CheckInt(), EnableImages(), IniParser::GetKey(), HuginBase::PTScriptParsing::getPTDoubleParam(), HuginBase::LensDB::LensDB::Database::ImportDistortion(), HuginBase::LensDB::LensDB::Database::ImportEMOR(), HuginBase::LensDB::LensDB::Database::ImportHFOV(), HuginBase::LensDB::LensDB::Database::ImportLensCrop(), HuginBase::LensDB::LensDB::Database::ImportProjection(), HuginBase::LensDB::LensDB::Database::ImportTCA(), HuginBase::LensDB::LensDB::Database::ImportVignetting(), main(), ParseCoordinateRelativ(), ParseSingleImage(), HuginBase::PTScriptParsing::readVar(), SetCanvas(), SetCropToImages(), and stringToUInt().
IMPEX bool hugin_utils::stringToUInt | ( | const std::string & | s, |
unsigned int & | val | ||
) |
convert string to unsigned integer value, returns true, if sucessful
Definition at line 280 of file utils.cpp.
References stringToInt().
IMPEX std::string hugin_utils::stripExtension | ( | const std::string & | basename2 | ) |
remove extension of a filename
Definition at line 130 of file utils.cpp.
Referenced by EnforceExtension(), getKeyfilenameFor(), InputImage::getMaskFilename(), main(), reduceFilesToHDR(), HuginBase::Nona::WeightedStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::stitch(), and HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch().
IMPEX std::string hugin_utils::stripPath | ( | const std::string & | filename | ) |
remove the path of a filename (mainly useful for gui display of filenames)
Definition at line 160 of file utils.cpp.
References celeste::max().
Referenced by HuginBase::Nona::TiffMultiLayerRemapper< ImageType, AlphaImageType >::finalizeOutputFile(), HuginBase::ImageCache::getImage(), getKeyfilenameFor(), HuginBase::Nona::FileRemapper< ImageType, AlphaType >::getRemapped(), HuginBase::ImageCache::getSmallImage(), initGPU(), main(), parseOptions(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), ReadPanoramaOptionsFromIni(), AutoCtrlPointCreator::readUpdatedControlPoints(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage(), HuginBase::Nona::remapImage(), HuginBase::Nona::detail::saveRemapped(), HuginBase::Nona::WeightedStitcher< ImageType, AlphaType >::stitch(), and HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch().
IMPEX std::string hugin_utils::StrTrim | ( | const std::string & | str | ) |
remove trailing and leading white spaces and tabs
Definition at line 208 of file utils.cpp.
Referenced by HuginBase::Exiv2Helper::getExiv2ValueString(), GetICCDesc(), main(), Parser::ParseSingleVar(), print_result(), ProcessSection(), IniParser::Read(), SetCrop(), SetOutputType(), SplitString(), and stringToInt().
|
inline |
convert a string to lowercase
Definition at line 49 of file stl_utils.h.
Referenced by CheckCondition(), IsRawExtension(), main(), Parser::ParseExpression(), parseOptions(), ProcessSection(), HuginBase::SrcPanoImage::readEXIF(), ReadProjectionNames(), reduceFilesToHDR(), Parser::ShuntingYard::RemoveWhiteSpaces(), HuginBase::Nona::WeightedStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch(), and StringContainsCaseInsensitive().
|
inline |
Definition at line 59 of file stl_utils.h.
Referenced by IniParser::GetKey(), iterateFileSystem(), main(), ProcessSection(), PTOCopyMove(), and SetCompression().
IMPEX bool hugin_utils::wrapupGPU | ( | ) |
cleanup GPU settings
Definition at line 914 of file utils.cpp.
References DestroyContext().
Referenced by main().
str hugin_utils::wxQuoteFilename | ( | const str & | arg | ) |
Quote a filename, so that it is surrounded by "".
I don't know the escape char for windows
Definition at line 82 of file wxPlatform.h.
References wxQuoteStringInternal().
Referenced by AutoPanoSift::automatch(), AutoPanoKolor::automatch(), AutoCtrlPointCreator::Cleanup(), PanoPanel::DoSendToBatch(), PanoPanel::DoStitch(), MyExecuteCommandOnDialog(), and MainFrame::OnSendToAssistantQueue().
str hugin_utils::wxQuoteString | ( | const str & | arg | ) |
Try to escape special chars on windows and linux.
: I'm quite sure that this routine doesn't replace some important shell chars I don't know of. This could lead to nasty behaviour and maybe even security holes.
Definition at line 66 of file wxPlatform.h.
References wxQuoteStringInternal().
Referenced by PanoPanel::DoSendToBatch().
str hugin_utils::wxQuoteStringInternal | ( | const str & | arg, |
const str & | quotechar, | ||
const str & | replacements | ||
) |
Definition at line 36 of file wxPlatform.h.
Referenced by HuginQueue::wxEscapeFilename(), wxQuoteFilename(), and wxQuoteString().
|
static |
Definition at line 787 of file utils.cpp.
Referenced by CreateContext(), and DestroyContext().