27#include "hugin_config.h"
50#include <pano13/queryfeature.h>
74#define PF_STYLE (wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
84 m_ToolBar = wxXmlResource::Get()->LoadToolBar(
this,
"preview_toolbar");
133 m_VFOVSlider->SetToolTip(
_(
"drag to change the vertical field of view"));
147 m_HFOVSlider->SetToolTip(
_(
"drag to change the horizontal field of view"));
171 for(
int n=0;
n <
nP;
n++) {
195 int oldMode = wxConfigBase::Get()->Read(
"/PreviewFrame/blendMode", 0l);
283 resetProjButton->SetToolTip(
_(
"Resets the projection's parameters to their default values."));
323 int widths[3] = {-3, 150, 150};
325 SetStatusText(
_(
"Left click to define new center point, right click to move point to horizon."),0);
348 long aup =
config->Read(
"/PreviewFrame/autoUpdate",0l);
358 if (
config->Read(
"/PreviewFrame/isShown", 0l) != 0) {
361 SetStatusText(
_(
"Center panorama with left mouse button, set horizon with right button"),0);
400 config->Write(
"/PreviewFrame/isShown", 1l);
402 config->Write(
"/PreviewFrame/isShown", 0l);
422 if (
id >= 0 &&
id <
nImg) {
424 activeImages.insert(
id);
426 activeImages.erase(
id);
513 SetStatusText(
_(
"Center panorama with left mouse button, set horizon with right button"),0);
550 wxString::Format(
" %d ",*
it),
567 for (
unsigned i=0;
i < nrImages;
i++) {
587 if (
event.CanVeto()) {
607void PreviewFrame::OnProjectionChanged()
613 case PanoramaOptions::RECTILINEAR:
Ip =
_(
"Rectilinear");
break;
614 case PanoramaOptions::CYLINDRICAL:
Ip =
_(
"Cylindrical");
break;
615 case PanoramaOptions::EQUIRECTANGULAR:
Ip =
_(
"Equirectangular");
break;
617 opt.projectionFormat = (PanoramaOptions::ProjectionFormat)
lt;
672 DEBUG_INFO (
"new fov: [" <<
opt.getHFOV() <<
" "<<
opt.getVFOV() <<
"] => height: " <<
opt.getHeight() );
711 wxXmlResource::Get()->LoadDialog(&
dlg,
this,
"dlg_numtrans");
712 dlg.CentreOnParent();
777 wxLogError(
_(
"Value for range compression is outside of valid range."));
836 opt.setHFOV(e.GetInt());
838 DEBUG_DEBUG(
"VFOV changed (slider): " << e.GetInt());
839 opt.setVFOV(e.GetInt());
841 int nParam =
opt.m_projFeatures.numberOfParameters;
842 std::vector<double>
para =
opt.getProjectionParameters();
846 para[
i] = e.GetInt();
849 opt.setProjectionParameters(
para);
862 int sel = e.GetSelection();
874 DEBUG_WARN(
"wxChoice event from unknown object received");
945 DEBUG_WARN(
"wxChoice event from unknown object received");
962 DEBUG_WARN(
"wxChoice event from unknown object received");
1001 m_parent->GetEventHandler()->AddPendingEvent(
dummy);
1014 m_parent->GetEventHandler()->AddPendingEvent(
dummy);
@ ID_RANGE_COMPRESSION_SPIN
@ ID_RANGE_COMPRESSION_TEXT
virtual double getResultHorizontalFOV()
virtual double getResultHeight()
static double calcMeanExposure(const PanoramaData &pano)
virtual void run()
runs the algorithm.
void setProjection(ProjectionFormat f)
set the Projection format and adjust the hfov/vfov if nessecary
bool fovCalcSupported(ProjectionFormat f) const
true, if FOV calcuations are supported for projection f
const std::vector< double > & getProjectionParameters() const
Get the optional projection parameters.
void resetProjectionParameters()
sets the optional parameters to their default values
PanoramaOptions::ProjectionFormat getProjection() const
double outputExposureValue
ProjectionFormat
Projection of final panorama.
void setProjectionParameters(const std::vector< double > ¶ms)
set the optional parameters (they need to be of the correct size)
double outputRangeCompression
pano_projection_features m_projFeatures
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
const PanoramaOptions & getOptions() const
returns the options for this panorama
void addObserver(PanoramaObserver *o)
add a panorama observer.
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
UIntSet getActiveImages() const
get active images
std::size_t getNrOfImages() const
number of images.
center panorama horizontically
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
static GlobalCmdHist & getInstance()
straighten panorama horizontically
wxTextCtrl * m_exposureTextCtrl
HuginBase::Panorama & m_pano
wxBoxSizer * m_ButtonSizer
wxScrolledWindow * m_ButtonPanel
void updateProgressDisplay()
update the display
void OnUpdate(wxCommandEvent &event)
PreviewPanel * m_PreviewPanel
wxStaticBoxSizer * m_ToggleButtonSizer
void OnRangeCompressionTextChanged(wxCommandEvent &e)
void OnRedo(wxCommandEvent &e)
event handler for redo
void OnFullScreen(wxCommandEvent &e)
event handler for full screen
void OnAutoPreviewToggle(wxCommandEvent &e)
void OnRangeCompressionIncrease(wxSpinEvent &e)
wxChoice * m_BlendModeChoice
void OnProjectionChoice(wxCommandEvent &e)
void OnBlendChoice(wxCommandEvent &e)
void OnClose(wxCloseEvent &e)
void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
void OnDecreaseExposure(wxSpinEvent &e)
void OnStraighten(wxCommandEvent &e)
std::vector< wxTextCtrl * > m_projParamTextCtrl
void OnFitPano(wxCommandEvent &e)
wxStaticBoxSizer * m_projParamSizer
void OnUndo(wxCommandEvent &e)
event handler for undo
virtual ~PreviewFrame()
dtor.
void OnDefaultExposure(wxCommandEvent &e)
void OnOutputChoice(wxCommandEvent &e)
void OnProjParameterReset(wxCommandEvent &e)
event handler for reset projection parameters
void OnExposureTextChanged(wxCommandEvent &e)
PreviewFrame(wxFrame *frame, HuginBase::Panorama &pano)
ctor.
wxSpinButton * m_rangeCompressionSpinBut
void OnChangeFOV(wxScrollEvent &e)
wxBitmapButton * m_defaultExposureBut
void OnShowAll(wxCommandEvent &e)
void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &changed)
notifies about changes to images
void OnTextCtrlChanged(wxCommandEvent &e)
wxChoice * m_ProjectionChoice
std::vector< wxSlider * > m_projParamSlider
wxSpinButton * m_exposureSpinBut
wxChoice * m_outputModeChoice
void OnRangeCompressionDecrease(wxSpinEvent &e)
void OnShowNone(wxCommandEvent &e)
wxTextCtrl * m_rangeCompressionTextCtrl
void OnIncreaseExposure(wxSpinEvent &e)
std::vector< wxStaticText * > m_projParamNamesLabel
void OnNumTransform(wxCommandEvent &e)
void OnChangeDisplayedImgs(wxCommandEvent &e)
std::vector< wxToggleButton * > m_ToggleButtons
void OnCenterHorizontally(wxCommandEvent &e)
A preview panel that renders the pictures using the panotools library.
void Init(PreviewFrame *parent, HuginBase::Panorama *pano)
void SetAutoUpdate(bool enabled)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
void SetBlendMode(BlendMode b)
Handle EVT_KILL_FOCUS and convert it to a EVT_TEXT_ENTER event.
static huginApp * Get()
hack.. kind of a pseudo singleton...
#define DEBUG_ASSERT(cond)
std::set< unsigned int > UIntSet
bool str2double(const wxString &s, double &d)
std::string doubleToString(double d, int digits)
convert a double to a string, suitable for display within a GUI.
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
bool set_contains(const _Container &c, const typename _Container::key_type &key)
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.