Hugin trunk 0.1
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
hugin_utils Namespace Reference

namespace for various utils More...

Classes

struct  ContextSettings
 
class  DisableWindow
 helper class, it disables the control/window in the constructor and automatically enables it back in destructor, create this DisableWindow class on the stack, this disables the control, when the variable goes out of scope the connected control is automatically enabled again More...
 
struct  TDiff2D
 

Typedefs

typedef std::unique_ptr< wxMessageDialogBaseMessageDialog
 
typedef TDiff2D< doubleFDiff2D
 

Functions

wxString doubleTowxString (double d, int digits)
 
bool str2double (const wxString &s, double &d)
 
template<class str >
str wxQuoteStringInternal (const str &arg, const str &quotechar, const str &replacements)
 
template<class str >
str wxQuoteString (const str &arg)
 Try to escape special chars on windows and linux.
 
template<class str >
str wxQuoteFilename (const str &arg)
 Quote a filename, so that it is surrounded by "".
 
WXIMPEX wxString GetFormattedTimeSpan (const wxTimeSpan &timeSpan)
 
void RestoreFramePosition (wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
 
void StoreFramePosition (wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
 
void RestoreFramePositionOnly (wxTopLevelWindow *frame, const wxString &basename)
 
void StoreFramePositionOnly (wxTopLevelWindow *frame, const wxString &basename)
 
int HuginMessageBox (const wxString &message, const wxString &caption, int style, wxWindow *parent)
 
MessageDialog GetMessageDialog (const wxString &message, const wxString &caption, int style, wxWindow *parent)
 
bool AskUserOverwrite (const wxString &filename, const wxString &caption, wxWindow *parent)
 ask user if the given file should be overwritten, return true if the user confirmed the overwritting
 
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].
 
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
 
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 >
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.
 
template<class 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.
 
template<class InputIterator1 , class InputIterator2 , class T >
sqr_dist (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T res)
 calculate squared Euclidean distance between two vectors.
 
template<class POINT >
vigra::Rect2D calcCircleROIFromPoints (const POINT &p1, const POINT &p2)
 calculate the bounding box of a circle that goes through both points.
 
template<class str >
str quoteStringInternal (const str &arg, const str &quotechar, const str &replacements)
 utility function; escapes characters in replacements with quotechar.
 
template<class str >
str quoteString (const str &arg)
 Try to escape special chars on windows and linux.
 
template<class str >
str quoteStringShell (const str &arg)
 Try to escape special chars in a string used by a unix type shell.
 
template<class str >
str escapeStringMake (const str &arg)
 Escape dangerous chars in makefile strings/filenames (space),#,=.
 
template<class str >
str quoteFilename (const str &arg)
 Quote a filename, so that it is surrounded by "".
 
std::string tolower (const std::string &s)
 convert a string to lowercase
 
std::string toupper (const std::string &s)
 
std::string GetCurrentTimeString ()
 current time as a string
 
std::string getExtension (const std::string &basename)
 Get extension of a filename.
 
std::string stripExtension (const std::string &basename)
 remove extension of a filename
 
std::string stripPath (const std::string &filename)
 remove the path of a filename (mainly useful for gui display of filenames)
 
std::string getPathPrefix (const std::string &filename)
 Get the path to a filename.
 
std::string StrTrim (const std::string &str)
 remove trailing and leading white spaces and tabs
 
std::string doubleToString (double d, int fractionaldigits=-1)
 convert a double to a string, suitable for display within a GUI.
 
bool stringToInt (const std::string &s, int &val)
 convert string to integer value, returns true, if sucessful
 
bool stringToUInt (const std::string &s, unsigned int &val)
 convert string to unsigned integer value, returns true, if sucessful
 
std::vector< std::string > SplitString (const std::string &s, const std::string &sep)
 split string s at given sep, returns vector of strings
 
void ReplaceAll (std::string &s, const std::string &oldChar, char newChar)
 replace all characters oldChar in s with newChar
 
bool StringContainsCaseInsensitive (const std::string &s1, const std::string &s2)
 check if s1 contains s2 using case insensitive comparison
 
void ControlPointErrorColour (const double cperr, double &r, double &g, double &b)
 
bool FileExists (const std::string &filename)
 checks if file exists
 
std::string GetAbsoluteFilename (const std::string &filename)
 returns the full absolute filename
 
bool IsFileTypeSupported (const std::string &filename)
 return true, if file type by extension is supported by vigra
 
void EnforceExtension (std::string &filename, const std::string &defaultExtension)
 check if filename contains extension, if not add default extension
 
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
 
std::string GetDataDir ()
 returns the full path to the data directory
 
std::string GetHomeDir ()
 
std::string GetUserAppDataDir ()
 returns the directory for user specific Hugin settings, e.g.
 
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.
 
bool wrapupGPU ()
 cleanup GPU settings
 
std::string GetHuginVersion ()
 return a string with version numbers
 
std::string GetICCDesc (const vigra::ImageImportInfo::ICCProfile &iccProfile)
 returns description of given icc profile
 
std::string GetICCDesc (const cmsHPROFILE &profile)
 
bool IsLinearICCProfile (const vigra::ImageImportInfo::ICCProfile &iccProfile)
 return true if icc profile is linear one, otherwise return false
 
std::vector< std::string > GetRawExtensions ()
 return vector of known extensions of raw files, all lower case
 
bool IsRawExtension (const std::string testExt)
 return true if extension belongs to a raw file
 
bool CheckInterpolator (int value)
 check that interpolator number is valid
 
template<typename STR >
bool stringToDouble (const STR &str_, double &dest)
 convert a string to a double, ignore localisation.
 
template<class str >
str QuoteStringInternal (const str &arg, const str &quotechar, const str &replacements)
 

Variables

static ContextSettings context
 

Detailed Description

namespace for various utils

Typedef Documentation

◆ FDiff2D

Definition at line 162 of file hugin_math.h.

◆ MessageDialog

Definition at line 90 of file wxutils.h.

Function Documentation

◆ _gcd()

int hugin_utils::_gcd ( int  a,
int  b 
)

Definition at line 29 of file hugin_math.cpp.

References _gcd().

Referenced by _gcd(), and gcd().

◆ AskUserOverwrite()

WXIMPEX bool hugin_utils::AskUserOverwrite ( const wxString filename,
const wxString caption,
wxWindow *  parent 
)

ask user if the given file should be overwritten, return true if the user confirmed the overwritting

Definition at line 233 of file wxutils.cpp.

References HuginMessageBox(), and threshold().

Referenced by MaskEditorPanel::OnMaskSave(), wxGraphTools::GraphPopupWindow::OnRightDown(), LensCalFrame::OnSaveProject(), MainFrame::OnSaveProjectAs(), PerspectivePanel::OnSavePTO(), SaveLensParametersToIni(), and LensCalFrame::SaveLensToIni().

◆ calcCircleROIFromPoints()

template<class POINT >
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 229 of file hugin_math.h.

References roundi(), and threshold().

◆ ceili()

int hugin_utils::ceili ( double  x)
inline

Definition at line 60 of file hugin_math.h.

References threshold().

Referenced by HuginBase::estimateImageAlpha().

◆ CheckInterpolator()

IMPEX bool hugin_utils::CheckInterpolator ( int  value)

◆ ControlPointErrorColour()

IMPEX void hugin_utils::ControlPointErrorColour ( const double  cperr,
double r,
double g,
double b 
)

◆ CreateContext()

bool hugin_utils::CreateContext ( int argcp,
char **  argv 
)

◆ DestroyContext()

void hugin_utils::DestroyContext ( )

◆ doubleToString()

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 threshold().

Referenced by doubleTowxString(), GLPreviewFrame::panoramaChanged(), PreviewFrame::panoramaChanged(), HuginBase::SrcPanoImage::readEXIF(), HuginBase::Nona::SetAdvancedOption(), and PanoPanel::UpdateDisplay().

◆ doubleTowxString()

WXIMPEX wxString hugin_utils::doubleTowxString ( double  d,
int  digits 
)

◆ eig_jacobi()

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

  • on output actual number of sweeps epsilon - on input tolerance to consider offdiagonal elements as zero
  • on output sum of offdiagonal elements

Definition at line 68 of file eig_jacobi.cpp.

References sortd(), and threshold().

Referenced by HuginBase::StraightenPanorama::calcStraighteningRotation().

◆ EnforceExtension()

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(), stripExtension(), and threshold().

Referenced by main().

◆ escapeStringMake()

template<class str >
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(), and threshold().

◆ euclid_dist()

double hugin_utils::euclid_dist ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2 
)

