29#if defined __WXMSW__ || defined UNIX_SELF_CONTAINED_BUNDLE
30#include <wx/stdpaths.h>
36#if defined USE_GDKBACKEND_X11
40#warning Using Hugin with hard coded GDK_BACKEND=x11
47 char backend[]=
"GDK_BACKEND=x11";
57#if wxUSE_ON_FATAL_EXCEPTION
62#if defined __WXMSW__ && wxCHECK_VERSION(3,3,0)
91#elif defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
106#elif defined UNIX_SELF_CONTAINED_BUNDLE
132 if ( ! wxFile::Exists(
m_xrcPrefix +
"/batch_frame.xrc") )
141 wxXmlResource::Get()->InitAllHandlers();
144 wxXmlResource::Get()->Load(
m_xrcPrefix +
"batch_frame.xrc");
145 wxXmlResource::Get()->Load(
m_xrcPrefix +
"batch_toolbar.xrc");
146 wxXmlResource::Get()->Load(
m_xrcPrefix +
"batch_menu.xrc");
147 wxXmlResource::Get()->Load(
m_xrcPrefix +
"lensdb_dialogs.xrc");
148 wxXmlResource::Get()->Load(
m_xrcPrefix +
"dlg_warning.xrc");
159 {
wxCMD_LINE_SWITCH,
"o",
"overwrite",
"overwrite previous files without asking" },
160 {
wxCMD_LINE_SWITCH,
"s",
"shutdown",
"shutdown computer after batch is complete" },
161 {
wxCMD_LINE_SWITCH,
"v",
"verbose",
"show verbose output when processing projects" },
162 {
wxCMD_LINE_SWITCH,
"a",
"assistant",
"run the assistant on the given projects" },
163 {
wxCMD_LINE_OPTION,
"u",
"user-defined",
"use the given user defined sequence" },
180 wxLogError(
_(
"Syntax error in parameters detected, aborting."));
191 servername=wxFileName::GetTempDir()+wxFileName::GetPathSeparator()+name+
".ipc";
204#if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
214 wxLogError(wxString::Format(
"Could not find help directory in the bundle",
strFile.c_str()));
253 while (
parser.GetParamCount() > count)
259 if (name.FileExists())
262 if (name.GetExt().CmpNoCase(
"pto") == 0)
270 conn->Request(
"D " + name.GetFullPath());
286 while (
parser.GetParamCount() > count)
300 conn->Request(
"A " + name.GetFullPath());
320 conn->Request(
"P " +
fn.GetFullPath());
328 if (
ext.CmpNoCase(
"jpg") == 0 ||
ext.CmpNoCase(
"jpeg") == 0 ||
329 ext.CmpNoCase(
"tif") == 0 ||
ext.CmpNoCase(
"tiff") == 0 ||
330 ext.CmpNoCase(
"png") == 0 ||
ext.CmpNoCase(
"exr") == 0 ||
331 ext.CmpNoCase(
"pnm") == 0 ||
ext.CmpNoCase(
"hdr") == 0)
340 conn->Request(
"P " +
fn.GetFullPath());
353 conn->Request(
"A " +
fn.GetFullPath());
371 config->DeleteEntry(
"/BatchFrame/ShutdownCheck");
372#if !defined __WXMAC__ && !defined __WXOSX_COCOA__
379 config->Write(
"/BatchFrame/OverwriteCheck", 1l);
383 config->Write(
"/BatchFrame/VerboseCheck", 1l);
391#if !defined __WXMAC__ && !defined __WXOSX_COCOA__
393 conn->Request(
"SetShutdownCheck");
398 conn->Request(
"SetOverwriteCheck");
402 conn->Request(
"SetVerboseCheck");
404 conn->Request(
"BringWindowToTop");
407 conn->Request(
"RunBatch");
447 delete wxHelpProvider::Set(
NULL);
451#if wxUSE_ON_FATAL_EXCEPTION
452void PTBatcherGUI::OnFatalException()
477 if(
item.Left(1)==
"A")
482 if(
item.Left(1)==
"D")
487 if(
item.Left(1)==
"P")
492 if (
item.Left(1) ==
"U")
497 wxCommandEvent
event;
499#if !defined __WXMAC__ && !defined __WXOSX_COCOA__
501 if(
item==
"SetShutdownCheck")
510 if(
item==
"SetOverwriteCheck")
516 if(
item==
"SetVerboseCheck")
522 if(
item==
"BringWindowToTop")
class to access Hugins camera and lens database
int main(int argc, char *argv[])
wxIMPLEMENT_APP(PTBatcherGUI)
Batch processor for Hugin with GUI.
const wxString IPC_START("BatchStart")
topic name for BatchIPCConnection and BatchIPCServer
void SetInternalVerbose(bool newVerbose)
sets the current verbose status, does not update the checkbox
wxHelpController & GetHelpController()
return help controller for open help
bool IsStartedMinimized()
returns true, if last session was finished minimized
void ChangePrefix(int index, wxString newPrefix)
void AddToList(wxString aFile, Project::Target target=Project::STITCHING, wxString userDefined=wxEmptyString)
class for communication between different PTBatcherGUI instances
virtual const void * OnRequest(const wxString &topic, const wxString &item, size_t *size=NULL, wxIPCFormat format=wxIPC_TEXT)
request handler for transfer
server which implements the communication between different PTBatcherGUI instances (see BatchIPCConne...
virtual wxConnectionBase * OnAcceptConnection(const wxString &topic)
accept connection handler (establish the connection)
static void Clean()
cleanup the static LensDB instance, must be called at the end of the program
The application class for hugin_stitch_project.
BatchIPCServer * m_server
wxSingleInstanceChecker * m_checker
bool OnInit() override
pseudo constructor.
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
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.