LensTools.cpp File Reference

some helper classes for working with lenses More...

#include "panoinc_WX.h"
#include "panoinc.h"
#include "LensTools.h"
#include <algorithm>
#include "panodata/ImageVariableTranslate.h"
#include "panodata/image_variables.h"

Include dependency graph for LensTools.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define image_variable(name, type, default_value)

Functions

void FillLensProjectionList (wxControlWithItems *list)
 Fills a wxControlWithItem with all input projection formats, the client data contains the associated projection number.
void SelectProjection (wxControlWithItems *list, size_t new_projection)
 Selects the given projection in the given list item.
size_t GetSelectedProjection (wxControlWithItems *list)
 Returns the selected projection number from list.
void SaveLensParameters (const wxString filename, HuginBase::Panorama *pano, unsigned int imgNr)
 save the lens parameters of the image to a lens file named filename
bool ApplyLensParameters (wxWindow *parent, PT::Panorama *pano, HuginBase::UIntSet images, PT::PanoCommand *&cmd)
 applies lens parameter from user selected file to pano using GlobalCmdHist
bool LoadLensParametersChoose (wxWindow *parent, HuginBase::Lens &lens, bool &cropped, bool &autoCenterCrop, vigra::Rect2D &cropRect)
 load lens parameters from lens ini file
void SaveLensParametersToIni (wxWindow *parent, PT::Panorama *pano, const HuginBase::UIntSet images)
 saves the lens parameters to ini files, provides all necessary dialogs


Detailed Description

some helper classes for working with lenses

Author:
T. Modes

Definition in file LensTools.cpp.


Define Documentation

#define image_variable name,
type,
default_value   ) 
 

Value:

if (HuginBase::PTOVariableConverterFor##name::checkApplicability(it->second.getName()))\
            {\
                if(it->second.isLinked())\
                    linkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
                else\
                    unlinkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
            }


Function Documentation

bool ApplyLensParameters wxWindow *  parent,
PT::Panorama pano,
HuginBase::UIntSet  images,
PT::PanoCommand *&  cmd
 

applies lens parameter from user selected file to pano using GlobalCmdHist

Todo:
I think the sensor size should be copied over, but SrcPanoImage doesn't have such a variable yet.

Definition at line 129 of file LensTools.cpp.

References HuginBase::Lens::getCropFactor(), HuginBase::Panorama::getImageVariables(), HuginBase::ConstStandardImageVariableGroups::getLensForImage(), HuginBase::Lens::getProjection(), LoadLensParametersChoose(), and HuginBase::Lens::variables.

Referenced by PanoOperation::LoadLensOperation::GetInternalCommand().

void FillLensProjectionList wxControlWithItems *  list  ) 
 

Fills a wxControlWithItem with all input projection formats, the client data contains the associated projection number.

Definition at line 34 of file LensTools.cpp.

Referenced by ImagesPanel::Create(), EVT_BUTTON(), GLPreviewFrame::GLPreviewFrame(), and LensCalFrame::LensCalFrame().

size_t GetSelectedProjection wxControlWithItems *  list  ) 
 

Returns the selected projection number from list.

Definition at line 62 of file LensTools.cpp.

Referenced by GLPreviewFrame::OnLensTypeChanged(), ImagesPanel::OnLensTypeChanged(), HFOVDialog::OnTypeChanged(), and LensCalFrame::ReadInputs().

bool LoadLensParametersChoose wxWindow *  parent,
HuginBase::Lens lens,
bool &  cropped,
bool &  autoCenterCrop,
vigra::Rect2D &  cropRect
 

load lens parameters from lens ini file

Parameters:
parent parent window, for showing messageboxes
lens lens, for reading projection and lensparameters
cropped read if cropped enabled
autoCenterCrop read if automatic center crop
cropRect read crop rect
Returns:
true if lens parameters were sucessful read

Definition at line 214 of file LensTools.cpp.

References cerr, DEBUG_DEBUG, HuginBase::Lens::getImageSize(), map_get(), HuginBase::Lens::setCropFactor(), HuginBase::Lens::setProjection(), makefile::string, and HuginBase::Lens::variables.

Referenced by ApplyLensParameters(), and HFOVDialog::OnLoadLensParameters().

void SaveLensParameters const wxString  filename,
HuginBase::Panorama pano,
unsigned int  imgNr
 

save the lens parameters of the image to a lens file named filename

Definition at line 67 of file LensTools.cpp.

void SaveLensParametersToIni wxWindow *  parent,
PT::Panorama pano,
const HuginBase::UIntSet  images
 

saves the lens parameters to ini files, provides all necessary dialogs

Definition at line 339 of file LensTools.cpp.

References SaveLensParameters().

Referenced by PanoOperation::SaveLensOperation::GetInternalCommand().

void SelectProjection wxControlWithItems *  list,
size_t  new_projection
 

Selects the given projection in the given list item.

Definition at line 49 of file LensTools.cpp.

Referenced by LensCalFrame::AddImages(), EVT_BUTTON(), HFOVDialog::OnLoadLensParameters(), ImagesPanel::OnSelectionChanged(), and GLPreviewFrame::panoramaChanged().


Generated on Tue Sep 23 01:25:40 2014 for Hugintrunk by  doxygen 1.3.9.1