calculate squared Euclidean distance between two vectors.

Definition at line 195 of file hugin_math.h.

References threshold().

◆ FileExists()

IMPEX bool hugin_utils::FileExists ( const std::string &  filename)

◆ floori()

int hugin_utils::floori ( double  x)
inline

◆ gcd()

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(), and threshold().

Referenced by PanoPanel::UpdateDisplay(), and GLPreviewFrame::UpdateRoiDisplay().

◆ GetAbsoluteFilename()

IMPEX std::string hugin_utils::GetAbsoluteFilename ( const std::string &  filename)

returns the full absolute filename

@TODO replace realpath with function with works without this hack

Definition at line 368 of file utils.cpp.

References FileExists(), and threshold().

Referenced by CreateMissingImages(), main(), PTOCopyMove(), and ReadPanoramaOptionsFromIni().

◆ GetCurrentTimeString()

IMPEX std::string hugin_utils::GetCurrentTimeString ( )

current time as a string

Definition at line 91 of file utils.cpp.

◆ GetDataDir()

IMPEX std::string hugin_utils::GetDataDir ( )

◆ getExtension()

IMPEX std::string hugin_utils::getExtension ( const std::string &  basename2)

◆ GetFormattedTimeSpan()

WXIMPEX wxString hugin_utils::GetFormattedTimeSpan ( const wxTimeSpan timeSpan)

