27#include "hugin_config.h"
29#include "wx/listbook.h"
30#include <wx/stdpaths.h>
49#define MY_STR_VAL(id, val) { XRCCTRL(*this, id, wxTextCtrl)->SetValue(val); };
50#define MY_SPIN_VAL(id, val) { XRCCTRL(*this, id, wxSpinCtrl)->SetValue(val); };
51#define MY_BOOL_VAL(id, val) { XRCCTRL(*this, id, wxCheckBox)->SetValue(val); };
52#define MY_CHOICE_VAL(id, val) { XRCCTRL(*this, id, wxChoice)->SetSelection(val); };
53#define MY_SELECTED_CHOICE_VAL(id, val) { SelectListValue( XRCCTRL(*this, id, wxChoice), val); }
54#define MY_STATIC_VAL(id, val) { XRCCTRL(*this, id, wxStaticText)->SetLabel(val); };
56#define MY_G_STR_VAL(id) XRCCTRL(*this, id, wxTextCtrl)->GetValue()
57#define MY_G_SPIN_VAL(id) XRCCTRL(*this, id, wxSpinCtrl)->GetValue()
58#define MY_G_BOOL_VAL(id) XRCCTRL(*this, id, wxCheckBox)->GetValue()
59#define MY_G_CHOICE_VAL(id) XRCCTRL(*this, id, wxChoice)->GetSelection()
60#define MY_G_SELECTED_CHOICE_VAL(id) (long)GetSelectedValue(XRCCTRL(*this, id, wxChoice))
68 wxXmlResource::Get()->LoadDialog(
this,
parent,
"pref_dialog");
166 XRCCTRL(*
this,
"pref_raw_dcraw_exe", wxTextCtrl)->AutoCompleteFileNames();
167 XRCCTRL(*
this,
"pref_raw_rt_exe", wxTextCtrl)->AutoCompleteFileNames();
168 XRCCTRL(*
this,
"pref_raw_darktable_exe", wxTextCtrl)->AutoCompleteFileNames();
178 XRCCTRL(*
this,
"prefs_misc_tempdir", wxTextCtrl)->AutoCompleteDirectories();
179 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->AutoCompleteFileNames();
180 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->AutoCompleteFileNames();
181 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->AutoCompleteFileNames();
182 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->AutoCompleteFileNames();
228#if defined __WXMSW__ || defined MAC_SELF_CONTAINED_BUNDLE
258 delete static_cast<long*
>(
lang_choice->GetClientData(
i));
285 _(
"Executables (*.exe)|*.exe"),
292 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->SetValue(
302 _(
"Executables (*.exe)|*.exe"),
309 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->SetValue(
316 wxTextCtrl*
ctrl =
XRCCTRL(*
this,
"pref_raw_dcraw_exe", wxTextCtrl);
319 _(
"Executables (*.exe)|*.exe"),
332 wxTextCtrl*
ctrl =
XRCCTRL(*
this,
"pref_raw_rt_exe", wxTextCtrl);
335 _(
"Executables (*.exe)|*.exe"),
348 wxTextCtrl*
ctrl =
XRCCTRL(*
this,
"pref_raw_darktable_exe", wxTextCtrl);
351 _(
"Executables (*.exe)|*.exe"),
365 XRCCTRL(*
this,
"prefs_enblend_EnblendExe", wxTextCtrl)->Enable(e.IsChecked());
366 XRCCTRL(*
this,
"prefs_enblend_select",
wxButton)->Enable(e.IsChecked());
371 XRCCTRL(*
this,
"prefs_enblend_EnfuseExe", wxTextCtrl)->Enable(e.IsChecked());
372 XRCCTRL(*
this,
"prefs_enblend_enfuse_select",
wxButton)->Enable(e.IsChecked());
379 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
383 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->SetValue(
408 wxString filename=
XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->GetValue();
409 if(!filename.empty())
415 if (
hugin_utils::HuginMessageBox(wxString::Format(
_(
"Argfile %s does not exist.\nShould the argfile be created with default tags?"), filename),
420 filename = file.GetFullPath();
425 filename = file.GetFullPath();
437 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
443 filename=
dlg.GetPath();
446 XRCCTRL(*
this,
"pref_exiftool_argfile", wxTextCtrl)->SetValue(filename);
448 wxXmlResource::Get()->LoadDialog(&
edit_dlg,
this,
"pref_edit_argfile");
467 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
471 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->SetValue(
478 wxString filename =
XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->GetValue();
479 if (!filename.empty())
490 filename = file.GetFullPath();
495 filename = file.GetFullPath();
507 _(
"ExifTool Argfiles (*.arg)|*.arg|All Files(*)|*"),
513 filename =
dlg.GetPath();
516 XRCCTRL(*
this,
"pref_exiftool_argfile2", wxTextCtrl)->SetValue(filename);
518 wxXmlResource::Get()->LoadDialog(&
edit_dlg,
this,
"pref_edit_argfile_placeholders");
552 XRCCTRL(*
this,
"prefs_ft_rot_panel", wxPanel)->Enable(
enable);
570 unsigned long mem_high =
cfg->Read(
"/ImageCache/UpperBoundHigh", (
long) 0);
621 t =
cfg->Read(
"CopyLogToClipboard", 0l) == 1;
627 t =
cfg->Read(
"/CPEditorPanel/AutoRot", 1l) == 1;
631 MY_STR_VAL(
"pref_raw_dcraw_exe",
cfg->Read(
"/RawImportDialog/dcrawExe",
""));
632 MY_STR_VAL(
"pref_raw_rt_exe",
cfg->Read(
"/RawImportDialog/RTExe",
""));
633 MY_STR_VAL(
"pref_raw_darktable_exe",
cfg->Read(
"/RawImportDialog/DarktableExe",
""));
644 filename.Replace(
"/",
"\\",
true);
646 MY_STR_VAL(
"prefs_project_filename", filename);
649 filename.Replace(
"/",
"\\",
true);
651 MY_STR_VAL(
"prefs_output_filename", filename);
659 t =
cfg->Read(
"/General/IgnoreFovRectilinearOnAdd", 1l) == 1l;
664 cfg->Read(
"/Assistant/panoDownsizeFactor", &factor);
665 MY_SPIN_VAL(
"prefs_ass_panoDownsizeFactor",(
int)(factor*100.0));
672 t =
cfg->Read(
"/Assistant/UserDefinedOutputOption", 0l) == 1;
674 wxCommandEvent
dummy;
685 int val = wxConfigBase::Get()->Read(
"/CPEditorPanel/MagnifierWidth", 61l);
687 val = std::min(val, 3);
688 XRCCTRL(*
this,
"prefs_misc_magnifier_width",
wxChoice)->SetSelection(val);
693 MY_SPIN_VAL(
"prefs_ft_SearchAreaPercent",
cfg->Read(
"/Finetune/SearchAreaPercent",
695 MY_SPIN_VAL(
"prefs_ft_LocalSearchWidth",
cfg->Read(
"/Finetune/LocalSearchWidth",
719 MY_SPIN_VAL(
"prefs_ft_RotationSteps",
cfg->Read(
"/Finetune/RotationSteps",
751 XRCCTRL(*
this,
"pref_internal_blender_seam",
wxChoice)->SetSelection(1);
755 XRCCTRL(*
this,
"pref_internal_blender_seam",
wxChoice)->SetSelection(0);
780 wxCommandEvent
dummy;
783 int nThreads =
cfg->Read(
"/output/NumberOfThreads", 0l);
800 MY_STR_VAL(
"prefs_enblend_EnblendExe",
cfg->Read(
"/Enblend/Exe",
807 MY_STR_VAL(
"prefs_enblend_EnblendArgs",
cfg->Read(
"/Enblend/Args",
811 MY_STR_VAL(
"prefs_enblend_EnfuseExe",
cfg->Read(
"/Enfuse/Exe",
818 MY_STR_VAL(
"prefs_enblend_EnfuseArgs",
cfg->Read(
"/Enfuse/Args",
833 t =
cfg->Read(
"/ShowSaveMessage", 1l) == 1;
835 t =
cfg->Read(
"/ShowExposureWarning", 1l) == 1;
837 t =
cfg->Read(
"/ShowFisheyeCropHint", 1l) == 1;
851 if (
noteb->GetSelection() == 0)
868 cfg->Write(
"CopyLogToClipboard", 0l);
871 cfg->Write(
"/CPEditorPanel/AutoRot", 1l);
873 cfg->Write(
"/RawImportDialog/dcrawExe",
"");
874 cfg->Write(
"/RawImportDialog/RTExe",
"");
875 cfg->Write(
"/RawImportDialog/DarktableExe",
"");
877 if(
noteb->GetSelection() == 1)
883 if (
noteb->GetSelection() == 2)
886 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", 1l);
892 cfg->Write(
"/Assistant/UserDefinedOutputOption", 0l);
894 if (
noteb->GetSelection() == 3)
899 cfg->Write(
"/CPEditorPanel/MagnifierWidth", 61l);
913 if (
noteb->GetSelection() == 4)
920 if (
noteb->GetSelection() == 5)
937 if (
noteb->GetSelection() == 6)
943 cfg->Write(
"/output/NumberOfThreads", 0l);
945 if (
noteb->GetSelection() == 7)
957 if (
noteb->GetSelection() == 8)
963 cfg->Write(
"/ShowSaveMessage", 1l);
964 cfg->Write(
"/ShowExposureWarning", 1l);
965 cfg->Write(
"/ShowFisheyeCropHint", 1l);
966 cfg->Write(
"/EditCPAfterAction", 0l);
986 cfg->Write(
"/General/IgnoreFovRectilinearOnAdd", !
MY_G_BOOL_VAL(
"prefs_ass_loadFovRectilinear"));
987 cfg->Write(
"/Assistant/nControlPoints",
MY_G_SPIN_VAL(
"prefs_ass_nControlPoints"));
988 cfg->Write(
"/Assistant/panoDownsizeFactor",
MY_G_SPIN_VAL(
"prefs_ass_panoDownsizeFactor") / 100.0);
992 cfg->Write(
"/Assistant/UserDefinedOutputOption",
MY_G_BOOL_VAL(
"pref_ass_output"));
997 cfg->Write(
"/CPEditorPanel/MagnifierWidth",
MY_G_CHOICE_VAL(
"prefs_misc_magnifier_width") * 20 + 61l);
1000 cfg->Write(
"/Finetune/SearchAreaPercent",
MY_G_SPIN_VAL(
"prefs_ft_SearchAreaPercent"));
1001 cfg->Write(
"/Finetune/TemplateSize",
MY_G_SPIN_VAL(
"prefs_ft_TemplateSize"));
1002 cfg->Write(
"/Finetune/LocalSearchWidth",
MY_G_SPIN_VAL(
"prefs_ft_LocalSearchWidth"));
1006 cfg->Write(
"/Finetune/CorrThreshold",
td);
1011 cfg->Write(
"/Finetune/CurvThreshold",
td);
1013 cfg->Write(
"/Finetune/RotationSearch",
MY_G_BOOL_VAL(
"prefs_ft_RotationSearch"));
1014 cfg->Write(
"/Finetune/RotationStartAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStartAngle"));
1015 cfg->Write(
"/Finetune/RotationStopAngle", (
double)
MY_G_SPIN_VAL(
"prefs_ft_RotationStopAngle"));
1016 cfg->Write(
"/Finetune/RotationSteps",
MY_G_SPIN_VAL(
"prefs_ft_RotationSteps"));
1023 cfg->Write(
"/ImageCache/UpperBoundHigh", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") >> 12);
1025 cfg->Write(
"/ImageCache/UpperBound", (
long)
MY_G_SPIN_VAL(
"prefs_cache_UpperBound") << 20);
1041 cfg->Write(
"/GLPreviewFrame/ShowProjectionHints",
MY_G_BOOL_VAL(
"pref_show_projection_hints"));
1045 cfg->Write(
"/RawImportDialog/dcrawExe",
MY_G_STR_VAL(
"pref_raw_dcraw_exe"));
1046 cfg->Write(
"/RawImportDialog/RTExe",
MY_G_STR_VAL(
"pref_raw_rt_exe"));
1047 cfg->Write(
"/RawImportDialog/DarktableExe",
MY_G_STR_VAL(
"pref_raw_darktable_exe"));;
1051 wxString filename=
XRCCTRL(*
this,
"prefs_project_filename", wxTextCtrl)->GetValue();
1053 filename.Replace(
"\\",
"/",
true);
1055 cfg->Write(
"ProjectFilename", filename);
1056 filename=
XRCCTRL(*
this,
"prefs_output_filename", wxTextCtrl)->GetValue();
1058 filename.Replace(
"\\",
"/",
true);
1060 cfg->Write(
"OutputFilename", filename);
1074 if (
XRCCTRL(*
this,
"pref_internal_blender_seam",
wxChoice)->GetSelection() == 1)
1076 cfg->Write(
"/VerdandiDefaultArgs",
"--seam=blend");
1087 cfg->Write(
"/Processor/overwrite",
MY_G_BOOL_VAL(
"pref_processor_overwrite"));
1090 cfg->Write(
"/output/useExiftool",
MY_G_BOOL_VAL(
"pref_exiftool_metadata"));
1091 cfg->Write(
"/output/CopyArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile"));
1092 cfg->Write(
"/output/FinalArgfile",
MY_G_STR_VAL(
"pref_exiftool_argfile2"));
1094 cfg->Write(
"/output/NumberOfThreads",
MY_G_SPIN_VAL(
"prefs_output_NumberOfThreads"));
1098 cfg->Write(
"/Nona/CroppedImages",
MY_G_BOOL_VAL(
"prefs_nona_createCroppedImages"));
1105 cfg->Write(
"/Enblend/Args",
MY_G_STR_VAL(
"prefs_enblend_EnblendArgs"));
1115 cfg->Write(
"/Celeste/Threshold",
td);
1118 cfg->Write(
"/OptimizePhotometric/nRandomPointsPerImage",
MY_G_SPIN_VAL(
"prefs_photo_optimizer_nr_points"));
1120 cfg->Write(
"/ShowExposureWarning",
MY_G_BOOL_VAL(
"prefs_warning_exposure"));
1121 cfg->Write(
"/ShowFisheyeCropHint",
MY_G_BOOL_VAL(
"prefs_warning_fisheye_crop"));
1227 wxConfig::Get()->Write(
"/actualPath",
dlg.GetDirectory());
1242 wxConfig::Get()->Write(
"/actualPath",
dlg.GetDirectory());
1247 if(
fn.Right(8)!=
".setting")
1249 fn.Append(
".setting");
1268 XRCCTRL(*
this,
"pref_tiff_compression",
wxChoice)->GetParent()->Layout();
declaration of CPDetectorDialog class, which are for storing and changing settings of different autop...
wxString GetDataPath()
return path to data directory, it depends on operating system
Definition of dialog for editing user-defined output ini file.
#define MY_CHOICE_VAL(id, val)
#define MY_G_CHOICE_VAL(id)
#define MY_G_SPIN_VAL(id)
#define MY_STR_VAL(id, val)
#define MY_BOOL_VAL(id, val)
#define MY_G_SELECTED_CHOICE_VAL(id)
#define MY_G_BOOL_VAL(id)
#define MY_SELECTED_CHOICE_VAL(id, val)
#define MY_SPIN_VAL(id, val)
void CreateNewArgFile(const wxString &newFilename, const wxString &sourceFile)
unsigned int GetCount()
return counts of cp detector settings
void FillControl(wxControlWithItems *control, bool select_default=false, bool show_default=false)
fills a wxControlWithItems with the available generators
unsigned int GetDefaultGenerator()
return index of default generator (this one is used for assistent)
void Read(wxConfigBase *config=wxConfigBase::Get(), wxString loadFromFile=wxEmptyString)
read the settings of different cp generators from config
void ReadFromFile(wxString filename)
import the cp detector settings from external file
void Write(wxConfigBase *config=wxConfigBase::Get())
writes the settings of different cp generators to config
ArraySettings settings
array which stores the different autopano settings
void SetDefaultGenerator(unsigned int new_default_generator)
sets new default generator, which is used by assistent
void WriteToFile(wxString filename)
exporth the cp detector settings to external file
void Swap(int index)
swaps setting which index and index+1
dialog for input settings of one autopano generator
class, which stores all settings of one cp detector
Dialog for editing user defined output settings (ini file)
static MainFrame * Get()
hack.. kind of a pseudo singleton...
void DisplayHelp(wxString section=wxEmptyString)
call help browser with given file
void OnExifArgfile2Edit(wxCommandEvent &e)
void UpdateFileFormatControls()
void OnUpdateOutputFilename(wxCommandEvent &e)
event handler to update preview for project filename
virtual ~PreferencesDialog()
dtor.
void OnExifTool(wxCommandEvent &e)
void OnBlenderChanged(wxCommandEvent &e)
event handler if blender was changed
void OnExifArgfileEdit(wxCommandEvent &e)
void OnHelp(wxCommandEvent &e)
void OnRotationCheckBox(wxCommandEvent &e)
void OnDcrawExe(wxCommandEvent &e)
void OnEnfuseExe(wxCommandEvent &e)
void OnChangeUserDefinedOutputOptions(wxCommandEvent &e)
void OnProcessorChanged(wxCommandEvent &e)
event handler if processor was changed
void OnFileFormatChanged(wxCommandEvent &e)
event handler if default file format was changed
void OnCPDetectorSave(wxCommandEvent &e)
event handler for saving cp detector settings
void EnableRotationCtrls(bool enable)
void OnCPDetectorEdit(wxCommandEvent &e)
PreferencesDialog(wxWindow *parent)
ctor.
void UpdateBlenderControls()
void UpdateDisplayData(int panel)
Config to Window.
void OnCPDetectorAdd(wxCommandEvent &e)
void OnUpdateProjectFilename(wxCommandEvent &e)
event handler to update preview for project filename
void OnExifArgfile2Choose(wxCommandEvent &e)
void UpdateProcessorControls()
void OnCustomEnblend(wxCommandEvent &e)
void OnEnblendExe(wxCommandEvent &e)
void OnCPDetectorMoveUp(wxCommandEvent &e)
void OnExifArgfileChoose(wxCommandEvent &e)
void OnCPDetectorLoad(wxCommandEvent &e)
event handler for loading cp detector settings
void OnCPDetectorMoveDown(wxCommandEvent &e)
void OnCPDetectorDefault(wxCommandEvent &e)
void OnRawTherapeeExe(wxCommandEvent &e)
void OnOk(wxCommandEvent &e)
CPDetectorConfig cpdetector_config_edit
void OnCPDetectorDelete(wxCommandEvent &e)
wxListBox * m_CPDetectorList
void OnRestoreDefaults(wxCommandEvent &e)
void UpdateConfigData()
Window to Config.
void OnUserDefinedOutputOptionsCheckBox(wxCommandEvent &e)
void OnCustomEnfuse(wxCommandEvent &e)
void OnDarktableExe(wxCommandEvent &e)
static huginApp * Get()
hack.. kind of a pseudo singleton...
#define HUGIN_FT_TEMPLATE_SIZE
#define HUGIN_FT_ROTATION_START_ANGLE
#define HUGIN_PROCESSOR_VERBOSE
#define HUGIN_USE_EXIFTOOL
#define HUGIN_PROCESSOR_GUI
#define HUGIN_DEFAULT_OUTPUT_NAME
#define HUGIN_JPEG_QUALITY
#define HUGIN_IMGCACHE_UPPERBOUND
#define HUGIN_ENBLEND_ARGS
#define HUGIN_FT_ROTATION_STEPS
#define HUGIN_PROCESSOR_START
#define HUGIN_EXIFTOOL_CREATE_GPANO
#define HUGIN_NONA_USEGPU
#define HUGIN_NONA_CROPPEDIMAGES
#define HUGIN_FT_ROTATION_SEARCH
#define HUGIN_ENBLEND_EXE_CUSTOM
#define HUGIN_TIFF_COMPRESSION
#define HUGIN_DEFAULT_PROJECT_NAME
#define HUGIN_FT_CURV_THRESHOLD
#define HUGIN_FT_LOCAL_SEARCH_WIDTH
#define HUGIN_ENFUSE_ARGS
#define HUGIN_CELESTE_FILTER
#define HUGIN_DEFAULT_BLENDER
#define HUGIN_ENBLEND_EXE
#define HUGIN_ASS_AUTO_ALIGN
#define HUGIN_ASS_LINEFIND
#define HUGIN_ASS_PANO_DOWNSIZE_FACTOR
#define HUGIN_ASS_AUTO_CPCLEAN
#define HUGIN_FT_ROTATION_STOP_ANGLE
#define HUGIN_NONA_INTERPOLATOR
#define HUGIN_ENFUSE_EXE_CUSTOM
#define HUGIN_PROCESSOR_OVERWRITE
#define HUGIN_LDR_OUTPUT_FORMAT
#define HUGIN_ASS_NCONTROLPOINTS
#define HUGIN_PHOTOMETRIC_OPTIMIZER_NRPOINTS
#define HUGIN_CELESTE_AUTO
#define HUGIN_CELESTE_THRESHOLD
#define HUGIN_SHOW_PROJECTION_HINTS
#define HUGIN_FT_SEARCH_AREA_PERCENT
#define HUGIN_IMGCACHE_MAPPING_FLOAT
#define HUGIN_FT_CORR_THRESHOLD
wxString getDefaultOutputName(const wxString projectname, const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default output prefix, based on filename and images in project the setting is read from the ...
wxString getDefaultProjectName(const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default project name, as defined in the preferences
functions for interaction with the hugin configuration file
wxString doubleTowxString(double d, int digits)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
bool stringToDouble(const STR &str_, double &dest)
convert a string to a double, ignore localisation.
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
include file for the hugin project
include file for the hugin project
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.