Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CreateBrightImgDlg.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 _CREATEBRIGHTIMGDIALOG_H
27 #define _CREATEBRIGHTIMGDIALOG_H
28 
29 #include "panoinc_WX.h"
30 #include <vector>
31 #include <vigra/imagecontainer.hxx>
32 #include "base_wx/wxImageCache.h"
33 
36 class CreateBrightImgDlg : public wxDialog
37 {
38 public:
40  CreateBrightImgDlg(wxWindow *parent);
44  bool SetImage(const wxString& filename, wxString& errorMsg);
45  wxArrayString GetTempFiles() const;
46 protected:
48  void OnOk(wxCommandEvent & e);
50  void OnCreateExposureLevels(wxCommandEvent& e);
52  void OnExposureSelected(wxListEvent& e);
54  void OnExposureChecked(wxListEvent& e);
56  void OnSize(wxSizeEvent& e);
57 private:
59  double GetExposureStepWidth() const;
61  void RescaleImage();
63  void CreatewxBitmap(const vigra::BRGBImage& img);
65  bool CreateAndSaveExposureCorrectedImage(const wxString& filename, const double correction);
67  long GetCheckedItemCount();
68  // pointer to controls
69  wxChoice* m_stepWidthChoice{ nullptr };
70  wxChoice* m_levelChoice{ nullptr };
71  wxListCtrl* m_exposuresListBox{ nullptr };
72  wxStaticBitmap* m_previewBitmap{ nullptr };
73  // vector of all exposure values
74  std::vector<double> m_exposures;
76  ImageCache::EntryPtr m_image;
78  vigra::BRGBImage m_scaledImg;
80  wxBitmap m_scaledwxBitmap;
81  double m_currentExposure{ 0 };
82  wxArrayString m_tempFiles;
83  wxString m_filename;
84 };
85 
86 #endif //_CREATEBRIGHTIMGDIALOG_H
wxChoice * m_stepWidthChoice
Dialog for create brighter and/or darker versions of an image.
bool CreateAndSaveExposureCorrectedImage(const wxString &filename, const double correction)
create the exposure corrected image and save it to the file
wxBitmap m_scaledwxBitmap
current image as wxBitmap
std::vector< double > m_exposures
CreateBrightImgDlg(wxWindow *parent)
Constructor, read from xrc ressource; restore position.
void OnSize(wxSizeEvent &e)
handler called when size of control was changed
~CreateBrightImgDlg()
destructor, save position
bool SetImage(const wxString &filename, wxString &errorMsg)
load the image, return true on success, otherwise false, error cause is in errorMsg ...
wxStaticBitmap * m_previewBitmap
void OnCreateExposureLevels(wxCommandEvent &e)
update listbox with new exposure values
void RescaleImage()
create rescaled image
wxListCtrl * m_exposuresListBox
void OnExposureChecked(wxListEvent &e)
prevent checking of exposure value 0
void OnExposureSelected(wxListEvent &e)
one exposure selected
vigra::BRGBImage m_scaledImg
current image as vigra::RGBImage
ImageCache::EntryPtr m_image
image cache entry for current image
include file for the hugin project
void CreatewxBitmap(const vigra::BRGBImage &img)
create the wxBitmap version and apply color profiles
double GetExposureStepWidth() const
returns the current selected exposure step width
void OnOk(wxCommandEvent &e)
process all images
long GetCheckedItemCount()
return the number of checked exposures
wxArrayString m_tempFiles
wxArrayString GetTempFiles() const