Definition at line 29 of file wxutils.cpp.

References threshold().

Referenced by BrowsePTOFilesDialog::FillPanoInfo(), and PossiblePano::GetDuration().

◆ GetHomeDir()

std::string hugin_utils::GetHomeDir ( )

Definition at line 477 of file utils.cpp.

References threshold().

Referenced by GetUserAppDataDir().

◆ GetHuginVersion()

IMPEX std::string hugin_utils::GetHuginVersion ( )

◆ GetICCDesc() [1/2]

IMPEX std::string hugin_utils::GetICCDesc ( const cmsHPROFILE profile)

Definition at line 930 of file utils.cpp.

References StrTrim(), and threshold().

◆ GetICCDesc() [2/2]

IMPEX std::string hugin_utils::GetICCDesc ( const vigra::ImageImportInfo::ICCProfile &  iccProfile)

returns description of given icc profile

Definition at line 912 of file utils.cpp.

References GetICCDesc(), and threshold().

Referenced by GetICCDesc(), PrintImageInfo(), PanoCommand::wxAddImagesCmd::processPanorama(), and PanoCommand::wxLoadPTProjectCmd::processPanorama().

◆ GetMessageDialog()

WXIMPEX MessageDialog hugin_utils::GetMessageDialog ( const wxString message,
const wxString caption,
int  style,
wxWindow *  parent 
)

◆ GetOutputFilename()

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(), and threshold().

Referenced by main().

◆ getPathPrefix()

IMPEX std::string hugin_utils::getPathPrefix ( const std::string &  filename)

◆ GetRawExtensions()

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 964 of file utils.cpp.

References threshold().

Referenced by GetFileDialogImageAndRawFilters(), IsRawExtension(), and IsRawExtension().

◆ GetUserAppDataDir()

IMPEX std::string hugin_utils::GetUserAppDataDir ( )

◆ HuginMessageBox()

WXIMPEX int hugin_utils::HuginMessageBox ( const wxString message,
const wxString caption,
int  style,
wxWindow *  parent 
)

Definition at line 176 of file wxutils.cpp.

References threshold().

