28 #include "hugin_config.h"
43 wxXmlResource::Get()->LoadDialog(
this, parent, wxT(
"dlg_focallength"));
45 m_cropText = XRCCTRL(*
this,
"lensdlg_cropfactor_text", wxTextCtrl);
49 m_hfovText = XRCCTRL(*
this,
"lensdlg_hfov_text", wxTextCtrl);
57 m_projChoice = XRCCTRL(*
this,
"lensdlg_type_choice", wxChoice);
62 m_okButton = XRCCTRL(*
this,
"wxID_OK", wxButton);
70 message.Printf(_(
"No or only partial information about field of view was found in image file\n%s\n\nPlease enter the horizontal field of view (HFOV) or the focal length and crop factor."), fn.c_str());
71 XRCCTRL(*
this,
"lensdlg_message", wxStaticText)->SetLabel(message);
90 }
else if (m_cropFactor <= 0 && m_focalLength > 0) {
104 this->GetSizer()->SetSizeHints(
this);
123 DEBUG_DEBUG(
"state: " <<
m_HFOVStr.mb_str(wxConvLocal) <<
", change:" << text.mb_str(wxConvLocal));
124 DEBUG_DEBUG(
"cmd str: " << e.GetString().mb_str(wxConvLocal));
152 wxMessageBox(_(
"The horizontal field of view must be positive."));
204 wxMessageBox(_(
"The focal length must be positive."));
244 wxMessageBox(_(
"The crop factor must be positive."));
266 bool autoCenterCrop=
false;
267 vigra::Rect2D cropRect;
280 std::vector<double> radialDist(4);
284 radialDist[3] = 1 - radialDist[0] - radialDist[1] - radialDist[2];
285 m_srcImg.setRadialDistortion(radialDist);
289 m_srcImg.setRadialDistortionCenterShift(t);
295 std::vector<double> vigCorrCoeff(4);
300 m_srcImg.setRadialVigCorrCoeff(vigCorrCoeff);
303 m_srcImg.setRadialVigCorrCenterShift(t);
305 std::vector<float> resp(5);
367 wxString::Format(_(
"You have given a field of view of %.2f degrees.\n But the orthographic projection is limited to a field of view of 180 degress.\nDo you want still use that high value?"),
m_HFOV),
373 wxICON_EXCLAMATION | wxYES_NO)==wxNO)
void OnFocalLengthChanged(wxCommandEvent &e)
void setCropMode(CropMode val)
Set the crop mode.
void setImageSize(const vigra::Size2D &sz)
set image size in pixels
bool str2double(const wxString &s, double &d)
bool isCircularCrop() const
returns true, if projection requires cicular crop
double getHFOV() const
get HFOV in degrees
wxString doubleTowxString(double d, int digits)
HFOVDialog(wxWindow *parent, HuginBase::SrcPanoImage &srcImg)
ctor.
#define DEBUG_ASSERT(cond)
include file for the hugin project
void OnLoadLensParameters(wxCommandEvent &e)
const Map::mapped_type & const_map_get(const Map &m, const typename Map::key_type &key)
void OnTypeChanged(wxCommandEvent &e)
LensProjectionFormat getProjection() const
get projection type
wxTextCtrl * m_focalLengthText
void OnCropFactorChanged(wxCommandEvent &e)
void OnOk(wxCommandEvent &e)
wxString m_focalLengthStr
static double calcFocalLength(SrcPanoImage::Projection proj, double hfov, double crop, vigra::Size2D imageSize)
calcualte focal length, given crop factor and hfov
include file for the hugin project
HuginBase::SrcPanoImage m_srcImg
static double calcHFOV(SrcPanoImage::Projection proj, double fl, double crop, vigra::Size2D imageSize)
calculate hfov of an image given focal length, image size and crop factor
double getCropFactor() const
get crop factor, d35mm/dreal
HuginBase::SrcPanoImage GetSrcImage()
All variables of a source image.
void OnHFOVChanged(wxCommandEvent &e)