PanoramaVariable.cpp

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00026 #include "PanoramaVariable.h"
00027 
00028 #include <iostream>
00029 #include <iomanip>
00030 #include <utility>
00031 
00032 
00033 namespace HuginBase {
00034     
00035 
00036 std::ostream & Variable::print(std::ostream & o) const
00037 {
00038     return o << name << std::setprecision(15) << value;
00039 }
00040 
00041 std::ostream & LensVariable::printLink(std::ostream & o,
00042                                        unsigned int linkImage) const
00043 {
00044     return o << name << "=" << linkImage;
00045 }
00046 
00047 
00048 void fillVariableMap(VariableMap & vars)
00049 {
00050     vars.insert(std::pair<const char*, Variable>("y",Variable("y",0)));
00051     vars.insert(std::pair<const char*, Variable>("r",Variable("r",0)));
00052     vars.insert(std::pair<const char*, Variable>("p",Variable("p",0)));
00053 
00054     vars.insert(std::pair<const char*, Variable>("TrX",Variable("TrX",0)));
00055     vars.insert(std::pair<const char*, Variable>("TrY",Variable("TrY",0)));
00056     vars.insert(std::pair<const char*, Variable>("TrZ",Variable("TrZ",0)));
00057 
00058     vars.insert(std::pair<const char*, Variable>("Tpy",Variable("Tpy",0)));
00059     vars.insert(std::pair<const char*, Variable>("Tpp",Variable("Tpp",0)));
00060 
00061     vars.insert(std::pair<const char*, Variable>("j",Variable("j",0)));
00062     
00063     // Lens variables
00064     vars.insert(std::pair<const char*, Variable>("v",Variable("v",51)));
00065     vars.insert(std::pair<const char*, Variable>("a",Variable("a",0.0)));
00066     vars.insert(std::pair<const char*, Variable>("b",Variable("b",0.0)));
00067     vars.insert(std::pair<const char*, Variable>("c",Variable("c",0.0)));
00068     vars.insert(std::pair<const char*, Variable>("d",Variable("d",0)));
00069     vars.insert(std::pair<const char*, Variable>("e",Variable("e",0)));
00070     vars.insert(std::pair<const char*, Variable>("g",Variable("g",0)));
00071     vars.insert(std::pair<const char*, Variable>("t",Variable("t",0)));
00072     
00073     vars.insert(std::pair<const char*, Variable>("Va",Variable("Va",1)));
00074     vars.insert(std::pair<const char*, Variable>("Vb",Variable("Vb",0)));
00075     vars.insert(std::pair<const char*, Variable>("Vc",Variable("Vc",0)));
00076     vars.insert(std::pair<const char*, Variable>("Vd",Variable("Vd",0)));
00077     vars.insert(std::pair<const char*, Variable>("Vx",Variable("Vx",0)));
00078     vars.insert(std::pair<const char*, Variable>("Vy",Variable("Vy",0)));
00079     
00080     // exposure value and white balance
00081     vars.insert(std::pair<const char*, Variable>("Eev",Variable("Eev",0.0)));
00082     vars.insert(std::pair<const char*, Variable>("Er",Variable("Er",1.0)));
00083     vars.insert(std::pair<const char*, Variable>("Eb",Variable("Eb",1.0)));
00084     
00085     // emor response variables
00086     vars.insert(std::pair<const char*, Variable>("Ra",Variable("Ra",0.0)));
00087     vars.insert(std::pair<const char*, Variable>("Rb",Variable("Rb",0.0)));
00088     vars.insert(std::pair<const char*, Variable>("Rc",Variable("Rc",0.0)));
00089     vars.insert(std::pair<const char*, Variable>("Rd",Variable("Rd",0.0)));
00090     vars.insert(std::pair<const char*, Variable>("Re",Variable("Re",0.0)));
00091 }
00092 
00093 void fillLensVarMap(LensVarMap & variables)
00094 {
00095     variables.insert(std::pair<const char*, LensVariable>("v",LensVariable("v", 51, true)));
00096     variables.insert(std::pair<const char*, LensVariable>("a",LensVariable("a", 0.0, true )));
00097     variables.insert(std::pair<const char*, LensVariable>("b",LensVariable("b", 0.0, true)));
00098     variables.insert(std::pair<const char*, LensVariable>("c",LensVariable("c", 0.0, true)));
00099     variables.insert(std::pair<const char*, LensVariable>("d",LensVariable("d", 0.0, true)));
00100     variables.insert(std::pair<const char*, LensVariable>("e",LensVariable("e", 0.0, true)));
00101     variables.insert(std::pair<const char*, LensVariable>("g",LensVariable("g", 0.0, true)));
00102     variables.insert(std::pair<const char*, LensVariable>("t",LensVariable("t", 0.0, true)));
00103     
00104     // vignetting correction variables
00105     variables.insert(std::pair<const char*, LensVariable>("Va",LensVariable("Va", 1.0, true)));
00106     variables.insert(std::pair<const char*, LensVariable>("Vb",LensVariable("Vb", 0.0, true)));
00107     variables.insert(std::pair<const char*, LensVariable>("Vc",LensVariable("Vc", 0.0, true)));
00108     variables.insert(std::pair<const char*, LensVariable>("Vd",LensVariable("Vd", 0.0, true)));
00109     variables.insert(std::pair<const char*, LensVariable>("Vx",LensVariable("Vx", 0.0, true)));
00110     variables.insert(std::pair<const char*, LensVariable>("Vy",LensVariable("Vy", 0.0, true)));
00111     
00112     // exposure
00113     variables.insert(std::pair<const char*, LensVariable>("Eev",LensVariable("Eev", 0.0, false)));
00114     variables.insert(std::pair<const char*, LensVariable>("Er",LensVariable("Er", 1.0, false)));
00115     variables.insert(std::pair<const char*, LensVariable>("Eb",LensVariable("Eb", 1.0, false)));
00116     
00117     // emor response variables
00118     variables.insert(std::pair<const char*, LensVariable>("Ra",LensVariable("Ra",0.0, true)));
00119     variables.insert(std::pair<const char*, LensVariable>("Rb",LensVariable("Rb",0.0, true)));
00120     variables.insert(std::pair<const char*, LensVariable>("Rc",LensVariable("Rc",0.0, true)));
00121     variables.insert(std::pair<const char*, LensVariable>("Rd",LensVariable("Rd",0.0, true)));
00122     variables.insert(std::pair<const char*, LensVariable>("Re",LensVariable("Re",0.0, true)));
00123 }
00124 
00125 
00126 void printVariableMap(std::ostream & o, const VariableMap & vars)
00127 {
00128     for ( VariableMap::const_iterator it = vars.begin(); it != vars.end();++it)
00129     {
00130         it->second.print(o);
00131         o << " ";
00132     }
00133 }
00134 
00135 
00136 } // namespace

Generated on Mon Apr 21 01:25:37 2014 for Hugintrunk by  doxygen 1.3.9.1