Referenced by LensCalFrame::AddImages(), ImageVariableDialog::ApplyNewVariables(), OptimizePanel::AskApplyResult(), AskUserOverwrite(), BatchFrame::BatchFrame(), HDRMergeOptionsDialog::BuildCommandLineArgument(), RawImport::CheckExe(), PanoPanel::CheckGoodSize(), PanoPanel::CheckHasImages(), CheckInputs(), CheckLensStacks(), Batch::ClearBatch(), CPMessage(), RunStitchPanel::DetectProject(), GenerateSequenceDialog::DoGeneratePanorama(), PanoPanel::DoSendToBatch(), PanoPanel::DoStitch(), PanoPanel::DoUserDefinedStitch(), CPEditorPanel::estimateAndAddOtherPoint(), GetDataPath(), EnfusePanel::GetEnfuseCommandLine(), PanoOperation::AddImagesSeriesOperation::GetInternalCommand(), PanoOperation::ChangeLensOperation::GetInternalCommand(), PanoOperation::LoadLensOperation::GetInternalCommand(), PanoOperation::RemoveControlPointsOperation::GetInternalCommand(), PanoOperation::CleanControlPointsOperation::GetInternalCommand(), PanoOperation::CelesteOperation::GetInternalCommand(), PanoOperation::ChangeStackOperation::GetInternalCommand(), PerspectivePanel::GetPanorama(), ProjectListBox::GetProjectId(), StackerPanel::GetStackerCommandLine(), Batch::GetStatus(), MainFrame::GetSVMModel(), Papywizard::ImportPapywizardFile(), Batch::LoadBatchFile(), LoadLensParametersChoose(), MainFrame::LoadProjectFile(), CPEditorPanel::NewPointChange(), RunStitchFrame::OnAbout(), EditOutputIniDialog::OnAddSection(), BatchFrame::OnButtonChangePrefix(), FindPanoDialog::OnButtonClose(), BatchFrame::OnButtonGenerateSequence(), BatchFrame::OnButtonOpenWithHugin(), BatchFrame::OnButtonRemoveComplete(), BatchFrame::OnButtonRemoveFromList(), BatchFrame::OnButtonReset(), BatchFrame::OnButtonResetAll(), FindPanoDialog::OnButtonSend(), FindPanoDialog::OnButtonStart(), CPEditorPanel::OnCelesteButton(), CPEditorPanel::OnCleanCPButton(), PreferencesDialog::OnCPDetectorDelete(), PreferencesDialog::OnCPDetectorEdit(), GLPreviewFrame::OnCreateCP(), EnfusePanel::OnCreateFile(), HFOVDialog::OnCropFactorChanged(), GLPreviewFrame::OnDragChoice(), ImagesTreeCtrl::OnEndEdit(), PreferencesDialog::OnExifArgfile2Edit(), PreferencesDialog::OnExifArgfileEdit(), LensCalFrame::OnFindLines(), MainFrame::OnFineTuneAll(), HFOVDialog::OnFocalLengthChanged(), ImagesPanel::OnFocalLengthChanged(), HFOVDialog::OnHFOVChanged(), GLPreviewFrame::OnHideProjectionHints(), stitchApp::OnInit(), LensCalApp::OnInit(), huginApp::OnInit(), PTBatcherGUI::OnInit(), ToolboxApp::OnInit(), MainFrame::OnLoadingFailed(), MainFrame::OnLoadProject(), MaskEditorPanel::OnMaskLoad(), ImagesPanel::OnMaxEvDiffChanged(), MainFrame::OnMergeProject(), ImagesPanel::OnMinimumOverlapChanged(), MainFrame::OnMRUFiles(), GLPreviewFrame::OnNumTransform(), HFOVDialog::OnOk(), SaveLensDBDialog::OnOk(), CPDetectorDialog::OnOk(), RawImportDialog::OnOk(), ChangeUserDefinedSequenceDialog::OnOk(), CreateBrightImgDlg::OnOk(), SelectDirectoryFileDialog::OnOk(), MainFrame::OnOpenPTBatcher(), LensCalFrame::OnOptimize(), OptimizePanel::OnOptimizeButton(), OptimizePhotometricPanel::OnOptimizeButton(), RawImportProgress::OnProcessReferenceTerminate(), LensCalFrame::OnRefresh(), MainFrame::OnRemoveCPinMasks(), EditOutputIniDialog::OnRenameSection(), PreferencesDialog::OnRestoreDefaults(), ImageVariablesExpressionDialog::OnSave(), LensCalFrame::OnSaveLens(), LensCalFrame::OnSaveProject(), MainFrame::OnSaveProject(), EnfusePanel::OnSaveSetting(), MainFrame::OnSendToAssistantQueue(), MainFrame::OnSetGuiAdvanced(), MainFrame::OnSetGuiSimple(), LensCalFrame::OnShowDistortionGraph(), RTRawImport::ProcessAdditionalParameters(), PanoCommand::wxAddImagesCmd::processPanorama(), PanoCommand::wxLoadPTProjectCmd::processPanorama(), PanoCommand::wxApplyTemplateCmd::processPanorama(), PTPrintErrorWX(), PerspectivePanel::ReadInputs(), Batch::RemoveProject(), Batch::RemoveProjectAtIndex(), MainFrame::RunAssistant(), ImagesPanel::RunCPGenerator(), OptimizePhotometricPanel::runOptimizer(), OptimizePanel::runOptimizer(), SaveLensParameters(), Batch::SetStatus(), GLViewer::SetUpContext(), RunStitchPanel::StitchProject(), str2double(), GLPreviewFrame::UpdateOverviewMode(), PreviewPanel::updatePreview(), and EditOutputIniDialog::WriteIni().

