Hugin trunk 0.1
Loading...
Searching...
No Matches
LensDB.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
10/* This program 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 * 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 _LENS_DB_H
27#define _LENS_DB_H
28
29#include <hugin_shared.h>
31#include <panodata/Panorama.h>
32#include <string>
33#include <vector>
34
35namespace HuginBase
36{
37
38namespace LensDB
39{
41typedef std::vector<std::string> LensList;
42
45{
46public:
48 LensDB();
50 virtual ~LensDB();
51
52 // routines to read from database
58 bool GetCropFactor(const std::string& maker, const std::string& model, double& cropFactor) const;
63 bool GetProjection(const std::string& lens, BaseSrcPanoImage::Projection& projection) const;
71 bool GetCrop(const std::string& lens, const double focal, const vigra::Size2D& imageSize, vigra::Rect2D& cropRect) const;
78 bool GetFov(const std::string& lens, const double focal, double& fov) const;
84 bool GetDistortion(const std::string& lens, const double focal, std::vector<double>& distortion) const;
92 bool GetVignetting(const std::string& lens, const double focal, const double aperture, const double distance, std::vector<double>& vignetting) const;
99 bool GetTCA(const std::string& lens, const double focal, std::vector<double>& tca_red, std::vector<double>& tca_blue) const;
106 bool GetLensNames(const bool distortion, const bool vignetting, const bool tca, LensList& lensList) const;
109 bool CleanUpDatabase();
112 bool RemoveLens(const std::string& lensname);
115 bool RemoveCamera(const std::string& maker, const std::string& model);
116
117 //routines to save to database
123 bool SaveCameraCrop(const std::string& maker, const std::string& model, const double cropfactor);
131 bool SaveEMoR(const std::string& maker, const std::string& model, const int iso, const std::vector<float>& emor, const int weight = 10);
136 bool SaveLensProjection(const std::string& lens, const BaseSrcPanoImage::Projection projection);
144 bool SaveLensCrop(const std::string& lens, const double focal, const vigra::Size2D& imageSize, const vigra::Rect2D& cropRect);
152 bool SaveLensFov(const std::string& lens, const double focal, const double fov, const int weight = 10);
159 bool SaveDistortion(const std::string& lens, const double focal, const std::vector<double>& distortion, const int weight = 10);
168 bool SaveVignetting(const std::string& lens, const double focal, const double aperture, const double distance, const std::vector<double>& vignetting, const int weight = 10);
176 bool SaveTCA(const std::string& lens, const double focal, const std::vector<double>& tca_red, const std::vector<double>& tca_blue, const int weight=10);
178 std::string GetDBFilename() const;
179 // access to single database class
181 static LensDB& GetSingleton();
183 static void Clean();
185 bool ExportToFile(const std::string& filename);
187 bool ImportFromFile(const std::string& filename);
188private:
189 // prevent copying of class
190 LensDB(const LensDB&);
192 // private variables
193 class Database;
196};
197
200
201}; //namespace LensDB
202}; //namespace HuginBase
203
204#endif //_LENS_DB_H
main database class
Definition LensDB.h:45
LensDB(const LensDB &)
LensDB & operator=(const LensDB &)
static LensDB * m_instance
Definition LensDB.h:195
Model for a panorama.
Definition Panorama.h:153
#define IMPEX
std::vector< std::string > LensList
vector storing a list of lens names
Definition LensDB.h:41
bool SaveLensDataFromPano(const HuginBase::Panorama &pano)
routine for automatically saving information from pano into database
Definition LensDB.cpp:2553
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
Definition wxcms.cpp:39
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.
Definition threshold.h:41