#include <LensDB.h>
Public Member Functions | |
| LensDB () | |
| constructor | |
| virtual | ~LensDB () |
| destructor | |
| void | SetMainDBPath (std::string mainPath) |
| sets the main path of the database files, if not set the default location is used | |
| std::string | GetMainDBPath () |
| return the path where the database is read | |
| std::string | GetUserDBPath () |
| returns the path to the user specific part of the database | |
| void | ReloadUserPart () |
| reloads the user part of the lensfun db | |
| bool | GetCropFactor (std::string maker, std::string model, double &cropFactor) |
| returns the crop factor for the given camera (maker/model) | |
| bool | GetCameraMount (std::string maker, std::string model, std::string &mount) |
| returns the mount of the given camera (maker/model) | |
| bool | FindLens (std::string camMaker, std::string camModel, std::string lens) |
| searches for the given lens and store it parameters inside | |
| void | SetActiveLens (const lfLens *activeLens) |
| sets the active lens for the following Check* call | |
| bool | CheckLensFocal (double focal) |
| checks if the focal length matches the lens spec | |
| bool | CheckLensAperture (double aperture) |
| checks if the aperture matches the lens spec | |
| bool | FindLenses (std::string camMaker, std::string camModel, std::string lensname, LensDBList &foundLenses, bool fuzzy=false) |
| searches for the given lens and gives back a list of matching lenses | |
| bool | GetMounts (std::vector< std::string > &foundMounts) |
| searches for all mounts in the database | |
| bool | GetProjection (BaseSrcPanoImage::Projection &projection) |
| returns the projection of the last found lens (you need to call LensDB::FindLens before calling this procedure) | |
| bool | GetCrop (double focal, BaseSrcPanoImage::CropMode &cropMode, hugin_utils::FDiff2D &cropLeftTop, hugin_utils::FDiff2D &cropRightBottom) |
| returns the crop of the last found lens (you need to call LensDB::FindLens before calling this procedure) | |
| bool | GetFov (double focal, double &fov) |
| returns the field of view of the last found lens (you need to call LensDB::FindLens before calling this procedure) | |
| bool | GetDistortion (double focal, std::vector< double > &distortion) |
| returns the distortion parameters of the last found lens (you need to call LensDB::FindLens before calling this procedure) | |
| bool | GetVignetting (double focal, double aperture, double distance, std::vector< double > &vignetting) |
| returns the vignetting parameters of the last found lens (you need to call LensDB::FindLens before calling this procedure) | |
| bool | SaveCameraCrop (std::string filename, std::string maker, std::string model, std::string mount, double cropfactor) |
| save the camera with the given cropfactor into the given file | |
| int | BeginSaveLens (std::string filename, std::string maker, std::string lensname, std::string mount, BaseSrcPanoImage::Projection projection, double cropfactor) |
| starts saving a lens to database, call LensDB::SaveHFOV, LensDB::SaveCrop, LensDB::SaveDistortion and/or LensDB::SaveVignetting to add information to database, finally save information to file with LensDB::EndSaveLens | |
| void | SaveHFOV (double focal, double hfov) |
| updated the hfov for the given focal length | |
| void | SaveCrop (double focal, BaseSrcPanoImage::CropMode cropMode, hugin_utils::FDiff2D cropLeftTop, hugin_utils::FDiff2D cropRightBottom) |
| updated the crop for the given focal length | |
| void | SaveDistortion (double focal, std::vector< double > distortion) |
| updated the distortion for the given focal length | |
| void | SaveVignetting (double focal, double aperture, double distance, std::vector< double > vignetting) |
| updated the vignetting for the given focal length | |
| bool | EndSaveLens () |
| finally saves the new information to file, see also LensDB::BeginSaveLens | |
Static Public Member Functions | |
| LensDB & | GetSingleton () |
| returns the static LensDB instance | |
| void | Clean () |
| cleanup the static LensDB instance, must be called at the end of the program | |
Private Member Functions | |
| bool | InitDB () |
| initialize db | |
| bool | LoadFilesInDir (std::string path) |
| load all xml files in given path into database | |
| void | CleanSaveInformation () |
| free all ressources used for saving lens | |
| bool | IsNewMount (std::string newMount) |
| check, if mount is already in database, if not it populates the LensDB::m_updatedMounts with the mounts | |
| void | FreeLensList () |
| deletes the lens list | |
| void | CleanUpdatedMounts () |
| cleans up the information stored for mounts (variable LensDB::m_updatedMounts) | |
Private Attributes | |
| lfDatabase * | m_db |
| the main database | |
| lfDatabase * | m_newDB |
| database for saving | |
| const struct lfLens ** | m_lenses |
| found lenses for LensDB::GetProjection, LensDB::GetCrop | |
| bool | m_needLensCleanup |
| variable used for cleanup of lensfun points | |
| lfLens ** | m_updatedLenses |
| list of lenses for saving | |
| lfMount ** | m_updatedMounts |
| list of new mounts for saving | |
| lfLens * | m_currentLens |
| struct of lens currently is saved | |
| std::string | m_lensFilename |
| current filename for saving lens | |
| bool | m_initialized |
| true, if database was successful initialized | |
| std::string | m_main_db_path |
| std::string | m_user_db_path |
Static Private Attributes | |
| LensDB * | m_instance = NULL |
Definition at line 63 of file LensDB.h.
|
|
constructor
Definition at line 49 of file LensDB.cpp. References m_currentLens, m_db, m_initialized, m_lenses, m_needLensCleanup, m_newDB, m_updatedLenses, m_updatedMounts, m_user_db_path, and makefile::string. Referenced by GetSingleton(). |
|
|
destructor
Definition at line 69 of file LensDB.cpp. References CleanSaveInformation(), FreeLensList(), and m_db. |
|
||||||||||||||||||||||||||||
|
starts saving a lens to database, call LensDB::SaveHFOV, LensDB::SaveCrop, LensDB::SaveDistortion and/or LensDB::SaveVignetting to add information to database, finally save information to file with LensDB::EndSaveLens
Definition at line 806 of file LensDB.cpp. References HuginBase::LensDB::basic_path, CleanSaveInformation(), IsNewMount(), m_currentLens, m_lensFilename, m_newDB, m_updatedLenses, HuginBase::LensDB::TranslateProjectionHugin2LF(), and HuginBase::LensDB::TranslateProjectionLF2Hugin(). Referenced by SaveLensParameters(). |
|
|
checks if the aperture matches the lens spec
Definition at line 319 of file LensDB.cpp. References m_lenses. |
|
|
checks if the focal length matches the lens spec
Definition at line 310 of file LensDB.cpp. References m_lenses. |
|
|
cleanup the static LensDB instance, must be called at the end of the program
Definition at line 104 of file LensDB.cpp. References m_instance. Referenced by main(), PTBatcherGUI::OnExit(), huginApp::~huginApp(), and LensCalFrame::~LensCalFrame(). |
|
|
free all ressources used for saving lens
Definition at line 1158 of file LensDB.cpp. References CleanUpdatedMounts(), m_newDB, and m_updatedLenses. Referenced by BeginSaveLens(), EndSaveLens(), SaveCameraCrop(), and ~LensDB(). |
|
|
cleans up the information stored for mounts (variable LensDB::m_updatedMounts)
Definition at line 1222 of file LensDB.cpp. References m_updatedMounts. Referenced by CleanSaveInformation(), and IsNewMount(). |
|
|
finally saves the new information to file, see also LensDB::BeginSaveLens
Definition at line 1128 of file LensDB.cpp. References CleanSaveInformation(), m_currentLens, m_lensFilename, m_newDB, and m_updatedMounts. Referenced by SaveLensParameters(). |
|
||||||||||||||||
|
searches for the given lens and store it parameters inside
Definition at line 244 of file LensDB.cpp. References FindLenses(), FreeLensList(), InitDB(), m_db, m_lenses, m_needLensCleanup, and hugin_utils::tolower(). |
|
||||||||||||||||||||||||
|
searches for the given lens and gives back a list of matching lenses
Definition at line 336 of file LensDB.cpp. References HuginBase::LensDB::LensDBList::GetLensCount(), InitDB(), m_db, HuginBase::LensDB::LensDBList::SetCameraModelMaker(), HuginBase::LensDB::LensDBList::SetLenses(), and hugin_utils::tolower(). Referenced by FindLens(). |
|
|
deletes the lens list
Definition at line 79 of file LensDB.cpp. References m_lenses. Referenced by FindLens(), SetActiveLens(), and ~LensDB(). |
|
||||||||||||||||
|
returns the mount of the given camera (maker/model)
Definition at line 229 of file LensDB.cpp. References InitDB(), m_db, and makefile::string. Referenced by SaveCameraCropFactor(), and SaveLensParameters(). |
|
||||||||||||||||||||
|
returns the crop of the last found lens (you need to call LensDB::FindLens before calling this procedure)
Definition at line 545 of file LensDB.cpp. References hugin_utils::FDiff2D, m_lenses, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. Referenced by ApplyLensDBParameters(). |
|
||||||||||||||||
|
returns the crop factor for the given camera (maker/model)
Definition at line 214 of file LensDB.cpp. |
|
||||||||||||
|
returns the distortion parameters of the last found lens (you need to call LensDB::FindLens before calling this procedure)
Definition at line 602 of file LensDB.cpp. References m_lenses. Referenced by ApplyLensDBParameters(). |
|
||||||||||||
|
returns the field of view of the last found lens (you need to call LensDB::FindLens before calling this procedure)
Definition at line 585 of file LensDB.cpp. References m_lenses. Referenced by ApplyLensDBParameters(). |
|
|
return the path where the database is read
Definition at line 118 of file LensDB.cpp. Referenced by AboutDialog::GetSystemInformation(). |
|
|
searches for all mounts in the database
Definition at line 388 of file LensDB.cpp. |
|
|
returns the projection of the last found lens (you need to call LensDB::FindLens before calling this procedure)
Definition at line 536 of file LensDB.cpp. References m_lenses, and HuginBase::LensDB::TranslateProjectionLF2Hugin(). Referenced by ApplyLensDBParameters(). |
|
|
returns the static LensDB instance
Definition at line 95 of file LensDB.cpp. References LensDB(), and m_instance. Referenced by LoadLensDBDialog::ActivateSelectedLens(), ApplyLensDBParameters(), EVT_LIST_ITEM_ACTIVATED(), AboutDialog::GetSystemInformation(), InitLensDB(), huginApp::OnInit(), LensCalApp::OnInit(), LoadLensDBDialog::OnSearch(), SaveCameraCropFactor(), and SaveLensParameters(). |
|
|
returns the path to the user specific part of the database
Definition at line 123 of file LensDB.cpp. Referenced by AboutDialog::GetSystemInformation(), SaveCameraCropFactor(), and SaveLensParameters(). |
|
||||||||||||||||||||
|
returns the vignetting parameters of the last found lens (you need to call LensDB::FindLens before calling this procedure)
Definition at line 642 of file LensDB.cpp. References vigra_ext::distance(), and m_lenses. Referenced by ApplyLensDBParameters(). |
|
|
initialize db
Definition at line 128 of file LensDB.cpp. References LoadFilesInDir(), m_db, m_initialized, m_main_db_path, and m_user_db_path. Referenced by FindLens(), FindLenses(), GetCameraMount(), GetCropFactor(), GetMounts(), and ReloadUserPart(). |
|
|
check, if mount is already in database, if not it populates the LensDB::m_updatedMounts with the mounts
Definition at line 1177 of file LensDB.cpp. References CleanUpdatedMounts(), m_db, m_newDB, and m_updatedMounts. Referenced by BeginSaveLens(), and SaveCameraCrop(). |
|
|
load all xml files in given path into database
Definition at line 161 of file LensDB.cpp. References HuginBase::LensDB::basic_path, GETPATHSTRING, m_db, makefile::path, and makefile::string. Referenced by InitDB(), and ReloadUserPart(). |
|
|
reloads the user part of the lensfun db
Definition at line 198 of file LensDB.cpp. References InitDB(), LoadFilesInDir(), m_db, and m_user_db_path. Referenced by SaveLensParameters(). |
|
||||||||||||||||||||||||
|
save the camera with the given cropfactor into the given file
Definition at line 678 of file LensDB.cpp. References HuginBase::LensDB::basic_path, CleanSaveInformation(), IsNewMount(), and m_newDB. Referenced by SaveCameraCropFactor(), and SaveLensParameters(). |
|
||||||||||||||||||||
|
updated the crop for the given focal length
Definition at line 992 of file LensDB.cpp. References hugin_utils::FDiff2D, m_currentLens, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. Referenced by SaveLensParameters(). |
|
||||||||||||
|
updated the distortion for the given focal length
Definition at line 1054 of file LensDB.cpp. References m_currentLens. Referenced by SaveLensParameters(). |
|
||||||||||||
|
updated the hfov for the given focal length
Definition at line 963 of file LensDB.cpp. References m_currentLens. Referenced by SaveLensParameters(). |
|
||||||||||||||||||||
|
updated the vignetting for the given focal length
Definition at line 1089 of file LensDB.cpp. References vigra_ext::distance(), and m_currentLens. Referenced by SaveLensParameters(). |
|
|
sets the active lens for the following Check* call
Definition at line 302 of file LensDB.cpp. References FreeLensList(), m_lenses, and m_needLensCleanup. |
|
|
sets the main path of the database files, if not set the default location is used
Definition at line 113 of file LensDB.cpp. References m_main_db_path. |
|
|
struct of lens currently is saved
Definition at line 220 of file LensDB.h. Referenced by BeginSaveLens(), EndSaveLens(), LensDB(), SaveCrop(), SaveDistortion(), SaveHFOV(), and SaveVignetting(). |
|
|
the main database
Definition at line 208 of file LensDB.h. Referenced by FindLens(), FindLenses(), GetCameraMount(), GetCropFactor(), GetMounts(), InitDB(), IsNewMount(), LensDB(), LoadFilesInDir(), ReloadUserPart(), and ~LensDB(). |
|
|
true, if database was successful initialized
|
|
|
Definition at line 47 of file LensDB.cpp. Referenced by Clean(), and GetSingleton(). |
|
|
found lenses for LensDB::GetProjection, LensDB::GetCrop
Definition at line 212 of file LensDB.h. Referenced by CheckLensAperture(), CheckLensFocal(), FindLens(), FreeLensList(), GetCrop(), GetDistortion(), GetFov(), GetProjection(), GetVignetting(), LensDB(), and SetActiveLens(). |
|
|
current filename for saving lens
Definition at line 222 of file LensDB.h. Referenced by BeginSaveLens(), and EndSaveLens(). |
|
|
Definition at line 226 of file LensDB.h. Referenced by InitDB(), and SetMainDBPath(). |
|
|
variable used for cleanup of lensfun points
Definition at line 214 of file LensDB.h. Referenced by FindLens(), LensDB(), and SetActiveLens(). |
|
|
database for saving
Definition at line 210 of file LensDB.h. Referenced by BeginSaveLens(), CleanSaveInformation(), EndSaveLens(), IsNewMount(), LensDB(), and SaveCameraCrop(). |
|
|
list of lenses for saving
Definition at line 216 of file LensDB.h. Referenced by BeginSaveLens(), CleanSaveInformation(), and LensDB(). |
|
|
list of new mounts for saving
Definition at line 218 of file LensDB.h. Referenced by CleanUpdatedMounts(), EndSaveLens(), IsNewMount(), and LensDB(). |
|
|
Definition at line 227 of file LensDB.h. Referenced by InitDB(), LensDB(), and ReloadUserPart(). |
1.3.9.1