◆ initGPU()

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.

Returns
true if everything went OK, false if we can't use GPU mode.

Definition at line 845 of file utils.cpp.

References CreateContext(), DestroyContext(), stripPath(), and threshold().

Referenced by main().

◆ IsFileTypeSupported()

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(), threshold(), and tolower().

Referenced by main().

◆ IsLinearICCProfile()

IMPEX bool hugin_utils::IsLinearICCProfile ( const vigra::ImageImportInfo::ICCProfile &  iccProfile)

return true if icc profile is linear one, otherwise return false

Definition at line 940 of file utils.cpp.

References threshold().

Referenced by main(), and PanoCommand::wxAddImagesCmd::processPanorama().

◆ IsRawExtension()

IMPEX bool hugin_utils::IsRawExtension ( const std::string  testExt)

return true if extension belongs to a raw file

Definition at line 970 of file utils.cpp.

References GetRawExtensions(), threshold(), and tolower().

Referenced by main().

◆ norm()

template<class T >
double hugin_utils::norm ( t)

◆ quoteFilename()

template<class str >
str hugin_utils::quoteFilename ( const str arg)

Quote a filename, so that it is surrounded by "".

@BUG I don't know the escape char for windows

Definition at line 158 of file platform.h.

References quoteStringInternal(), and threshold().

Referenced by AutoPanoSift::automatch(), and AutoPanoKolor::automatch().

◆ quoteString()

template<class str >
str hugin_utils::quoteString ( const str arg)

Try to escape special chars on windows and linux.

@BUG: 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(), and threshold().

◆ quoteStringInternal()

template<class str >
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.

References threshold().

Referenced by escapeStringMake(), quoteFilename(), quoteString(), and quoteStringShell().

◆ QuoteStringInternal()

template<class str >
str hugin_utils::QuoteStringInternal ( const str arg,
const str quotechar,
const str replacements 
)

Definition at line 183 of file utils.h.

References threshold().

◆ quoteStringShell()

template<class str >
str hugin_utils::quoteStringShell ( const str arg)

Try to escape special chars in a string used by a unix type shell.

@BUG: 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(), and threshold().

◆ ReplaceAll()

IMPEX void hugin_utils::ReplaceAll ( std::string &  s,
const std::string &  oldChar,
char  newChar 
)

replace all characters oldChar in s with newChar

Definition at line 325 of file utils.cpp.

References threshold().

◆ RestoreFramePosition()

WXIMPEX void hugin_utils::RestoreFramePosition ( wxTopLevelWindow frame,
const wxString basename,
const bool  ignoreMaximize 
)

◆ RestoreFramePositionOnly()

WXIMPEX void hugin_utils::RestoreFramePositionOnly ( wxTopLevelWindow frame,
const wxString basename 
)

◆ round()

double hugin_utils::round ( double  x)
inline

◆ roundf()

float hugin_utils::roundf ( float  x)
inline

Definition at line 55 of file hugin_math.h.

References threshold().

◆ roundi()

template<class T >
int hugin_utils::roundi ( x)
inline

Definition at line 73 of file hugin_math.h.

References threshold().

