Hugin trunk 0.1
Loading...
Searching...
No Matches
StackerPanel.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
10/* This is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
14 *
15 * This software is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public
21 * License along with this software. If not, see
22 * <http://www.gnu.org/licenses/>.
23 *
24 */
25
26#ifndef STACKERANEL_H
27#define STACKERANEL_H
28
29#include "panoinc_WX.h"
30#include "huginapp/ImageCache.h"
31#include "PreviewWindow.h"
32#include <vector>
34
38class StackerPanel : public wxPanel
39{
40public:
41 struct FileInfo
42 {
43 public:
44 FileInfo(const wxString& file, const wxString& new_name, const wxString& new_path, const size_t& new_width, const size_t& new_height)
45 {
46 fullFilename = file;
47 name = new_name;
48 path = new_path;
51 isChecked = true;
52 };
54 size_t width, height;
56 };
57 typedef std::vector<FileInfo> FileInfoVector;
61 bool Create(wxWindow* parent, MyExecPanel* logPanel);
63 void AddFile(const wxString& filename);
65 void OnProcessFinished(wxCommandEvent& e);
66protected:
68 void OnAddFiles(wxCommandEvent& e);
69 void OnAddDirectory(wxCommandEvent& e);
70 void OnRemoveFile(wxCommandEvent& e);
72 void OnFileSelectionChanged(wxCommandEvent& e);
75 void OnModeChanged(wxCommandEvent& e);
76 void OnGeneratePreview(wxCommandEvent& e);
77 void OnGenerateOutput(wxCommandEvent& e);
78 void OnZoom(wxCommandEvent& e);
80 void OnImageLoaded(HuginBase::ImageCache::EntryPtr entry, std::string filename);
81
82private:
84 void ExecuteStacker();
94 void EnableFileButtons();
96 long GetCheckedItemCount() const;
98 void EnableOutputButtons(bool enable);
100 void CleanUpTempFiles();
102 void SortList();
104 void FillFileList();
105 void AddFileInfo(const long fileIndex);
106 // member variables
107 wxListCtrl* m_fileListCtrl{ nullptr };
117 std::string m_selectedImage;
120 bool m_cleanupOutput = false;
121 // store current sorting column
122 long m_sortCol{ -1 };
123 bool m_sortAscending{ true };
124
126};
127
128#endif // STACKERPANEL_H
declaration of PreviewWindow class
std::shared_ptr< Request > RequestPtr
Reference counted request for an image to load.
Definition ImageCache.h:151
std::shared_ptr< Entry > EntryPtr
a shared pointer to the entry
Definition ImageCache.h:112
preview window
panel for stacker GUI
void OnRemoveFile(wxCommandEvent &e)
void SortList()
sort filename list
std::string m_selectedImage
PreviewWindow * m_preview
long GetCheckedItemCount() const
return the number of check images
void OnZoom(wxCommandEvent &e)
void CleanUpTempFiles()
delete all temporary files, to be called mainly at end
void OnAddDirectory(wxCommandEvent &e)
wxSpinCtrlDouble * m_winsorTrim
void OnFileColumnHeaderClick(wxListEvent &e)
void OnProcessFinished(wxCommandEvent &e)
call at the end of the enfuse command, to load result back and enable buttons again
void OnFileCheckStateChanged(wxListEvent &e)
void ExecuteStackerExiftool()
build the command line and execute enfuse and exiftool afterwards
wxListCtrl * m_fileListCtrl
wxSpinCtrl * m_sigmaMaxIter
HuginBase::ImageCache::RequestPtr m_imgRequest
void EnableOutputButtons(bool enable)
enable/disable output buttons
void OnFileListChar(wxKeyEvent &e)
bool Create(wxWindow *parent, MyExecPanel *logPanel)
creates the control and populates all controls with their settings
std::vector< FileInfo > FileInfoVector
void AddFileInfo(const long fileIndex)
void OnImageLoaded(HuginBase::ImageCache::EntryPtr entry, std::string filename)
called when is image is fully loaded to display image in wxStaticBitmap
wxChoice * m_modeChoice
FileInfoVector m_files
wxStaticBitmap * m_smallImagePreview
void OnModeChanged(wxCommandEvent &e)
void FillFileList()
fill the list from internal file list
void AddFile(const wxString &filename)
adds the given file to the list
wxArrayString m_outputFilenames
void EnableFileButtons()
enable/disable the file(s) remove and create buttons depending on selection of wxListCtrl
MyExecPanel * m_logWindow
void ExecuteStacker()
build the command line and execute enfuse command
void OnGenerateOutput(wxCommandEvent &e)
wxString GetStackerOptions()
build string with all stacker options from values in wxPropertyGrid this are the mainly the fusion op...
void OnGeneratePreview(wxCommandEvent &e)
~StackerPanel()
destructor, save state and settings
wxArrayString m_tempFiles
void OnAddFiles(wxCommandEvent &e)
event handler
wxString GetStackerCommandLine()
get the full commandline for enfuse without program, but with files and output options,...
void OnFileSelectionChanged(wxCommandEvent &e)
wxSpinCtrlDouble * m_sigma
include file for the hugin project
FileInfo(const wxString &file, const wxString &new_name, const wxString &new_path, const size_t &new_width, const size_t &new_height)
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.
Definition threshold.h:41