Referenced by HuginLines::_getFilteredLines(), 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(), PerspectivePanel::GetPanorama(), HuginBase::CalculateOptimalScale::getResultOptimalWidth(), GreatCircleArc::GreatCircleArc(), loadPoints(), loadPointsC(), main(), PanoDetector::matchMultiRow(), GLViewer::MouseEnter(), GLViewer::MouseMotion(), CPEditorPanel::OnCPEvent(), GLPreviewFrame::OnCreateCP(), MainFrame::OnFineTuneAll(), GLPreviewFrame::OnFitPano(), PreviewFrame::OnFitPano(), LensCalImageCtrl::OnMouseEvent(), PanoOutputDialog::OnOk(), CPImageCtrl::OnPaint(), RawImportProgress::OnProcessReferenceTerminate(), MyExecPanel::OnProcessTerminated(), RawImportProgress::OnProgress(), PanoOutputDialog::PanoOutputDialog(), GLPreviewFrame::panoramaChanged(), PreviewFrame::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().

◆ simpleClipPoint()

template<class T >
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 170 of file hugin_math.h.

Referenced by vigra_ext::PointFineTune(), and VisualizationState::SetViewingCenter().

◆ sortd()

void hugin_utils::sortd ( int  length,
double a,
int ind 
)

Definition at line 24 of file eig_jacobi.cpp.

References threshold().

Referenced by eig_jacobi().

◆ SplitString()

IMPEX std::vector< std::string > hugin_utils::SplitString ( const std::string &  s,
const std::string &  sep 
)

◆ sqr()

template<class T >
T hugin_utils::sqr ( t)

◆ sqr_dist()

T hugin_utils::sqr_dist ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
res 
)

calculate squared Euclidean distance between two vectors.

Definition at line 212 of file hugin_math.h.

References threshold().

◆ StoreFramePosition()

WXIMPEX void hugin_utils::StoreFramePosition ( wxTopLevelWindow frame,
const wxString basename,
const bool  ignoreMaximize 
)

◆ StoreFramePositionOnly()

WXIMPEX void hugin_utils::StoreFramePositionOnly ( wxTopLevelWindow frame,
const wxString basename 
)

◆ str2double()

WXIMPEX bool hugin_utils::str2double ( const wxString s,
double d 
)

◆ StringContainsCaseInsensitive()

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 threshold().

Referenced by HuginBase::SrcPanoImage::readEXIF().

◆ stringToDouble()

template<typename STR >
bool hugin_utils::stringToDouble ( const STR str_,
double dest 
)

◆ stringToInt()

IMPEX bool hugin_utils::stringToInt ( const std::string &  s,
int val 
)

◆ 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(), and threshold().

Referenced by HuginBase::PanoramaMemento::loadPTScript(), main(), and SetCrop().

◆ stripExtension()

IMPEX std::string hugin_utils::stripExtension ( const std::string &  basename2)

◆ stripPath()

IMPEX std::string hugin_utils::stripPath ( const std::string &  filename)

◆ StrTrim()

IMPEX std::string hugin_utils::StrTrim ( const std::string &  str)

◆ tolower()

std::string hugin_utils::tolower ( const std::string &  s)
inline

◆ toupper()

std::string hugin_utils::toupper ( const std::string &  s)
inline

◆ wrapupGPU()

IMPEX bool hugin_utils::wrapupGPU ( )

cleanup GPU settings

Definition at line 901 of file utils.cpp.

References DestroyContext().

Referenced by main().

◆ wxQuoteFilename()

template<class str >
str hugin_utils::wxQuoteFilename ( const str arg)

◆ wxQuoteString()

template<class str >
str hugin_utils::wxQuoteString ( const str arg)

Try to escape special chars on windows and linux.

@BUG: 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 threshold(), and wxQuoteStringInternal().

Referenced by PanoPanel::DoSendToBatch().

◆ wxQuoteStringInternal()

template<class str >
str hugin_utils::wxQuoteStringInternal ( const str arg,
const str quotechar,
const str replacements 
)

Definition at line 36 of file wxPlatform.h.

References threshold().

Referenced by HuginQueue::wxEscapeFilename(), wxQuoteFilename(), and wxQuoteString().

Variable Documentation

◆ context

ContextSettings hugin_utils::context
static

Definition at line 774 of file utils.cpp.

Referenced by CreateContext(), and DestroyContext().